Index: trunk/phase3/includes/Title.php |
— | — | @@ -1166,6 +1166,25 @@ |
1167 | 1167 | |
1168 | 1168 | $errors = array(); |
1169 | 1169 | |
| 1170 | + if( !$user->isAllowed( $action ) ) { |
| 1171 | + $return = null; |
| 1172 | + $groups = array_map( array( 'User', 'makeGroupLinkWiki' ), |
| 1173 | + User::getGroupsWithPermission( $action ) ); |
| 1174 | + if( $groups ) { |
| 1175 | + $return = array( 'badaccess-groups', |
| 1176 | + array( implode( ', ', $groups ), count( $groups ) ) ); |
| 1177 | + } else { |
| 1178 | + $return = array( "badaccess-group0" ); |
| 1179 | + } |
| 1180 | + $errors[] = $return; |
| 1181 | + } |
| 1182 | + |
| 1183 | + # Short-circuit point |
| 1184 | + if( $short && count($errors) > 0 ) { |
| 1185 | + wfProfileOut( __METHOD__ ); |
| 1186 | + return $errors; |
| 1187 | + } |
| 1188 | + |
1170 | 1189 | // Use getUserPermissionsErrors instead |
1171 | 1190 | if( !wfRunHooks( 'userCan', array( &$this, &$user, $action, &$result ) ) ) { |
1172 | 1191 | wfProfileOut( __METHOD__ ); |
— | — | @@ -1339,17 +1358,6 @@ |
1340 | 1359 | } elseif( !$this->isMovable() ) { |
1341 | 1360 | $errors[] = array( 'immobile-target-page' ); |
1342 | 1361 | } |
1343 | | - } elseif( !$user->isAllowed( $action ) ) { |
1344 | | - $return = null; |
1345 | | - $groups = array_map( array( 'User', 'makeGroupLinkWiki' ), |
1346 | | - User::getGroupsWithPermission( $action ) ); |
1347 | | - if( $groups ) { |
1348 | | - $return = array( 'badaccess-groups', |
1349 | | - array( implode( ', ', $groups ), count( $groups ) ) ); |
1350 | | - } else { |
1351 | | - $return = array( "badaccess-group0" ); |
1352 | | - } |
1353 | | - $errors[] = $return; |
1354 | 1362 | } |
1355 | 1363 | |
1356 | 1364 | wfProfileOut( __METHOD__ ); |