r105878 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r105877‎ | r105878 | r105879 >
Date:14:11, 12 December 2011
Author:reedy
Status:deferred
Tags:
Comment:
Update GlobalAuth not to just break after r98339 (removing user_options stuff)

Also fixed a couple of syntax, $dbw was assigned, but $dbr used...
Modified paths:
  • /trunk/extensions/auth/GlobalAuth.php (modified) (history)

Diff [purge]

Index: trunk/extensions/auth/GlobalAuth.php
@@ -61,7 +61,7 @@
6262 $res = $dbr->select( $this->tablename, 'user_wiki',
6363 array( 'user_name' => $username ),
6464 $fname );
65 - while ( $row = $dbr->fetchObject( $res ) ) {
 65+ foreach( $res as $row ) {
6666 if ( $row->user_wiki == $this->thiswiki || $row->user_wiki == '*' ) {
6767 return true;
6868 }
@@ -87,11 +87,11 @@
8888 $res = $dbr->select( $this->tablename, array( 'user_wiki',
8989 'user_name', 'user_password',
9090 'user_email', 'user_email_authenticated',
91 - 'user_real_name', 'user_options',
 91+ 'user_real_name',
9292 'user_token' ),
9393 array( 'user_name' => $username ),
9494 $fname );
95 - while ( $row = $dbr->fetchObject( $res ) ) {
 95+ foreach( $res as $row ) {
9696 if ( $row->user_wiki == $this->thiswiki || $row->user_wiki == '*' ) {
9797 if ( $row->user_password == User::oldCrypt( $password, $row->user_id ) ) {
9898 $this->data =& $row;
@@ -175,7 +175,6 @@
176176 'user_email' => $user->getEmail(),
177177 'user_email_authenticated' => $dbw->timestampOrNull( $user->getEmailAuthenticationTimestamp() ),
178178 'user_real_name' => $user->getRealName(),
179 - 'user_options' => $user->encodeOptions(),
180179 'user_token' => $user->mToken ),
181180 array( /*WHERE*/ 'user_id' => $this->data->user_id,
182181 'user_wiki' => $this->data->user_wiki ),
@@ -213,7 +212,7 @@
214213 'GlobalAuth::addUser' );
215214 $create = true;
216215 $first = true;
217 - while ( $row = $dbr->fetchObject( $res ) ) {
 216+ foreach( $res as $row ) {
218217 if ( $first ) {
219218 # Set create to false for now. We've found entries for
220219 # this username. Now we have to check whether we allow
@@ -247,17 +246,16 @@
248247 'user_email_authenticated' => $dbw->timestampOrNull(
249248 $user->getEmailAuthenticationTimestamp() ),
250249 'user_real_name' => $user->getRealName(),
251 - 'user_options' => $user->encodeOptions(),
252250 'user_token' => $user->mToken,
253251 'user_wiki' => $wiki ),
254252 $fname );
255253
256254 # Query back to get the user_id
257255
258 - $row = $dbr->selectRow( $this->tablename, array( 'user_wiki',
 256+ $row = $dbw->selectRow( $this->tablename, array( 'user_wiki',
259257 'user_name', 'user_password',
260258 'user_email', 'user_email_authenticated',
261 - 'user_real_name', 'user_options',
 259+ 'user_real_name',
262260 'user_token' ),
263261 array( 'user_name' => $user->getName(),
264262 'user_wiki' => $wiki ),

Sign-offs

UserFlagDate
Nikerabbitinspected14:53, 12 December 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r98339* (bug 31204) Remove old user.user_options...reedy18:08, 28 September 2011

Status & tagging log