}
if ( !$wgUser->isAllowed( 'block' ) ) {
- $this->dieUsageMsg( array( 'cantblock' ) );
+ $this->dieUsageMsg( 'cantblock' );
}
# bug 15810: blocked admins should have limited access here
if ( $wgUser->isBlocked() ) {
}
}
if ( $params['hidename'] && !$wgUser->isAllowed( 'hideuser' ) ) {
- $this->dieUsageMsg( array( 'canthide' ) );
+ $this->dieUsageMsg( 'canthide' );
}
if ( $params['noemail'] && !SpecialBlock::canBlockEmail( $wgUser ) ) {
- $this->dieUsageMsg( array( 'cantblock-email' ) );
+ $this->dieUsageMsg( 'cantblock-email' );
}
$data = array(
}
}
if ( !$titleObj->exists() ) {
- $this->dieUsageMsg( array( 'notanarticle' ) );
+ $this->dieUsageMsg( 'notanarticle' );
}
$reason = ( isset( $params['reason'] ) ? $params['reason'] : null );
is_null( $params['prependtext'] ) &&
$params['undo'] == 0 )
{
- $this->dieUsageMsg( array( 'missingtext' ) );
+ $this->dieUsageMsg( 'missingtext' );
}
$titleObj = Title::newFromText( $params['title'] );
$wgTitle = $titleObj;
if ( $params['createonly'] && $titleObj->exists() ) {
- $this->dieUsageMsg( array( 'createonly-exists' ) );
+ $this->dieUsageMsg( 'createonly-exists' );
}
if ( $params['nocreate'] && !$titleObj->exists() ) {
- $this->dieUsageMsg( array( 'nocreate-missing' ) );
+ $this->dieUsageMsg( 'nocreate-missing' );
}
// Now let's check whether we're even allowed to do this
$newtext = $articleObj->getUndoText( $undoRev, $undoafterRev );
if ( $newtext === false ) {
- $this->dieUsageMsg( array( 'undo-failure' ) );
+ $this->dieUsageMsg( 'undo-failure' );
}
$params['text'] = $newtext;
// If no summary was given and we only undid one rev,
// See if the MD5 hash checks out
if ( !is_null( $params['md5'] ) && md5( $toMD5 ) !== $params['md5'] ) {
- $this->dieUsageMsg( array( 'hashcheckfailed' ) );
+ $this->dieUsageMsg( 'hashcheckfailed' );
}
$ep = new EditPage( $articleObj );
$this->getResult()->addValue( null, $this->getModuleName(), $r );
return;
} else {
- $this->dieUsageMsg( array( 'hookaborted' ) );
+ $this->dieUsageMsg( 'hookaborted' );
}
}
switch( $retval ) {
case EditPage::AS_HOOK_ERROR:
case EditPage::AS_HOOK_ERROR_EXPECTED:
- $this->dieUsageMsg( array( 'hookaborted' ) );
+ $this->dieUsageMsg( 'hookaborted' );
case EditPage::AS_IMAGE_REDIRECT_ANON:
- $this->dieUsageMsg( array( 'noimageredirect-anon' ) );
+ $this->dieUsageMsg( 'noimageredirect-anon' );
case EditPage::AS_IMAGE_REDIRECT_LOGGED:
- $this->dieUsageMsg( array( 'noimageredirect-logged' ) );
+ $this->dieUsageMsg( 'noimageredirect-logged' );
case EditPage::AS_SPAM_ERROR:
$this->dieUsageMsg( array( 'spamdetected', $result['spam'] ) );
case EditPage::AS_FILTERING:
- $this->dieUsageMsg( array( 'filtered' ) );
+ $this->dieUsageMsg( 'filtered' );
case EditPage::AS_BLOCKED_PAGE_FOR_USER:
- $this->dieUsageMsg( array( 'blockedtext' ) );
+ $this->dieUsageMsg( 'blockedtext' );
case EditPage::AS_MAX_ARTICLE_SIZE_EXCEEDED:
case EditPage::AS_CONTENT_TOO_BIG:
$this->dieUsageMsg( array( 'contenttoobig', $wgMaxArticleSize ) );
case EditPage::AS_READ_ONLY_PAGE_ANON:
- $this->dieUsageMsg( array( 'noedit-anon' ) );
+ $this->dieUsageMsg( 'noedit-anon' );
case EditPage::AS_READ_ONLY_PAGE_LOGGED:
- $this->dieUsageMsg( array( 'noedit' ) );
+ $this->dieUsageMsg( 'noedit' );
case EditPage::AS_READ_ONLY_PAGE:
$this->dieReadOnly();
case EditPage::AS_RATE_LIMITED:
- $this->dieUsageMsg( array( 'actionthrottledtext' ) );
+ $this->dieUsageMsg( 'actionthrottledtext' );
case EditPage::AS_ARTICLE_WAS_DELETED:
- $this->dieUsageMsg( array( 'wasdeleted' ) );
+ $this->dieUsageMsg( 'wasdeleted' );
case EditPage::AS_NO_CREATE_PERMISSION:
- $this->dieUsageMsg( array( 'nocreate-loggedin' ) );
+ $this->dieUsageMsg( 'nocreate-loggedin' );
case EditPage::AS_BLANK_ARTICLE:
- $this->dieUsageMsg( array( 'blankpage' ) );
+ $this->dieUsageMsg( 'blankpage' );
case EditPage::AS_CONFLICT_DETECTED:
- $this->dieUsageMsg( array( 'editconflict' ) );
+ $this->dieUsageMsg( 'editconflict' );
// case EditPage::AS_SUMMARY_NEEDED: Can't happen since we set wpIgnoreBlankSummary
case EditPage::AS_TEXTBOX_EMPTY:
- $this->dieUsageMsg( array( 'emptynewsection' ) );
+ $this->dieUsageMsg( 'emptynewsection' );
case EditPage::AS_SUCCESS_NEW_ARTICLE:
$r['new'] = '';
break;
case EditPage::AS_SUMMARY_NEEDED:
- $this->dieUsageMsg( array( 'summaryrequired' ) );
+ $this->dieUsageMsg( 'summaryrequired' );
case EditPage::AS_END:
// This usually means some kind of race condition
// Check if the file really exists
$this->file = wfLocalFile( $title );
if ( !$this->file->exists() ) {
- $this->dieUsageMsg( array( 'notanarticle' ) );
+ $this->dieUsageMsg( 'notanarticle' );
}
// Check if the archivename is valid for this file
$this->archiveName = $this->params['archivename'];
$oldFile = RepoGroup::singleton()->getLocalRepo()->newFromArchiveName( $title, $this->archiveName );
if ( !$oldFile->exists() ) {
- $this->dieUsageMsg( array( 'filerevert-badversion' ) );
+ $this->dieUsageMsg( 'filerevert-badversion' );
}
}
$isUpload = false;
if ( isset( $params['interwikisource'] ) ) {
if ( !$wgUser->isAllowed( 'import' ) ) {
- $this->dieUsageMsg( array( 'cantimport' ) );
+ $this->dieUsageMsg( 'cantimport' );
}
if ( !isset( $params['interwikipage'] ) ) {
$this->dieUsageMsg( array( 'missingparam', 'interwikipage' ) );
} else {
$isUpload = true;
if ( !$wgUser->isAllowed( 'importupload' ) ) {
- $this->dieUsageMsg( array( 'cantimport-upload' ) );
+ $this->dieUsageMsg( 'cantimport-upload' );
}
$source = ImportStreamSource::newFromUpload( 'xml' );
}
} else {
global $wgUser;
if ( !$wgUser->matchEditToken( $moduleParams['token'], $salt, $this->getMain()->getRequest() ) ) {
- $this->dieUsageMsg( array( 'sessionfailure' ) );
+ $this->dieUsageMsg( 'sessionfailure' );
}
}
}
if ( $module->isReadMode() && !in_array( 'read', User::getGroupPermissions( array( '*' ) ), true ) &&
!$wgUser->isAllowed( 'read' ) )
{
- $this->dieUsageMsg( array( 'readrequired' ) );
+ $this->dieUsageMsg( 'readrequired' );
}
if ( $module->isWriteMode() ) {
if ( !$this->mEnableWrite ) {
- $this->dieUsageMsg( array( 'writedisabled' ) );
+ $this->dieUsageMsg( 'writedisabled' );
}
if ( !$wgUser->isAllowed( 'writeapi' ) ) {
- $this->dieUsageMsg( array( 'writerequired' ) );
+ $this->dieUsageMsg( 'writerequired' );
}
if ( wfReadOnly() ) {
$this->dieReadOnly();
}
if ( !$fromTitle->exists() ) {
- $this->dieUsageMsg( array( 'notanarticle' ) );
+ $this->dieUsageMsg( 'notanarticle' );
}
$fromTalk = $fromTitle->getTalkPage();
&& wfFindFile( $toTitle ) )
{
if ( !$params['ignorewarnings'] && $wgUser->isAllowed( 'reupload-shared' ) ) {
- $this->dieUsageMsg( array( 'sharedfile-exists' ) );
+ $this->dieUsageMsg( 'sharedfile-exists' );
} elseif ( !$wgUser->isAllowed( 'reupload-shared' ) ) {
- $this->dieUsageMsg( array( 'cantoverwrite-sharedfile' ) );
+ $this->dieUsageMsg( 'cantoverwrite-sharedfile' );
}
}
$protections[$p[0]] = ( $p[1] == 'all' ? '' : $p[1] );
if ( $titleObj->exists() && $p[0] == 'create' ) {
- $this->dieUsageMsg( array( 'create-titleexists' ) );
+ $this->dieUsageMsg( 'create-titleexists' );
}
if ( !$titleObj->exists() && $p[0] != 'create' ) {
- $this->dieUsageMsg( array( 'missingtitle-createonly' ) );
+ $this->dieUsageMsg( 'missingtitle-createonly' );
}
if ( !in_array( $p[0], $restrictionTypes ) && $p[0] != 'create' ) {
}
if ( isset( $show['hidden'] ) && isset( $show['!hidden'] ) ) {
- $this->dieUsageMsg( array( 'show' ) );
+ $this->dieUsageMsg( 'show' );
}
if ( isset( $show['hidden'] ) || isset( $show['!hidden'] ) || isset( $prop['hidden'] ) )
{
$qp = new $this->qpMap[$params['page']]();
if ( !$qp->userCanExecute( $wgUser ) ) {
- $this->dieUsageMsg( array( 'specialpage-cantexecute' ) );
+ $this->dieUsageMsg( 'specialpage-cantexecute' );
}
$r = array( 'name' => $params['page'] );
|| ( isset( $show['redirect'] ) && isset( $show['!redirect'] ) )
|| ( isset( $show['patrolled'] ) && isset( $show['!patrolled'] ) )
) {
- $this->dieUsageMsg( array( 'show' ) );
+ $this->dieUsageMsg( 'show' );
}
// Check permissions
$show = array_flip( $show );
if ( ( isset( $show['minor'] ) && isset( $show['!minor'] ) )
|| ( isset( $show['patrolled'] ) && isset( $show['!patrolled'] ) ) ) {
- $this->dieUsageMsg( array( 'show' ) );
+ $this->dieUsageMsg( 'show' );
}
$this->addWhereIf( 'rev_minor_edit = 0', isset( $show['!minor'] ) );
|| ( isset ( $show['patrolled'] ) && isset ( $show['!patrolled'] ) )
)
{
- $this->dieUsageMsg( array( 'show' ) );
+ $this->dieUsageMsg( 'show' );
}
// Check permissions.
$prop = array_flip( (array)$params['prop'] );
$show = array_flip( (array)$params['show'] );
if ( isset( $show['changed'] ) && isset( $show['!changed'] ) ) {
- $this->dieUsageMsg( array( 'show' ) );
+ $this->dieUsageMsg( 'show' );
}
$this->addTables( 'watchlist' );
public function getVersion() {
return __CLASS__ . ': $Id$';
}
-}
\ No newline at end of file
+}
$this->dieUsageMsg( array( 'invalidtitle', $params['title'] ) );
}
if ( !$this->mTitleObj->exists() ) {
- $this->dieUsageMsg( array( 'notanarticle' ) );
+ $this->dieUsageMsg( 'notanarticle' );
}
return $this->mTitleObj;
}
if ( is_null( $params['id'] ) && is_null( $params['user'] ) ) {
- $this->dieUsageMsg( array( 'unblock-notarget' ) );
+ $this->dieUsageMsg( 'unblock-notarget' );
}
if ( !is_null( $params['id'] ) && !is_null( $params['user'] ) ) {
- $this->dieUsageMsg( array( 'unblock-idanduser' ) );
+ $this->dieUsageMsg( 'unblock-idanduser' );
}
if ( !$wgUser->isAllowed( 'block' ) ) {
- $this->dieUsageMsg( array( 'cantunblock' ) );
+ $this->dieUsageMsg( 'cantunblock' );
}
# bug 15810: blocked admins should have limited access here
if ( $wgUser->isBlocked() ) {
$status = SpecialBlock::checkUnblockSelf( $params['user'] );
if ( $status !== true ) {
- $this->dieUsageMsg( array( $status ) );
+ $this->dieUsageMsg( $status );
}
}
$params = $this->extractRequestParams();
if ( !$wgUser->isAllowed( 'undelete' ) ) {
- $this->dieUsageMsg( array( 'permdenied-undelete' ) );
+ $this->dieUsageMsg( 'permdenied-undelete' );
}
if ( $wgUser->isBlocked() ) {
- $this->dieUsageMsg( array( 'blockedtext' ) );
+ $this->dieUsageMsg( 'blockedtext' );
}
$titleObj = Title::newFromText( $params['title'] );
$pa = new PageArchive( $titleObj );
$retval = $pa->undelete( ( isset( $params['timestamps'] ) ? $params['timestamps'] : array() ), $params['reason'] );
if ( !is_array( $retval ) ) {
- $this->dieUsageMsg( array( 'cannotundelete' ) );
+ $this->dieUsageMsg( 'cannotundelete' );
}
if ( $retval[1] ) {
// Check whether upload is enabled
if ( !UploadBase::isEnabled() ) {
- $this->dieUsageMsg( array( 'uploaddisabled' ) );
+ $this->dieUsageMsg( 'uploaddisabled' );
}
// Parameter handling
// Upload stashed in a previous request
$sessionData = $request->getSessionData( UploadBase::getSessionKeyName() );
if ( !UploadFromStash::isValidSessionKey( $this->mParams['sessionkey'], $sessionData ) ) {
- $this->dieUsageMsg( array( 'invalid-session-key' ) );
+ $this->dieUsageMsg( 'invalid-session-key' );
}
$this->mUpload = new UploadFromStash();
} elseif ( isset( $this->mParams['url'] ) ) {
// Make sure upload by URL is enabled:
if ( !UploadFromUrl::isEnabled() ) {
- $this->dieUsageMsg( array( 'copyuploaddisabled' ) );
+ $this->dieUsageMsg( 'copyuploaddisabled' );
}
$async = false;
if ( !$user->isLoggedIn() ) {
$this->dieUsageMsg( array( 'mustbeloggedin', 'upload' ) );
} else {
- $this->dieUsageMsg( array( 'badaccess-groups' ) );
+ $this->dieUsageMsg( 'badaccess-groups' );
}
}
}
$success = Action::factory( 'watch', $article )->execute();
}
if ( !$success ) {
- $this->dieUsageMsg( array( 'hookaborted' ) );
+ $this->dieUsageMsg( 'hookaborted' );
}
$this->getResult()->addValue( null, $this->getModuleName(), $res );
}