r45405 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r45404‎ | r45405 | r45406 >
Date:21:12, 4 January 2009
Author:ialex
Status:ok
Tags:
Comment:
* Fixed SQL query: user_real_name and user_email cannot be null
* missing second param when running UserLoginComplete hook
* Some whitespaces fixes
Modified paths:
  • /trunk/extensions/OpenID/SpecialOpenIDFinish.body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/OpenID/SpecialOpenIDFinish.body.php
@@ -175,9 +175,9 @@
176176 $wgUser->SetCookies();
177177
178178 # Run any hooks; ignore results
 179+ $inject_html = '';
 180+ wfRunHooks( 'UserLoginComplete', array( &$wgUser, &$inject_html ) );
179181
180 - wfRunHooks('UserLoginComplete', array(&$wgUser));
181 -
182182 # Set a cookie for later check-immediate use
183183
184184 $this->loginSetCookie($openid);
@@ -186,6 +186,7 @@
187187 $wgOut->setRobotPolicy( 'noindex,nofollow' );
188188 $wgOut->setArticleRelated( false );
189189 $wgOut->addWikiText( wfMsg( 'openidsuccess', $wgUser->getName(), $openid ) );
 190+ $wgOut->addHtml( $inject_html );
190191 $wgOut->returnToMain(false, $this->returnTo());
191192 }
192193
@@ -354,32 +355,32 @@
355356
356357 # FIXME: only update if there's been a change
357358
358 - if (array_key_exists('nickname', $sreg)) {
359 - $user->setOption('nickname', $sreg['nickname']);
 359+ if ( array_key_exists( 'nickname', $sreg ) ) {
 360+ $user->setOption( 'nickname', $sreg['nickname'] );
360361 } else {
361362 $user->setOption('nickname', '');
362363 }
363364
364 - if (array_key_exists('email', $sreg)) {
 365+ if ( array_key_exists( 'email', $sreg ) ) {
365366 $user->setEmail( $sreg['email'] );
366367 } else {
367 - $user->setEmail(NULL);
 368+ $user->setEmail( '' );
368369 }
369370
370 - if (array_key_exists('fullname', $sreg) && $wgAllowRealName) {
 371+ if ( array_key_exists( 'fullname', $sreg ) && $wgAllowRealName) {
371372 $user->setRealName($sreg['fullname']);
372373 } else {
373 - $user->setRealName(NULL);
 374+ $user->setRealName( '' );
374375 }
375376
376 - if (array_key_exists('language', $sreg)) {
 377+ if ( array_key_exists( 'language', $sreg ) ) {
377378 # FIXME: check and make sure the language exists
378 - $user->setOption('language', $sreg['language']);
 379+ $user->setOption( 'language', $sreg['language'] );
379380 } else {
380 - $user->setOption('language', NULL);
 381+ $user->setOption( 'language', NULL );
381382 }
382383
383 - if (array_key_exists('timezone', $sreg)) {
 384+ if (array_key_exists( 'timezone', $sreg ) ) {
384385 # FIXME: do something with it.
385386 # $offset = OpenIDTimezoneToTzoffset($sreg['timezone']);
386387 # $user->setOption('timecorrection', $offset);

Status & tagging log