* badaccess/badaccesstext to supercede sysop*, developer* messages
authorBrion Vibber <brion@users.mediawiki.org>
Sun, 19 Jun 2005 06:25:53 +0000 (06:25 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Sun, 19 Jun 2005 06:25:53 +0000 (06:25 +0000)
RELEASE-NOTES
includes/OutputPage.php
includes/SpecialPage.php
languages/Language.php

index c4f2db9..1a7530b 100644 (file)
@@ -297,6 +297,7 @@ Various bugfixes, small features, and a few experimental things:
 * (bug 1805) Initialise $wgContLang before $wgUser
 * (bug 2277) Added Friulian language file
 * Less gratuitous munging of content sample in delete summary
+* badaccess/badaccesstext to supercede sysop*, developer* messages
 
 
 === Caveats ===
index 624ab6c..fe8ff5d 100644 (file)
@@ -531,6 +531,29 @@ class OutputPage {
                wfErrorExit();
        }
 
+       /**
+        * Display an error page noting that a given permission bit is required.
+        * This should generally replace the sysopRequired, developerRequired etc.
+        * @param string $permission key required
+        */
+       function permissionRequired( $permission ) {
+               global $wgUser;
+
+               $this->setPageTitle( wfMsg( 'badaccess' ) );
+               $this->setHTMLTitle( wfMsg( 'errorpagetitle' ) );
+               $this->setRobotpolicy( 'noindex,nofollow' );
+               $this->setArticleRelated( false );
+               $this->mBodytext = '';
+
+               $sk = $wgUser->getSkin();
+               $ap = $sk->makeKnownLink( wfMsgForContent( 'administrators' ) );
+               $this->addHTML( wfMsgHtml( 'badaccesstext', $ap, $permission ) );
+               $this->returnToMain();
+       }
+       
+       /**
+        * @deprecated
+        */
        function sysopRequired() {
                global $wgUser;
 
@@ -542,10 +565,13 @@ class OutputPage {
 
                $sk = $wgUser->getSkin();
                $ap = $sk->makeKnownLink( wfMsgForContent( 'administrators' ), '' );
-               $this->addHTML( wfMsg( 'sysoptext', $ap ) );
+               $this->addHTML( wfMsgHtml( 'sysoptext', $ap ) );
                $this->returnToMain();
        }
 
+       /**
+        * @deprecated
+        */
        function developerRequired() {
                global $wgUser;
 
@@ -557,7 +583,7 @@ class OutputPage {
 
                $sk = $wgUser->getSkin();
                $ap = $sk->makeKnownLink( wfMsgForContent( 'administrators' ), '' );
-               $this->addHTML( wfMsg( 'developertext', $ap ) );
+               $this->addHTML( wfMsgHtml( 'developertext', $ap ) );
                $this->returnToMain();
        }
 
index 4da06a8..fca20c0 100644 (file)
@@ -72,7 +72,6 @@ $wgSpecialPages = array(
        'Lockdb'                => new SpecialPage( 'Lockdb', 'siteadmin' ),
        'Unlockdb'              => new SpecialPage( 'Unlockdb', 'siteadmin' ),
        'Userrights'    => new SpecialPage( 'Userrights', 'userrights' ),
-       // 'Groups'             => new SpecialPage( 'Groups' ), # currently borken
 );
 
 global $wgUseValidation ;
@@ -360,11 +359,7 @@ class SpecialPage
         */
        function displayRestrictionError() {
                global $wgOut;
-               if ( $this->mRestriction == "developer" ) {
-                       $wgOut->developerRequired();
-               } else {
-                       $wgOut->sysopRequired();
-               }
+               $wgOut->permissionRequired( $this->mRestriction );
        }
 
        /**
index 3f5da93..c95a22a 100644 (file)
@@ -442,6 +442,7 @@ and the [http://meta.wikipedia.org/wiki/MediaWiki_User%27s_Guide User's Guide] f
 'printsubtitle' => "(From {{SERVER}})",
 'protectedpage' => 'Protected page',
 'administrators' => "Project:Administrators",
+
 'sysoptitle'   => 'Sysop access required',
 'sysoptext'            => "The action you have requested can only be
 performed by users with \"sysop\" status.
@@ -453,6 +454,12 @@ See $1.",
 'bureaucrattitle'      => 'Bureaucrat access required',
 "bureaucrattext"       => "The action you have requested can only be
 performed by sysops with  \"bureaucrat\" status.",
+
+'badaccess'     => 'Permission error',
+'badaccesstext' => 'The action you have requested is limited
+to users with the "$2" permission assigned.
+See $1.',
+
 'nbytes'               => '$1 bytes',
 'ok'                   => 'OK',
 'sitetitle'            => "{{SITENAME}}",