Removing the last references to OutputPage::sysopRequired() and OutputPage::developer...
authorRotem Liss <rotem@users.mediawiki.org>
Tue, 8 Aug 2006 13:58:25 +0000 (13:58 +0000)
committerRotem Liss <rotem@users.mediawiki.org>
Tue, 8 Aug 2006 13:58:25 +0000 (13:58 +0000)
includes/Article.php
includes/ImagePage.php
includes/OutputPage.php
includes/SpecialIpblocklist.php
includes/User.php

index a30f17f..368210f 100644 (file)
@@ -887,7 +887,7 @@ class Article {
                }
 
                if ((!$wgUser->isAllowed('delete'))) {
-                       $wgOut->sysopRequired();
+                       $wgOut->permissionRequired( 'delete' );
                        return;
                }
 
index 7e87090..88a0a12 100644 (file)
@@ -442,7 +442,7 @@ END
                # Only sysops can delete images. Previously ordinary users could delete
                # old revisions, but this is no longer the case.
                if ( !$wgUser->isAllowed('delete') ) {
-                       $wgOut->sysopRequired();
+                       $wgOut->permissionRequired( 'delete' );
                        return;
                }
                if ( $wgUser->isBlocked() ) {
@@ -580,7 +580,7 @@ END
                        return;
                }
                if ( ! $this->mTitle->userCanEdit() ) {
-                       $wgOut->sysopRequired();
+                       $wgOut->readOnlyPage( $this->getContent(), true );
                        return;
                }
                if ( $wgUser->isBlocked() ) {
index e677dcb..77f0ca0 100644 (file)
@@ -715,7 +715,6 @@ class OutputPage {
 
        /**
         * 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 ) {
@@ -737,36 +736,14 @@ class OutputPage {
         * @deprecated
         */
        function sysopRequired() {
-               global $wgUser;
-
-               $this->setPageTitle( wfMsg( 'sysoptitle' ) );
-               $this->setHTMLTitle( wfMsg( 'errorpagetitle' ) );
-               $this->setRobotpolicy( 'noindex,nofollow' );
-               $this->setArticleRelated( false );
-               $this->mBodytext = '';
-
-               $sk = $wgUser->getSkin();
-               $ap = $sk->makeKnownLink( wfMsgForContent( 'administrators' ), '' );
-               $this->addHTML( wfMsgHtml( 'sysoptext', $ap ) );
-               $this->returnToMain();
+               throw new MWException( "Call to deprecated OutputPage::sysopRequired() method\n" );
        }
 
        /**
         * @deprecated
         */
        function developerRequired() {
-               global $wgUser;
-
-               $this->setPageTitle( wfMsg( 'developertitle' ) );
-               $this->setHTMLTitle( wfMsg( 'errorpagetitle' ) );
-               $this->setRobotpolicy( 'noindex,nofollow' );
-               $this->setArticleRelated( false );
-               $this->mBodytext = '';
-
-               $sk = $wgUser->getSkin();
-               $ap = $sk->makeKnownLink( wfMsgForContent( 'administrators' ), '' );
-               $this->addHTML( wfMsgHtml( 'developertext', $ap ) );
-               $this->returnToMain();
+               throw new MWException( "Call to deprecated OutputPage::developerRequired() method\n" );
        }
 
        /**
index 6df7f03..437fac7 100644 (file)
@@ -24,7 +24,7 @@ function wfSpecialIpblocklist() {
        } else if ( "submit" == $action && $wgRequest->wasPosted() &&
                $wgUser->matchEditToken( $wgRequest->getVal( 'wpEditToken' ) ) ) {
                if ( ! $wgUser->isAllowed('block') ) {
-                       $wgOut->sysopRequired();
+                       $wgOut->permissionRequired( 'block' );
                        return;
                }
                $ipu->doSubmit();
index 1a6563c..7a77cd3 100644 (file)
@@ -543,7 +543,6 @@ class User {
                }
 
                # Proxy blocking
-               # FIXME ? proxyunbannable is to deprecate the old isSysop()
                if ( !$this->isAllowed('proxyunbannable') && !in_array( $ip, $wgProxyWhitelist ) ) {
 
                        # Local list