}
public function execute( $par ) {
- # Permission check
- $user = $this->getUser();
- if( !$this->userCanExecute( $user ) ) {
- $this->displayRestrictionError();
- return;
- }
-
- # Can't block when the database is locked
- if( wfReadOnly() ) {
- throw new ReadOnlyError;
- }
+ $this->checkPermissions();
+ $this->checkReadOnly();
# Extract variables from the request. Try not to get into a situation where we
# need to extract *every* variable from the form just for processing here, but
*/
function execute( $par ) {
global $wgAuth;
- if ( wfReadOnly() ) {
- throw new ReadOnlyError;
- }
+ $this->checkReadOnly();
$request = $this->getRequest();
$this->mPassword = $request->getVal( 'wpPassword' );
function execute( $par ) {
global $wgAuth;
- if ( wfReadOnly() ) {
- throw new ReadOnlyError;
- }
+ $this->checkReadOnly();
$request = $this->getRequest();
$this->mUserName = trim( $request->getVal( 'wpName' ) );
function execute( $code ) {
$this->setHeaders();
- if ( wfReadOnly() ) {
- throw new ReadOnlyError;
- }
+ $this->checkReadOnly();
if( empty( $code ) ) {
if( $this->getUser()->isLoggedIn() ) {
return;
}
- if ( wfReadOnly() ) {
- throw new ReadOnlyError;
- }
+ $this->checkPermissions();
$this->outputHeader();
throw new PermissionsError( 'import', $errors );
}
- if ( wfReadOnly() ) {
- throw new ReadOnlyError;
- }
+ $this->checkReadOnly();
$request = $this->getRequest();
if ( $request->wasPosted() && $request->getVal( 'action' ) == 'submit' ) {
}
public function execute( $par ) {
- $user = $this->getUser();
- if( !$this->userCanExecute( $user ) ) {
- $this->displayRestrictionError();
- return;
- }
-
- if ( wfReadOnly() ) {
- throw new ReadOnlyError;
- }
+ $this->checkPermissions();
+ $this->checkReadOnly();
$this->loadRequestParams();
}
public function execute( $par ) {
- # Check for database lock
- if ( wfReadOnly() ) {
- throw new ReadOnlyError;
- }
+ $this->checkReadOnly();
$this->setHeaders();
$this->outputHeader();
$out->showErrorPage( 'prefsnologin', 'prefsnologintext', array( $this->getTitle()->getPrefixedDBkey() ) );
return;
}
- if ( wfReadOnly() ) {
- throw new ReadOnlyError;
- }
+ $this->checkReadOnly();
if ( $par == 'reset' ) {
$this->showResetForm();
}
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();
}
public function execute( $par ){
- # Check permissions
- if( !$this->userCanExecute( $this->getUser() ) ) {
- $this->displayRestrictionError();
- return;
- }
-
- # Check for database lock
- if( wfReadOnly() ) {
- throw new ReadOnlyError;
- }
+ $this->checkPermissions();
+ $this->checkReadOnly();
list( $this->target, $this->type ) = SpecialBlock::getTargetAndType( $par, $this->getRequest() );
$this->block = Block::newFromTarget( $this->target );
}
function execute( $par ) {
+ $this->checkPermissions();
$user = $this->getUser();
- if ( !$this->userCanExecute( $user ) ) {
- $this->displayRestrictionError();
- return;
- }
$this->setHeaders();
$this->outputHeader();
}
# Check whether we actually want to allow changing stuff
- if( wfReadOnly() ) {
- throw new ReadOnlyError;
- }
+ $this->checkReadOnly();
$this->loadRequest();
* @return Boolean: success
*/
public function execute( $subPage ) {
- if ( !$this->userCanExecute( $this->getUser() ) ) {
- $this->displayRestrictionError();
- return false;
- }
+ $this->checkPermissions();
if ( $subPage === null || $subPage === '' ) {
return $this->showUploads();
throw new PermissionsError( null, array( array( $msg ) ) );
}
- if ( wfReadOnly() ) {
- throw new ReadOnlyError;
- }
+ $this->checkReadOnly();
$this->setHeaders();
$this->outputHeader();