Use protocol-relative URL for link to MediaWiki.org (as with the footer logo on each...
[lhc/web/wiklou.git] / includes / specials / SpecialRevisiondelete.php
index 28aa358..dce79d3 100644 (file)
@@ -111,15 +111,12 @@ class SpecialRevisionDelete extends UnlistedSpecialPage {
        }
 
        public function execute( $par ) {
+               $this->checkPermissions();
+               $this->checkReadOnly();
+
                $output = $this->getOutput();
                $user = $this->getUser();
 
-               if( !$user->isAllowed( 'deletedhistory' ) ) {
-                       throw new PermissionsError( 'deletedhistory' );
-               } elseif( wfReadOnly() ) {
-                       throw new ReadOnlyError;
-               }
-
                $this->mIsAllowed = $user->isAllowed('deleterevision'); // for changes
                $this->setHeaders();
                $this->outputHeader();
@@ -248,7 +245,7 @@ class SpecialRevisionDelete extends UnlistedSpecialPage {
                                }
                        }
                        # Logs themselves don't have histories or archived revisions
-                       $this->getOutput()->addSubtitle( $this->getLang()->pipeList( $links ) );
+                       $this->getOutput()->addSubtitle( $this->getLanguage()->pipeList( $links ) );
                }
        }
 
@@ -289,15 +286,15 @@ class SpecialRevisionDelete extends UnlistedSpecialPage {
                if ( !$this->getUser()->matchEditToken( $this->token, $archiveName ) ) {
                        $this->getOutput()->addWikiMsg( 'revdelete-show-file-confirm',
                                $this->targetObj->getText(),
-                               $this->getLang()->date( $oimage->getTimestamp() ),
-                               $this->getLang()->time( $oimage->getTimestamp() ) );
+                               $this->getLanguage()->date( $oimage->getTimestamp() ),
+                               $this->getLanguage()->time( $oimage->getTimestamp() ) );
                        $this->getOutput()->addHTML(
                                Xml::openElement( 'form', array(
                                        'method' => 'POST',
                                        'action' => $this->getTitle()->getLocalUrl(
                                                'target=' . urlencode( $oimage->getName() ) .
                                                '&file=' . urlencode( $archiveName ) .
-                                               '&token=' . urlencode( $this->getUser()->editToken( $archiveName ) ) )
+                                               '&token=' . urlencode( $this->getUser()->getEditToken( $archiveName ) ) )
                                        )
                                ) .
                                Xml::submitButton( wfMsg( 'revdelete-show-file-submit' ) ) .
@@ -338,7 +335,7 @@ class SpecialRevisionDelete extends UnlistedSpecialPage {
                $UserAllowed = true;
 
                if ( $this->typeName == 'logging' ) {
-                       $this->getOutput()->addWikiMsg( 'logdelete-selected', $this->getLang()->formatNum( count($this->ids) ) );
+                       $this->getOutput()->addWikiMsg( 'logdelete-selected', $this->getLanguage()->formatNum( count($this->ids) ) );
                } else {
                        $this->getOutput()->addWikiMsg( 'revdelete-selected',
                                $this->targetObj->getPrefixedText(), count( $this->ids ) );
@@ -407,7 +404,7 @@ class SpecialRevisionDelete extends UnlistedSpecialPage {
                                        '</td>' .
                                "</tr>\n" .
                                Xml::closeElement( 'table' ) .
-                               Html::hidden( 'wpEditToken', $this->getUser()->editToken() ) .
+                               Html::hidden( 'wpEditToken', $this->getUser()->getEditToken() ) .
                                Html::hidden( 'target', $this->targetObj->getPrefixedText() ) .
                                Html::hidden( 'type', $this->typeName ) .
                                Html::hidden( 'ids', implode( ',', $this->ids ) ) .