$wgOut->setPageTitle( $this->mTitle->getPrefixedText() );
# If we have been passed an &rcid= parameter, we want to give the user a
# chance to mark this new article as patrolled.
- if ( $wgUseRCPatrol && !is_null ( $rcid ) && $rcid != 0 && $wgUser->getID() != 0 &&
+ if ( $wgUseRCPatrol && !is_null ( $rcid ) && $rcid != 0 && $wgUser->isLoggedIn() &&
( $wgUser->isAllowed('patrol') || !$wgOnlySysopsCanPatrol ) )
{
$wgOut->addHTML( wfMsg ( 'markaspatrolledlink',
$won = wfInvertTimestamp( $now );
wfSeedRandom();
$rand = wfRandom();
- $isminor = ( $isminor && $wgUser->getID() ) ? 1 : 0;
+ $isminor = ( $isminor && $wgUser->isLoggedIn() ) ? 1 : 0;
$mungedText = $text;
$flags = Revision::compressRevisionText( $mungedText );
$good = true;
if ( $this->mMinorEdit ) { $me1 = 1; } else { $me1 = 0; }
- if ( $minor && $wgUser->getID() ) { $me2 = 1; } else { $me2 = 0; }
+ if ( $minor && $wgUser->isLoggedIn() ) { $me2 = 1; } else { $me2 = 0; }
if ( $this->isRedirect( $text ) ) {
# Remove all content but redirect
# This could be done by reconstructing the redirect from a title given by
$wgOut->errorpage( 'rcpatroldisabled', 'rcpatroldisabledtext' );
return;
}
- if ( $wgUser->getID() == 0 )
+ if ( $wgUser->isAnon() )
{
$wgOut->loginToUse();
return;
global $wgUser, $wgOut;
- if ( 0 == $wgUser->getID() ) {
+ if ( $wgUser->isAnon() ) {
$wgOut->errorpage( 'watchnologin', 'watchnologintext' );
return;
}
global $wgUser, $wgOut;
- if ( 0 == $wgUser->getID() ) {
+ if ( $wgUser->isAnon() ) {
$wgOut->errorpage( 'watchnologin', 'watchnologintext' );
return;
}
return $wgUseFileCache
and (!$wgShowIPinHeader)
and ($this->getID() != 0)
- and ($wgUser->getId() == 0)
+ and ($wgUser->isAnon())
and (!$wgUser->getNewtalk())
and ($this->mTitle->getNamespace() != NS_SPECIAL )
and (empty( $action ) || $action == 'view')
$curIdEq = 'curid=' . $rc_cur_id;
# Should patrol-related stuff be shown?
- $unpatrolled = $wgUseRCPatrol && $wgUser->getID() != 0 &&
+ $unpatrolled = $wgUseRCPatrol && $wgUser->isLoggedIn() &&
( !$wgOnlySysopsCanPatrol || $wgUser->isAllowed('patrol') ) && $rc_patrolled == 0;
# Make date header if necessary
}
# Should patrol-related stuff be shown?
- if ( $wgUseRCPatrol && $wgUser->getID() != 0 &&
+ if ( $wgUseRCPatrol && $wgUser->isLoggedIn() &&
( !$wgOnlySysopsCanPatrol || $wgUser->isAllowed('patrol') )) {
$rc->unpatrolled = !$rc_patrolled;
} else {
} else {
$rollback = '';
}
- if ( $wgUseRCPatrol && $this->mRcidMarkPatrolled != 0 && $wgUser->getID() != 0 &&
+ if ( $wgUseRCPatrol && $this->mRcidMarkPatrolled != 0 && $wgUser->isLoggedIn() &&
( $wgUser->isAllowed('rollback') || !$wgOnlySysopsCanPatrol ) )
{
$patrol = ' [' . $sk->makeKnownLinkObj( $wgTitle, wfMsg( 'markaspatrolleddiff' ),
$this->blockedIPpage();
return;
}
- if ( !$wgUser->getID() && $wgWhitelistEdit ) {
+ if ( $wgUser->isAnon() && $wgWhitelistEdit ) {
$this->userNotLoggedInPage();
return;
}
*/
function tokenOk( &$request ) {
global $wgUser;
- if( $wgUser->getId() == 0 ) {
+ if( $wgUser->isAnon() ) {
# Anonymous users may not have a session
# open. Don't tokenize.
return true;
$this->blockedIPpage();
return;
}
- if ( !$wgUser->getID() && $wgWhitelistEdit ) {
+ if ( $wgUser->isAnon() && $wgWhitelistEdit ) {
$this->userNotLoggedInPage();
return;
}
$minoredithtml = '';
- if ( 0 != $wgUser->getID() || $wgAllowAnonymousMinor ) {
+ if ( $wgUser->isLoggedIn() || $wgAllowAnonymousMinor ) {
$minoredithtml =
"<input tabindex='3' type='checkbox' value='1' name='wpMinoredit'".($this->minoredit?" checked='checked'":"").
" accesskey='".wfMsg('accesskey-minoredit')."' id='wpMinoredit' />".
$watchhtml = '';
- if ( 0 != $wgUser->getID() ) {
+ if ( $wgUser->isLoggedIn() ) {
$watchhtml = "<input tabindex='4' type='checkbox' name='wpWatchthis'".($this->watchthis?" checked='checked'":"").
" accesskey='".wfMsg('accesskey-watch')."' id='wpWatchthis' />".
"<label for='wpWatchthis' title='".wfMsg('tooltip-watch')."'>{$watchthis}</label>";
<input type='hidden' value=\"" . htmlspecialchars( $this->section ) . "\" name=\"wpSection\" />
<input type='hidden' value=\"{$this->edittime}\" name=\"wpEdittime\" />\n" );
- if ( 0 != $wgUser->getID() ) {
+ if ( $wgUser->isLoggedIn() ) {
/**
* To make it harder for someone to slip a user a page
* which submits an edit form to the wiki without their
* @todo document
*/
function userNotLoggedInPage() {
- global $wgOut, $wgUser;
+ global $wgOut;
$wgOut->setPageTitle( wfMsg( 'whitelistedittitle' ) );
$wgOut->setRobotpolicy( 'noindex,nofollow' );
$forward .= ' from ' . $_SERVER['HTTP_FROM'];
if( $forward )
$forward = "\t(proxied via {$_SERVER['REMOTE_ADDR']}{$forward})";
- if($wgUser->getId() == 0)
+ if( $wgUser->isAnon() )
$forward .= ' anon';
$log = sprintf( "%s\t%04.3f\t%s\n",
gmdate( 'YmdHis' ), $elapsed,
$wgOut->readOnlyPage();
return;
}
- if( $wgUser->getId() == 0 ) {
+ if( $wgUser->isAnon() ) {
$wgOut->errorpage( 'uploadnologin', 'uploadnologintext' );
return;
}
return;
}
- if ( 0 == $wgUser->getID() ||
+ if ( $wgUser->isAnon() ||
( !$wgUser->isValidEmailAddr( $wgUser->getEmail() ) ) ) {
$wgOut->errorpage( "mailnologin", "mailnologintext" );
return;
function wfSpecialMakesysop() {
global $wgUser, $wgOut, $wgRequest;
- if ( 0 == $wgUser->getID() or $wgUser->isBlocked() ) {
+ if ( $wgUser->isAnon() or $wgUser->isBlocked() ) {
$wgOut->errorpage( "movenologin", "movenologintext" );
return;
}
function getSQL() {
global $wgUser, $wgOnlySysopsCanPatrol, $wgUseRCPatrol;
- $usepatrol = ( $wgUseRCPatrol && $wgUser->getID() != 0 &&
+ $usepatrol = ( $wgUseRCPatrol && $wgUser->isLoggedIn() &&
( $wgUser->isAllowed('patrol') || !$wgOnlySysopsCanPatrol ) ) ? 1 : 0;
$dbr =& wfGetDB( DB_SLAVE );
extract( $dbr->tableNames( 'recentchanges', 'page', 'text' ) );
# Since there is no diff link, we need to give users a way to
# mark the article as patrolled if it isn't already
if ( $wgUseRCPatrol && !is_null ( $result->usepatrol ) && $result->usepatrol &&
- $result->patrolled == 0 && $wgUser->getID() != 0 &&
+ $result->patrolled == 0 && $wgUser->isLoggedIn() &&
( $wgUser->isAllowed('patrol') || !$wgOnlySysopsCanPatrol ) )
$link = $skin->makeKnownLink( $result->title, '', "rcid={$result->rcid}" );
else
function execute() {
global $wgUser, $wgOut, $wgUseDynamicDates;
- if ( 0 == $wgUser->getID() ) {
+ if ( $wgUser->isAnon() ) {
$wgOut->errorpage( 'prefsnologin', 'prefsnologintext' );
return;
}
global $wgEmailAuthentication;
if ( '' == $this->mName ) {
- if ( 0 != $wgUser->getID() ) {
+ if ( $wgUser->isLoggedIn() ) {
$this->mName = $wgUser->getName();
} else {
$this->mName = @$_COOKIE[$wgDBname.'UserName'];
$template->set( 'action', $titleObj->getLocalUrl( $q ) );
$template->set( 'error', $err );
$template->set( 'create', $wgUser->isAllowedToCreateAccount() );
- $template->set( 'createemail', $wgEnableEmail && ($wgUser->getID() != 0) );
+ $template->set( 'createemail', $wgEnableEmail && $wgUser->isLoggedIn() );
$template->set( 'userealname', $wgAllowRealName );
$template->set( 'useemail', $wgEnableEmail );
$template->set( 'useemailauthent', $wgEmailAuthentication );
$specialTitle = Title::makeTitle( NS_SPECIAL, 'Watchlist' );
- $uid = $wgUser->getID();
- if( $uid == 0 ) {
+ if( $wgUser->isAnon() ) {
$wgOut->addWikiText( wfMsg( 'nowatchlist' ) );
return;
}
"</div>\n\n" );
}
+ $uid = $wgUser->getID();
if( $wgRequest->getVal( 'reset' ) == 'all' ) {
$wgUser->clearAllNotifications( $uid );
}
}
// get language variant preference from logged in users
- if($wgUser->getID()!=0) {
+ if( $wgUser->isLoggedIn() ) {
$this->mZhLanguageCode = $wgUser->getOption('variant');
}
}
function doBeforeContent() {
- global $wgUser, $wgOut, $wgTitle, $wgSiteNotice;
+ global $wgOut, $wgTitle, $wgSiteNotice;
$s = "";
$qb = $this->qbSetting();
function doAfterContent()
{
- global $wgUser, $wgOut;
+ global $wgOut;
$s = "\n</div><br clear='all' />\n";
if ( 0 != $qb ) { $s .= $this->quickBar(); }
return $s;
}
- function doGetUserStyles()
- {
- global $wgUser, $wgOut, $wgStyleSheetPath;
+
+ function doGetUserStyles() {
+ global $wgOut, $wgStyleSheetPath;
$s = parent::doGetUserStyles();
$qb = $this->qbSetting();
}
return $s;
}
- function sysLinks()
- {
+
+ function sysLinks() {
global $wgUser, $wgContLang, $wgTitle;
$li = $wgContLang->specialPage("Userlogin");
$lo = $wgContLang->specialPage("Userlogout");
. " | " .
$this->specialLink( "specialpages" ) . " | ";
- if ( $wgUser->getID() )
- {
+ if ( $wgUser->isLoggedIn() ) {
$s .= $this->makeKnownLink( $lo, wfMsg( "logout" ), $q );
- }
- else
- {
+ } else {
$s .= $this->makeKnownLink( $li, wfMsg( "login" ), $q );
}
$s .= $sep . $this->makeKnownLink( wfMsgForContent( "edithelppage" ), wfMsg( "edithelp" ) );
- if ( 0 != $wgUser->getID() ) {
+ if( $wgUser->isLoggedIn() ) {
$s .= $sep . $this->moveThisPage();
}
if ( $wgUser->isAllowed('delete') ) {
$s .= $this->talkLink()
. $sep . $this->commentLink()
. $sep . $this->printableLink();
- if ( 0 != $wgUser->getID() ) {
+ if ( $wgUser->isLoggedIn() ) {
$s .= $sep . $this->watchThisPage();
}
}
$s .= $this->menuHead( "qbmyoptions" );
- if ( 0 != $wgUser->getID() ) {
+ if ( $wgUser->isLoggedIn() ) {
$name = $wgUser->getName();
$tl = $this->makeKnownLinkObj( $wgUser->getTalkPage(),
wfMsg( 'mytalk' ) );
$s .= $sep . $this->editThisPage()
. $sep . $this->historyLink();
}
- if ( 0 == $wgUser->getID() ) {
+ if ( $wgUser->isAnon() ) {
$s .= $sep . $this->specialLink( "userlogin" );
} else {
$s .= $sep . $this->specialLink( "userlogout" );
}
function doAfterContent() {
- global $wgUser, $wgOut;
-
$s = "\n</div><br clear='all' />\n";
$s .= "\n<div id='footer'><hr />";