Index: trunk/extensions/EditOwn/EditOwn.php |
— | — | @@ -38,16 +38,18 @@ |
39 | 39 | $wgHooks['userCan'][] = 'EditOwn'; |
40 | 40 | |
41 | 41 | $wgEditOwnExcludedNamespaces = array(); |
| 42 | +$wgEditOwnActions = array('edit'); |
42 | 43 | |
43 | 44 | function EditOwn($title, $user, $action, &$result) |
44 | 45 | { |
45 | 46 | static $cache = array(); |
46 | | - global $wgEditOwnExcludedNamespaces; |
| 47 | + global $wgEditOwnExcludedNamespaces, $wgEditOwnActions; |
47 | 48 | if(!is_array($wgEditOwnExcludedNamespaces)) |
48 | 49 | // Prevent PHP from whining |
49 | 50 | $wgEditOwnExcludedNamespaces = array(); |
50 | 51 | |
51 | | - if($action != 'edit' || $user->isAllowed('editall') || |
| 52 | + if(!in_array($action, $wgEditOwnActions) || |
| 53 | + $user->isAllowed('editall')|| |
52 | 54 | in_array($title->getNamespace(), $wgEditOwnExcludedNamespaces)) |
53 | 55 | { |
54 | 56 | $result = null; |
— | — | @@ -65,7 +67,7 @@ |
66 | 68 | $dbr = wfGetDb(DB_SLAVE); |
67 | 69 | $res = $dbr->select('revision', Revision::selectFields(), |
68 | 70 | array('rev_page' => $title->getArticleId()), |
69 | | - __METHOD__, array('ORDER BY' => 'rev_timestamp ASC', |
| 71 | + __METHOD__, array('ORDER BY' => 'rev_timestamp', |
70 | 72 | 'LIMIT' => 1)); |
71 | 73 | $row = $dbr->fetchObject($res); |
72 | 74 | if(!$row) |