This doesn't accomplish anything, of course, but if you're going to run around changing them, at least make em prettier eh? :)
}
}
}
- $userid = $wgUser->getID();
+ $userid = $wgUser->getId();
if ( $this->isConflict) {
wfDebug( "EditPage::editForm conflict! getting section '$this->section' for time '$this->edittime' (article time '" .
$fname = 'LogPage::saveContent';
$dbw = wfGetDB( DB_MASTER );
- $uid = $wgUser->getID();
+ $uid = $wgUser->getId();
$log_id = $dbw->nextSequenceValue( 'log_log_id_seq' );
$this->timestamp = $now = wfTimestampNow();
'wl_notificationtimestamp',
array( 'wl_namespace' => $this->mTitle->getNamespace(),
'wl_title' => $this->mTitle->getDBkey(),
- 'wl_user' => $wgUser->getID()
+ 'wl_user' => $wgUser->getId()
),
__METHOD__ );
if( $wgUseEnotif || $wgShowUpdatedMarker ) {
// Users
if( $this->mAttribs['rc_user'] ) {
- $editor = ($wgUser->getID() == $this->mAttribs['rc_user']) ?
+ $editor = ($wgUser->getId() == $this->mAttribs['rc_user']) ?
$wgUser : User::newFromID( $this->mAttribs['rc_user'] );
// Anons
} else {
'rc_type' => RC_EDIT,
'rc_minor' => $minor ? 1 : 0,
'rc_cur_id' => $title->getArticleID(),
- 'rc_user' => $user->getID(),
+ 'rc_user' => $user->getId(),
'rc_user_text' => $user->getName(),
'rc_comment' => $comment,
'rc_this_oldid' => $newId,
'rc_type' => RC_NEW,
'rc_minor' => $minor ? 1 : 0,
'rc_cur_id' => $title->getArticleID(),
- 'rc_user' => $user->getID(),
+ 'rc_user' => $user->getId(),
'rc_user_text' => $user->getName(),
'rc_comment' => $comment,
'rc_this_oldid' => $newId,
'rc_type' => $overRedir ? RC_MOVE_OVER_REDIRECT : RC_MOVE,
'rc_minor' => 0,
'rc_cur_id' => $oldTitle->getArticleID(),
- 'rc_user' => $user->getID(),
+ 'rc_user' => $user->getId(),
'rc_user_text' => $user->getName(),
'rc_comment' => $comment,
'rc_this_oldid' => 0,
'rc_type' => RC_LOG,
'rc_minor' => 0,
'rc_cur_id' => $target->getArticleID(),
- 'rc_user' => $user->getID(),
+ 'rc_user' => $user->getId(),
'rc_user_text' => $user->getName(),
'rc_comment' => $logComment,
'rc_this_oldid' => 0,
$this->mPage = isset( $row['page'] ) ? intval( $row['page'] ) : null;
$this->mTextId = isset( $row['text_id'] ) ? intval( $row['text_id'] ) : null;
$this->mUserText = isset( $row['user_text'] ) ? strval( $row['user_text'] ) : $wgUser->getName();
- $this->mUser = isset( $row['user'] ) ? intval( $row['user'] ) : $wgUser->getID();
+ $this->mUser = isset( $row['user'] ) ? intval( $row['user'] ) : $wgUser->getId();
$this->mMinorEdit = isset( $row['minor_edit'] ) ? intval( $row['minor_edit'] ) : 0;
$this->mTimestamp = isset( $row['timestamp'] ) ? strval( $row['timestamp'] ) : wfTimestamp( TS_MW );
$this->mDeleted = isset( $row['deleted'] ) ? intval( $row['deleted'] ) : 0;
# Username block
if ( $wgSysopUserBans ) {
$user = User::newFromName( $this->BlockAddress );
- if( !is_null( $user ) && $user->getID() ) {
+ if( !is_null( $user ) && $user->getId() ) {
# Use canonical name
- $userId = $user->getID();
+ $userId = $user->getId();
$this->BlockAddress = $user->getName();
} else {
return array('nosuchusershort', htmlspecialchars( $user ? $user->getName() : $this->BlockAddress ) );
# Create block
# Note: for a user block, ipb_address is only for display purposes
- $block = new Block( $this->BlockAddress, $userId, $wgUser->getID(),
+ $block = new Block( $this->BlockAddress, $userId, $wgUser->getId(),
$reasonstr, wfTimestampNow(), 0, $expiry, $this->BlockAnonOnly,
$this->BlockCreateAccount, $this->BlockEnableAutoblock, $this->BlockHideName,
$this->BlockEmail);
# Sneak a single revision into place
$user = User::newFromName( $this->getUser() );
if( $user ) {
- $userId = intval( $user->getID() );
+ $userId = intval( $user->getId() );
$userText = $user->getName();
} else {
$userId = 0;
$conds['ipb_auto'] = 0;
} else {
$user = User::newFromName( $this->ip );
- if ( $user && ( $id = $user->getID() ) != 0 ) {
+ if ( $user && ( $id = $user->getId() ) != 0 ) {
$conds['ipb_user'] = $id;
} else {
// Uh...?
$userInformationHtml =
$this->tableRow( wfMsgHtml( 'username' ), htmlspecialchars( $wgUser->getName() ) ) .
- $this->tableRow( wfMsgHtml( 'uid' ), htmlspecialchars( $wgUser->getID() ) ) .
+ $this->tableRow( wfMsgHtml( 'uid' ), htmlspecialchars( $wgUser->getId() ) ) .
$this->tableRow(
wfMsgHtml( 'prefs-edits' ),
- $wgLang->formatNum( User::edits( $wgUser->getID() ) )
+ $wgLang->formatNum( User::edits( $wgUser->getId() ) )
);
if( wfRunHooks( 'PreferencesUserInformationPanel', array( $this, &$userInformationHtml ) ) ) {
$hidem .= $forcebot ? ' AND rc_bot = 1' : '';
if( $hidemyself ) {
- if( $wgUser->getID() ) {
- $hidem .= ' AND rc_user != ' . $wgUser->getID();
+ if( $wgUser->getId() ) {
+ $hidem .= ' AND rc_user != ' . $wgUser->getId();
} else {
$hidem .= ' AND rc_user_text != ' . $dbr->addQuotes( $wgUser->getName() );
}
}
// JOIN on watchlist for users
- $uid = $wgUser->getID();
+ $uid = $wgUser->getId();
if( $uid ) {
$tables = array( 'recentchanges', 'watchlist' );
$join_conds = array( 'watchlist' => array('LEFT JOIN',"wl_user={$uid} AND wl_title=rc_title AND wl_namespace=rc_namespace") );
list($recentchanges, $categorylinks, $pagelinks, $watchlist) =
$dbr->tableNamesN( 'recentchanges', 'categorylinks', 'pagelinks', "watchlist" );
- $uid = $wgUser->getID();
+ $uid = $wgUser->getId();
// The fields we are selecting
$fields = "rc_cur_id,rc_namespace,rc_title,
rc_user,rc_comment,rc_user_text,rc_timestamp,rc_minor,rc_log_type,rc_log_action,rc_params,rc_deleted,
if ( !$row )
return false;
- return $user->getID() == $row->img_user;
+ return $user->getId() == $row->img_user;
}
/**
// Validate input set...
$changeable = $this->changeableGroups();
- if ($wgUser->getID() != 0 && $wgUser->getID() == $user->getID()) {
+ if ($wgUser->getId() != 0 && $wgUser->getId() == $user->getId()) {
$addable = array_merge($changeable['add'], $wgGroupsAddToSelf);
$removable = array_merge($changeable['remove'], $wgGroupsRemoveFromSelf);
} else {
return;
}
- $uid = $wgUser->getID();
+ $uid = $wgUser->getId();
if( ($wgEnotifWatchlist || $wgShowUpdatedMarker) && $wgRequest->getVal( 'reset' ) && $wgRequest->wasPosted() ) {
$wgUser->clearAllNotifications( $uid );
$wgOut->redirect( $specialTitle->getFullUrl() );
, 'pt_create_perm' => $create_perm
, 'pt_timestamp' => Block::encodeExpiry(wfTimestampNow(), $dbw)
, 'pt_expiry' => $encodedExpiry
- , 'pt_user' => $wgUser->getID(), 'pt_reason' => $reason ), __METHOD__ );
+ , 'pt_user' => $wgUser->getId(), 'pt_reason' => $reason ), __METHOD__ );
} else {
$dbw->delete( 'protected_titles', array( 'pt_namespace' => $namespace,
'pt_title' => $title ), __METHOD__ );
/**
* Get the user ID. Returns 0 if the user is anonymous or nonexistent.
*/
- function getID() {
+ function getId() {
if( $this->mId === null and $this->mName !== null
and User::isIP( $this->mName ) ) {
// Special case, we know the user is anonymous
/**
* Set the user and reload all fields according to that ID
*/
- function setID( $v ) {
+ function setId( $v ) {
$this->mId = $v;
$this->clearInstanceCache( 'id' );
}
$title->getText() == $wgUser->getName())
{
$watched = true;
- } elseif ( $this->getID() == $wgUser->getID() ) {
+ } elseif ( $this->getId() == $wgUser->getId() ) {
$watched = $title->userIsWatching();
} else {
$watched = true;
$targetUser = User::newFromName( $title->getText() );
if ( !$targetUser || $targetUser->isAnon() ) {
wfDebug( __METHOD__.": user talk page edited, but user does not exist\n" );
- } elseif ( $targetUser->getID() == $editor->getID() ) {
+ } elseif ( $targetUser->getId() == $editor->getId() ) {
wfDebug( __METHOD__.": user edited their own talk page, no notification sent\n" );
} elseif( $targetUser->getOption( 'enotifusertalkpages' ) ) {
wfDebug( __METHOD__.": sending talk page update notification\n" );
$this->compose( $targetUser );
- $userTalkId = $targetUser->getID();
+ $userTalkId = $targetUser->getId();
} else {
wfDebug( __METHOD__.": talk page owner doesn't want notifications\n" );
}
$wl = new WatchedItem;
$wl->mUser = $user;
$wl->mTitle = $title;
- $wl->id = $user->getID();
+ $wl->id = $user->getId();
# Patch (also) for email notification on page changes T.Gries/M.Arndt 11.09.2004
# TG patch: here we do not consider pages and their talk pages equivalent - why should we ?
# The change results in talk-pages not automatically included in watchlists, when their parent page is included
*/
private function countWatchlist( $user ) {
$dbr = wfGetDB( DB_MASTER );
- $res = $dbr->select( 'watchlist', 'COUNT(*) AS count', array( 'wl_user' => $user->getID() ), __METHOD__ );
+ $res = $dbr->select( 'watchlist', 'COUNT(*) AS count', array( 'wl_user' => $user->getId() ), __METHOD__ );
$row = $dbr->fetchObject( $res );
return ceil( $row->count / 2 ); // Paranoia
}
'watchlist',
'*',
array(
- 'wl_user' => $user->getID(),
+ 'wl_user' => $user->getId(),
),
__METHOD__
);
private function getWatchlistInfo( $user ) {
$titles = array();
$dbr = wfGetDB( DB_MASTER );
- $uid = intval( $user->getID() );
+ $uid = intval( $user->getId() );
list( $watchlist, $page ) = $dbr->tableNamesN( 'watchlist', 'page' );
$sql = "SELECT wl_namespace, wl_title, page_id, page_len, page_is_redirect
FROM {$watchlist} LEFT JOIN {$page} ON ( wl_namespace = page_namespace
*/
private function clearWatchlist( $user ) {
$dbw = wfGetDB( DB_MASTER );
- $dbw->delete( 'watchlist', array( 'wl_user' => $user->getID() ), __METHOD__ );
+ $dbw->delete( 'watchlist', array( 'wl_user' => $user->getId() ), __METHOD__ );
}
/**
$title = Title::newFromText( $title );
if( $title instanceof Title ) {
$rows[] = array(
- 'wl_user' => $user->getID(),
+ 'wl_user' => $user->getId(),
'wl_namespace' => ( $title->getNamespace() & ~1 ),
'wl_title' => $title->getDBkey(),
'wl_notificationtimestamp' => null,
);
$rows[] = array(
- 'wl_user' => $user->getID(),
+ 'wl_user' => $user->getId(),
'wl_namespace' => ( $title->getNamespace() | 1 ),
'wl_title' => $title->getDBkey(),
'wl_notificationtimestamp' => null,
$dbw->delete(
'watchlist',
array(
- 'wl_user' => $user->getID(),
+ 'wl_user' => $user->getId(),
'wl_namespace' => ( $title->getNamespace() & ~1 ),
'wl_title' => $title->getDBkey(),
),
$dbw->delete(
'watchlist',
array(
- 'wl_user' => $user->getID(),
+ 'wl_user' => $user->getId(),
'wl_namespace' => ( $title->getNamespace() | 1 ),
'wl_title' => $title->getDBkey(),
),
global $wgUser;
$result = $this->getResult();
$vals = array();
- $vals['id'] = $wgUser->getID();
+ $vals['id'] = $wgUser->getId();
$vals['name'] = $wgUser->getName();
if($wgUser->isAnon())
'recentchanges'
));
- $userId = $wgUser->getID();
+ $userId = $wgUser->getId();
$this->addWhere(array (
'wl_namespace = rc_namespace',
'wl_title = rc_title',
'img_minor_mime' => $minor,
'img_timestamp' => $timestamp,
'img_description' => $comment,
- 'img_user' => $wgUser->getID(),
+ 'img_user' => $wgUser->getId(),
'img_user_text' => $wgUser->getName(),
'img_metadata' => $this->metadata,
),
'img_minor_mime' => $this->minor_mime,
'img_timestamp' => $timestamp,
'img_description' => $comment,
- 'img_user' => $wgUser->getID(),
+ 'img_user' => $wgUser->getId(),
'img_user_text' => $wgUser->getName(),
'img_metadata' => $this->metadata,
), array( /* WHERE */
$props = $this->repo->getFileProps( $this->getVirtualUrl() );
}
$props['description'] = $comment;
- $props['user'] = $wgUser->getID();
+ $props['user'] = $wgUser->getId();
$props['user_text'] = $wgUser->getName();
$props['timestamp'] = wfTimestamp( TS_MW );
$this->setProps( $props );
'img_minor_mime' => $this->minor_mime,
'img_timestamp' => $timestamp,
'img_description' => $comment,
- 'img_user' => $wgUser->getID(),
+ 'img_user' => $wgUser->getId(),
'img_user_text' => $wgUser->getName(),
'img_metadata' => $this->metadata,
'img_sha1' => $this->sha1
'img_minor_mime' => $this->minor_mime,
'img_timestamp' => $timestamp,
'img_description' => $comment,
- 'img_user' => $wgUser->getID(),
+ 'img_user' => $wgUser->getId(),
'img_user_text' => $wgUser->getName(),
'img_metadata' => $this->metadata,
'img_sha1' => $this->sha1
global $wgUser;
$dbw = $this->file->repo->getMasterDB();
$encTimestamp = $dbw->addQuotes( $dbw->timestamp() );
- $encUserId = $dbw->addQuotes( $wgUser->getID() );
+ $encUserId = $dbw->addQuotes( $wgUser->getId() );
$encReason = $dbw->addQuotes( $this->reason );
$encGroup = $dbw->addQuotes( 'deleted' );
$ext = $this->file->getExtension();
}
$this->user = User::newFromName( $user );
- if ( !$this->user->getID() ) {
+ if ( !$this->user->getId() ) {
die ( "No such user: $user\n" );
}
$this->dbw->update( 'user',
array(
- 'user_password' => wfEncryptPassword( $this->user->getID(), $this->password )
+ 'user_password' => wfEncryptPassword( $this->user->getId(), $this->password )
),
array(
- 'user_id' => $this->user->getID()
+ 'user_id' => $this->user->getId()
),
$fname
);
$fname = $username;
$wgUser = User::newFromName( $username );
// Create the user if necessary
-if ( !$wgUser->getID() ) {
+if ( !$wgUser->getId() ) {
$wgUser->addToDatabase();
}
* @return array
*/
function userConditions( &$user, $idfield, $utfield ) {
- return $user->getId() ? array( $idfield => $user->getID() ) : array( $utfield => $user->getName() );
+ return $user->getId() ? array( $idfield => $user->getId() ) : array( $utfield => $user->getName() );
}
/**