// Implicit group for all logged-in accounts
$wgGroupPermissions['user' ]['move'] = true;
$wgGroupPermissions['user' ]['move-subpages'] = true;
+$wgGroupPermissions['user' ]['move-rootuserpages'] = true; // can move root userpages
$wgGroupPermissions['user' ]['read'] = true;
$wgGroupPermissions['user' ]['edit'] = true;
$wgGroupPermissions['user' ]['createpage'] = true;
$wgGroupPermissions['sysop']['importupload'] = true;
$wgGroupPermissions['sysop']['move'] = true;
$wgGroupPermissions['sysop']['move-subpages'] = true;
+$wgGroupPermissions['sysop']['move-rootuserpages'] = true;
$wgGroupPermissions['sysop']['patrol'] = true;
$wgGroupPermissions['sysop']['autopatrol'] = true;
$wgGroupPermissions['sysop']['protect'] = true;
* @return \type{\mixed} True on success, getUserPermissionsErrors()-like array on failure
*/
public function isValidMoveOperation( &$nt, $auth = true, $reason = '' ) {
+ global $wgUser;
+
$errors = array();
if( !$nt ) {
// Normally we'd add this to $errors, but we'll get
}
if ( $auth ) {
- global $wgUser;
$errors = wfArrayMerge($errors,
$this->getUserPermissionsErrors('move', $wgUser),
$this->getUserPermissionsErrors('edit', $wgUser),
$nt->getUserPermissionsErrors('move', $wgUser),
$nt->getUserPermissionsErrors('edit', $wgUser));
+
+ # Root userpage ?
+ if ( $nt->getNamespace() == NS_USER && !$nt->isSubpage() && !$wgUser->isAllowed('move-rootuserpages') ) {
+ $errors[] = array('moverootuserpagesnotallowed');
+ }
}
$match = EditPage::matchSpamRegex( $reason );
$errors[] = array('spamprotectiontext');
}
- global $wgUser;
$err = null;
if( !wfRunHooks( 'AbortMove', array( $this, $nt, $wgUser, &$err, $reason ) ) ) {
$errors[] = array('hookaborted', $err);
In those cases, you will have to move or merge the page manually if desired.",
'movearticle' => 'Move page:',
'movenotallowed' => 'You do not have permission to move pages on {{SITENAME}}.',
+'moverootuserpagesnotallowed' => 'You do not have permission to move root user pages on {{SITENAME}}.',
'newtitle' => 'To new title:',
'move-watch' => 'Watch this page',
'movepagebtn' => 'Move page',
Dans ce cas, vous devrez renommer ou fusionner la page manuellement si vous le désirez.',
'movearticle' => 'Renommer l’article',
'movenotallowed' => 'Vous n’avez pas la permission de renommer des pages sur ce wiki.',
+'moverootuserpagesnotallowed' => 'Vous n’avez pas la permission de renommer des pages utilisateurs racines sur ce wiki.',
'newtitle' => 'Nouveau titre',
'move-watch' => 'Suivre cette page',
'movepagebtn' => 'Renommer l’article',