r33063 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r33062‎ | r33063 | r33064 >
Date:08:37, 10 April 2008
Author:werdna
Status:old
Tags:
Comment:
Minor code quality stuff caught by Tim.
Modified paths:
  • /trunk/extensions/CentralAuth/CentralAuth.php (modified) (history)
  • /trunk/extensions/CentralAuth/CentralAuthUser.php (modified) (history)
  • /trunk/extensions/CentralAuth/SpecialAutoLogin.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CentralAuth/CentralAuthUser.php
@@ -58,6 +58,7 @@
5959 * Lazy-load up the most commonly required state information
6060 */
6161 private function loadState() {
 62+ wfProfileIn( __METHOD__ );
6263 if( !isset( $this->mGlobalId ) ) {
6364 global $wgDBname;
6465 $dbr = self::getCentralSlaveDB();
@@ -65,7 +66,8 @@
6667 $localuser = self::tableName( 'localuser' );
6768
6869 $sql =
69 - "SELECT gu_id, lu_dbname, gu_salt, gu_password,gu_authtoken,gu_locked,gu_hidden,gu_registration
 70+ "SELECT gu_id, lu_dbname, gu_salt, gu_password,gu_authtoken,
 71+ gu_locked,gu_hidden,gu_registration,gu_email,gu_email_authenticated
7072 FROM $globaluser
7173 LEFT OUTER JOIN $localuser
7274 ON gu_name=lu_name
@@ -84,11 +86,14 @@
8587 $this->mLocked = $row->gu_locked;
8688 $this->mHidden = $row->gu_hidden;
8789 $this->mRegistration = $row->gu_registration;
 90+ $this->mEmail = $row->gu_email;
 91+ $this->mAuthenticationTimestamp = $row->gu_email_authenticated;
8892 } else {
8993 $this->mGlobalId = 0;
9094 $this->mIsAttached = false;
9195 }
9296 }
 97+ wfProfileOut( __METHOD__ );
9398 }
9499
95100 /**
@@ -1087,19 +1092,13 @@
10881093 }
10891094
10901095 function getEmail() {
1091 - $dbr = self::getCentralDB();
1092 - return $dbr->selectField( self::tableName( 'globaluser' ),
1093 - 'gu_email',
1094 - array( 'gu_id' => $this->getId() ),
1095 - __METHOD__ );
 1096+ $this->loadState();
 1097+ return $this->mEmail;
10961098 }
10971099
10981100 function getEmailAuthenticationTimestamp() {
1099 - $dbr = self::getCentralDB();
1100 - return $dbr->selectField( self::tableName( 'globaluser' ),
1101 - 'gu_email_authenticated',
1102 - array( 'gu_id' => $this->getId() ),
1103 - __METHOD__ );
 1101+ $this->loadState();
 1102+ return $this->mAuthenticationTimestamp;
11041103 }
11051104
11061105 /**
Index: trunk/extensions/CentralAuth/CentralAuth.php
@@ -44,7 +44,7 @@
4545 $wgCentralAuthCookieDomains = $wgServer;
4646
4747 /**
48 - * Prefix for CentralAuth cookies.
 48+ * Prefix for CentralAuth global authentication cookies.
4949 */
5050 $wgCentralAuthCookiePrefix = 'centralauth_';
5151
@@ -54,11 +54,6 @@
5555 */
5656 $wgCentralAuthAutoLoginWikis = array();
5757
58 -/**
59 - * Prefix for CentralAuth global auto-authentication cookies
60 - */
61 - $wgCentralAuthCookiePrefix = 'centralauth';
62 -
6358 $wgExtensionCredits['specialpage'][] = array(
6459 'name' => 'Central Auth',
6560 'url' => 'http://www.mediawiki.org/wiki/Extension:CentralAuth',
Index: trunk/extensions/CentralAuth/SpecialAutoLogin.php
@@ -11,8 +11,6 @@
1212
1313 global $IP;
1414
15 -require_once( "$IP/includes/StreamFile.php" );
16 -
1715 class SpecialAutoLogin extends UnlistedSpecialPage
1816 {
1917 function SpecialAutoLogin() {
@@ -52,6 +50,8 @@
5351 }
5452 }
5553
 54+ require_once( "$IP/includes/StreamFile.php" );
 55+
5656 wfStreamFile( dirname(__FILE__).'/1x1.png' );
5757
5858 $wgOut->disable();

Status & tagging log