From ae54dbbb3d74461d3bb27f4393b012d74c2a08c6 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Thu, 22 May 2008 14:57:07 +0000 Subject: [PATCH] *The function is User::getID() not getId() --- includes/Revision.php | 2 +- includes/SpecialImport.php | 2 +- includes/SpecialPreferences.php | 2 +- includes/SpecialUserrights.php | 2 +- includes/SpecialWatchlist.php | 2 +- includes/Title.php | 2 +- includes/UserMailer.php | 4 ++-- includes/WatchedItem.php | 2 +- includes/WatchlistEditor.php | 16 ++++++++-------- includes/api/ApiQueryUserInfo.php | 2 +- includes/filerepo/LocalFile.php | 2 +- 11 files changed, 19 insertions(+), 19 deletions(-) diff --git a/includes/Revision.php b/includes/Revision.php index 6f43a7daf4..5b14e48a3d 100644 --- a/includes/Revision.php +++ b/includes/Revision.php @@ -332,7 +332,7 @@ class Revision { $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; diff --git a/includes/SpecialImport.php b/includes/SpecialImport.php index 862b3e1861..5f5c63a76d 100644 --- a/includes/SpecialImport.php +++ b/includes/SpecialImport.php @@ -351,7 +351,7 @@ class WikiRevision { # 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; diff --git a/includes/SpecialPreferences.php b/includes/SpecialPreferences.php index be6d7fb69d..0d7e02a840 100644 --- a/includes/SpecialPreferences.php +++ b/includes/SpecialPreferences.php @@ -608,7 +608,7 @@ class PreferencesForm { $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 ) ) ) { diff --git a/includes/SpecialUserrights.php b/includes/SpecialUserrights.php index 1873b48726..082ec6925f 100644 --- a/includes/SpecialUserrights.php +++ b/includes/SpecialUserrights.php @@ -141,7 +141,7 @@ class UserrightsPage extends SpecialPage { // 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 { diff --git a/includes/SpecialWatchlist.php b/includes/SpecialWatchlist.php index bb5e7ba06f..f0bddf8d53 100644 --- a/includes/SpecialWatchlist.php +++ b/includes/SpecialWatchlist.php @@ -44,7 +44,7 @@ function wfSpecialWatchlist( $par ) { return; } - $uid = $wgUser->getId(); + $uid = $wgUser->getID(); if( ($wgEnotifWatchlist || $wgShowUpdatedMarker) && $wgRequest->getVal( 'reset' ) && $wgRequest->wasPosted() ) { $wgUser->clearAllNotifications( $uid ); $wgOut->redirect( $specialTitle->getFullUrl() ); diff --git a/includes/Title.php b/includes/Title.php index b8b5e1e56b..760eb3a152 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -1338,7 +1338,7 @@ class Title { , '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__ ); diff --git a/includes/UserMailer.php b/includes/UserMailer.php index 8e576bb21b..fa11454c20 100644 --- a/includes/UserMailer.php +++ b/includes/UserMailer.php @@ -342,12 +342,12 @@ class EmailNotification { $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" ); } diff --git a/includes/WatchedItem.php b/includes/WatchedItem.php index ace50a5fc8..51d1b88b6e 100644 --- a/includes/WatchedItem.php +++ b/includes/WatchedItem.php @@ -19,7 +19,7 @@ class WatchedItem { $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 diff --git a/includes/WatchlistEditor.php b/includes/WatchlistEditor.php index 4f64b783f4..f442b049fd 100644 --- a/includes/WatchlistEditor.php +++ b/includes/WatchlistEditor.php @@ -158,7 +158,7 @@ class WatchlistEditor { */ 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 } @@ -177,7 +177,7 @@ class WatchlistEditor { 'watchlist', '*', array( - 'wl_user' => $user->getId(), + 'wl_user' => $user->getID(), ), __METHOD__ ); @@ -203,7 +203,7 @@ class WatchlistEditor { 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 @@ -254,7 +254,7 @@ class WatchlistEditor { */ 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__ ); } /** @@ -274,13 +274,13 @@ class WatchlistEditor { $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, @@ -308,7 +308,7 @@ class WatchlistEditor { $dbw->delete( 'watchlist', array( - 'wl_user' => $user->getId(), + 'wl_user' => $user->getID(), 'wl_namespace' => ( $title->getNamespace() & ~1 ), 'wl_title' => $title->getDBkey(), ), @@ -317,7 +317,7 @@ class WatchlistEditor { $dbw->delete( 'watchlist', array( - 'wl_user' => $user->getId(), + 'wl_user' => $user->getID(), 'wl_namespace' => ( $title->getNamespace() | 1 ), 'wl_title' => $title->getDBkey(), ), diff --git a/includes/api/ApiQueryUserInfo.php b/includes/api/ApiQueryUserInfo.php index 3ad9177aa8..633ba1f2cc 100644 --- a/includes/api/ApiQueryUserInfo.php +++ b/includes/api/ApiQueryUserInfo.php @@ -57,7 +57,7 @@ class ApiQueryUserInfo extends ApiQueryBase { global $wgUser; $result = $this->getResult(); $vals = array(); - $vals['id'] = $wgUser->getId(); + $vals['id'] = $wgUser->getID(); $vals['name'] = $wgUser->getName(); if($wgUser->isAnon()) diff --git a/includes/filerepo/LocalFile.php b/includes/filerepo/LocalFile.php index 9e8a3ef08e..7d0d548fad 100644 --- a/includes/filerepo/LocalFile.php +++ b/includes/filerepo/LocalFile.php @@ -1262,7 +1262,7 @@ class LocalFileDeleteBatch { 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(); -- 2.20.1