From 5f32a8b265325f916f0d6da73242b9673aacff76 Mon Sep 17 00:00:00 2001 From: Happy-melon Date: Sat, 19 Sep 2009 12:50:00 +0000 Subject: [PATCH] Implement a 'root' permission, which grants all other permissions. Useful for debugging and administration. --- RELEASE-NOTES | 3 +++ includes/User.php | 1 + languages/messages/MessagesEn.php | 4 +++- languages/messages/MessagesQqq.php | 3 +++ maintenance/language/messages.inc | 1 + 5 files changed, 11 insertions(+), 1 deletion(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index d804e1a0c1..e576ac2c9e 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -230,6 +230,9 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN $wgAJAXCategoriesNamespaces. * Admins could disable some variants using $wgDisabledVariants now. ONLY apply on wikis enabled LanguageConverter. +* A new permission, 'root', is created. Analogous to root users on Unix systems, + the root permission effectively grants all other permissions on a wiki. Useful + for debugging and administration. === Bug fixes in 1.16 === diff --git a/includes/User.php b/includes/User.php index 1f79998cb0..eecaccfc50 100644 --- a/includes/User.php +++ b/includes/User.php @@ -2152,6 +2152,7 @@ class User { # Use strict parameter to avoid matching numeric 0 accidentally inserted # by misconfiguration: 0 == 'foo' return in_array( $action, $this->getRights(), true ) + || in_array( 'root', $this->getRights(), true ); } /** diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index 15d983e254..54f5c539a9 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -1042,7 +1042,7 @@ Do not forget to change your [[Special:Preferences|{{SITENAME}} preferences]].', 'login' => 'Log in', 'nav-login-createaccount' => 'Log in / create account', 'loginprompt' => 'You must have cookies enabled to log in to {{SITENAME}}.', -'userlogin' => 'Log in / create account', +'userlogin' => 'Log in', 'logout' => 'Log out', 'userlogout' => 'Log out', 'notloggedin' => 'Not logged in', @@ -1090,6 +1090,7 @@ If someone else made this request, or if you have remembered your password, and you no longer wish to change it, you may ignore this message and continue using your old password.', 'noemail' => 'There is no e-mail address recorded for user "$1".', +'noemailcreate' => 'You need to provide a valid email address', 'passwordsent' => 'A new password has been sent to the e-mail address registered for "$1". Please log in again after you receive it.', 'blocked-mailpassword' => 'Your IP address is blocked from editing, and so is not allowed to use the password recovery function to prevent abuse.', @@ -1926,6 +1927,7 @@ You can also choose to let others contact you through your user or talk page wit 'right-reset-passwords' => "Reset other users' passwords", 'right-override-export-depth' => 'Export pages including linked pages up to a depth of 5', 'right-versiondetail' => 'Show the extended software version information', +'right-root' => 'Perform all actions on the wiki', # User rights log 'rightslog' => 'User rights log', diff --git a/languages/messages/MessagesQqq.php b/languages/messages/MessagesQqq.php index 6ee77d9e61..92148b167d 100644 --- a/languages/messages/MessagesQqq.php +++ b/languages/messages/MessagesQqq.php @@ -1348,6 +1348,9 @@ An alternative wording for translators could be \'Get the wiki to accept a track 'right-versiondetail' => '{{doc-right|versiondetail}} Users having this right receive more detailed information on [[Special:Version]].', +'right-root' => '{{doc-right|root}} +Analogous to the \'root\' permission on Unix systems, allows the user to perform \'\'any\'\' action on the wiki; effectively granting them all other permissions. +', # User rights log 'rightslog' => 'In [[Special:Log]]', diff --git a/maintenance/language/messages.inc b/maintenance/language/messages.inc index 2dcd6df170..7949f90ea8 100644 --- a/maintenance/language/messages.inc +++ b/maintenance/language/messages.inc @@ -1107,6 +1107,7 @@ $wgMessageStructure = array( 'right-reset-passwords', 'right-override-export-depth', 'right-versiondetail', + 'right-root', ), 'rightslog' => array( 'rightslog', -- 2.20.1