* @return bool Whether the condition is true for the user
*/
private static function checkCondition( $cond, User $user ) {
+ global $wgEmailAuthentication;
if ( count( $cond ) < 1 ) {
return false;
}
switch( $cond[0] ) {
case APCOND_EMAILCONFIRMED:
if ( User::isValidEmailAddr( $user->getEmail() ) ) {
- global $wgEmailAuthentication;
if ( $wgEmailAuthentication ) {
return (bool)$user->getEmailAuthenticationTimestamp();
} else {
* @returns mixed
*/
protected function getWatchlistValue ( $watchlist, $titleObj, $userOption = null ) {
+ global $wgUser;
switch ( $watchlist ) {
case 'watch':
return true;
return false;
case 'preferences':
- global $wgUser;
# If the user is already watching, don't bother checking
if ( $titleObj->userIsWatching() ) {
return null;
$retval = $ep->internalAttemptSave( $result, $wgUser->isAllowed( 'bot' ) && $params['bot'] );
$wgRequest = $oldRequest;
+ global $wgMaxArticleSize;
+
switch( $retval ) {
case EditPage::AS_HOOK_ERROR:
case EditPage::AS_HOOK_ERROR_EXPECTED:
case EditPage::AS_MAX_ARTICLE_SIZE_EXCEEDED:
case EditPage::AS_CONTENT_TOO_BIG:
- global $wgMaxArticleSize;
$this->dieUsageMsg( array( 'contenttoobig', $wgMaxArticleSize ) );
case EditPage::AS_READ_ONLY_PAGE_ANON:
$loginForm = new LoginForm( $req );
- global $wgCookiePrefix;
+ global $wgCookiePrefix, $wgUser, $wgPasswordAttemptThrottle;;
switch ( $authRes = $loginForm->authenticateUserData() ) {
case LoginForm::SUCCESS:
- global $wgUser;
-
$wgUser->setOption( 'rememberpassword', 1 );
$wgUser->setCookies();
break;
case LoginForm::THROTTLED:
- global $wgPasswordAttemptThrottle;
$result['result'] = 'Throttled';
$result['wait'] = intval( $wgPasswordAttemptThrottle['seconds'] );
break;
* Performs file verification, dies on error.
*/
protected function verifyUpload( ) {
+ global $wgFileExtensions;
+
$verification = $this->mUpload->verifyUpload( );
if ( $verification['status'] === UploadBase::OK ) {
return;
$this->dieUsage( 'The file is missing an extension', 'filetype-missing' );
break;
case UploadBase::FILETYPE_BADTYPE:
- global $wgFileExtensions;
$this->dieUsage( 'This type of file is banned', 'filetype-banned',
0, array(
'filetype' => $verification['finalExt'],
}
function processOption( $opt, $val, $param ) {
+ global $IP;
$url = $this->processFileOpt( $val, $param );
switch( $opt ) {
case 'prefetch':
- global $IP;
require_once "$IP/maintenance/backupPrefetch.inc";
$this->prefetch = new BaseDump( $url );
break;