Index: trunk/phase3/languages/messages/MessagesEn.php |
— | — | @@ -2616,6 +2616,7 @@ |
2617 | 2617 | In those cases, you will have to move or merge the page manually if desired.", |
2618 | 2618 | 'movearticle' => 'Move page:', |
2619 | 2619 | 'movenotallowed' => 'You do not have permission to move pages on {{SITENAME}}.', |
| 2620 | +'moverootuserpagesnotallowed' => 'You do not have permission to move root user pages on {{SITENAME}}.', |
2620 | 2621 | 'newtitle' => 'To new title:', |
2621 | 2622 | 'move-watch' => 'Watch this page', |
2622 | 2623 | 'movepagebtn' => 'Move page', |
Index: trunk/phase3/languages/messages/MessagesFr.php |
— | — | @@ -2120,6 +2120,7 @@ |
2121 | 2121 | Dans ce cas, vous devrez renommer ou fusionner la page manuellement si vous le désirez.', |
2122 | 2122 | 'movearticle' => 'Renommer l’article', |
2123 | 2123 | 'movenotallowed' => 'Vous n’avez pas la permission de renommer des pages sur ce wiki.', |
| 2124 | +'moverootuserpagesnotallowed' => 'Vous n’avez pas la permission de renommer des pages utilisateurs racines sur ce wiki.', |
2124 | 2125 | 'newtitle' => 'Nouveau titre', |
2125 | 2126 | 'move-watch' => 'Suivre cette page', |
2126 | 2127 | 'movepagebtn' => 'Renommer l’article', |
Index: trunk/phase3/includes/Title.php |
— | — | @@ -2379,6 +2379,8 @@ |
2380 | 2380 | * @return \type{\mixed} True on success, getUserPermissionsErrors()-like array on failure |
2381 | 2381 | */ |
2382 | 2382 | public function isValidMoveOperation( &$nt, $auth = true, $reason = '' ) { |
| 2383 | + global $wgUser; |
| 2384 | + |
2383 | 2385 | $errors = array(); |
2384 | 2386 | if( !$nt ) { |
2385 | 2387 | // Normally we'd add this to $errors, but we'll get |
— | — | @@ -2421,12 +2423,16 @@ |
2422 | 2424 | } |
2423 | 2425 | |
2424 | 2426 | if ( $auth ) { |
2425 | | - global $wgUser; |
2426 | 2427 | $errors = wfArrayMerge($errors, |
2427 | 2428 | $this->getUserPermissionsErrors('move', $wgUser), |
2428 | 2429 | $this->getUserPermissionsErrors('edit', $wgUser), |
2429 | 2430 | $nt->getUserPermissionsErrors('move', $wgUser), |
2430 | 2431 | $nt->getUserPermissionsErrors('edit', $wgUser)); |
| 2432 | + |
| 2433 | + # Root userpage ? |
| 2434 | + if ( $nt->getNamespace() == NS_USER && !$nt->isSubpage() && !$wgUser->isAllowed('move-rootuserpages') ) { |
| 2435 | + $errors[] = array('moverootuserpagesnotallowed'); |
| 2436 | + } |
2431 | 2437 | } |
2432 | 2438 | |
2433 | 2439 | $match = EditPage::matchSpamRegex( $reason ); |
— | — | @@ -2435,7 +2441,6 @@ |
2436 | 2442 | $errors[] = array('spamprotectiontext'); |
2437 | 2443 | } |
2438 | 2444 | |
2439 | | - global $wgUser; |
2440 | 2445 | $err = null; |
2441 | 2446 | if( !wfRunHooks( 'AbortMove', array( $this, $nt, $wgUser, &$err, $reason ) ) ) { |
2442 | 2447 | $errors[] = array('hookaborted', $err); |
Index: trunk/phase3/includes/DefaultSettings.php |
— | — | @@ -1126,6 +1126,7 @@ |
1127 | 1127 | // Implicit group for all logged-in accounts |
1128 | 1128 | $wgGroupPermissions['user' ]['move'] = true; |
1129 | 1129 | $wgGroupPermissions['user' ]['move-subpages'] = true; |
| 1130 | +$wgGroupPermissions['user' ]['move-rootuserpages'] = true; // can move root userpages |
1130 | 1131 | $wgGroupPermissions['user' ]['read'] = true; |
1131 | 1132 | $wgGroupPermissions['user' ]['edit'] = true; |
1132 | 1133 | $wgGroupPermissions['user' ]['createpage'] = true; |
— | — | @@ -1164,6 +1165,7 @@ |
1165 | 1166 | $wgGroupPermissions['sysop']['importupload'] = true; |
1166 | 1167 | $wgGroupPermissions['sysop']['move'] = true; |
1167 | 1168 | $wgGroupPermissions['sysop']['move-subpages'] = true; |
| 1169 | +$wgGroupPermissions['sysop']['move-rootuserpages'] = true; |
1168 | 1170 | $wgGroupPermissions['sysop']['patrol'] = true; |
1169 | 1171 | $wgGroupPermissions['sysop']['autopatrol'] = true; |
1170 | 1172 | $wgGroupPermissions['sysop']['protect'] = true; |