r95706 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r95705‎ | r95706 | r95707 >
Date:21:53, 29 August 2011
Author:wikinaut
Status:deferred (Comments)
Tags:
Comment:
fixes this annoying bug29543 - After logging in with OpenID, user page link in the personal toolbar (pt portlet) still has the User:IP link (needs refresh to link to User:Username). Thanks to Hashar and Dantman for supporting me. Basically it came from behaviour change in MediaWiki 1.18 see http://www.mediawiki.org/wiki/Request_Context
Modified paths:
  • /trunk/extensions/OpenID/OpenID.php (modified) (history)
  • /trunk/extensions/OpenID/README.OpenID-mediawiki-extension (modified) (history)
  • /trunk/extensions/OpenID/SpecialOpenIDLogin.body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/OpenID/README.OpenID-mediawiki-extension
@@ -1,6 +1,5 @@
22 MediaWiki OpenID extension README.OpenID-mediawiki-extension file
3 -version 0.933-beta
4 -12 July 2011
 3+version 0.934-beta 20110829
54
65 Homepage and manual http://www.mediawiki.org/wiki/Extension:OpenID
76
@@ -117,8 +116,8 @@
118117
119118 Download and patch of openid library:
120119
121 - cd $IP/extensions/OpenID
122 - make
 120+ cd $IP/extensions/OpenID
 121+ make
123122
124123 The makefile downloads the openid-php library from http://www.openidenabled.com/php-openid/
125124 and applies a patch to avoid PHP errors because Call-time pass-by-reference is deprecated
@@ -139,8 +138,8 @@
140139 Run update.php script in in your MediaWiki maintenance folder to conditionally create
141140 a new table in MediaWiki database as required by the OpenID extension:
142141
143 - cd $IP/maintenance
144 - php update.php
 142+ cd $IP/maintenance
 143+ php update.php
145144
146145 Theoretically it should work out of the box, but you'll almost definitely want
147146 to set the trust root and access controls (see Configuration below).
@@ -478,10 +477,13 @@
479478 into that account now
480479
481480 == CHANGES ==
 481+* 0.934 fixes
 482+ bug 29543 After logging in with OpenID, user page link in the personal toolbar
 483+ pt portlet) still has the User:IP link (needs refresh to link to
 484+ User:Username)
482485 * [http://svn.wikimedia.org/viewvc/mediawiki/tags/extensions/OpenID/REL_0_8_4/ 0.8.4] (April 16, 2009) - Added provider buttons to the OpenID login page with optional icons ($wgOpenIDShowProviderIcons)
483486 * [http://svn.wikimedia.org/viewvc/mediawiki/tags/extensions/OpenID/REL_0_8_4_1/ 0.8.4.1] (April 16, 2009) - Post-release fix to broken icon on user's page.
484487 * 0.9.1 fixes for PHP > 5.3.x; fixed bugs
485488 bug 27419 OpenID extension: disallow new account creation for those users without "createaccount" permission
486489 bug 27581 3 new OpenID login page parameters: $wgOpenIDAllowManualUsername, AllowAutomaticUsername, ProposeUsernameFromSREG
487490 bug 18635 Allow to use User pages as OpenIDs even if user is using OpenID already
488 -
Index: trunk/extensions/OpenID/SpecialOpenIDLogin.body.php
@@ -409,6 +409,7 @@
410410 }
411411
412412 $wgUser = $user;
 413+ RequestContext::getMain()->setUser( $wgUser );
413414
414415 $this->clearValues();
415416
@@ -471,6 +472,7 @@
472473 if ( $user instanceof User ) {
473474 $this->updateUser( $user, $sreg, $ax ); # update from server
474475 $wgUser = $user;
 476+ RequestContext::getMain()->setUser( $wgUser );
475477 $this->displaySuccessLogin( $openid );
476478 } else {
477479 // if we are hardcoding nickname, and a valid e-mail address was returned, create a user with this name
Index: trunk/extensions/OpenID/OpenID.php
@@ -27,7 +27,7 @@
2828 exit( 1 );
2929 }
3030
31 -define( 'MEDIAWIKI_OPENID_VERSION', '0.933-beta' );
 31+define( 'MEDIAWIKI_OPENID_VERSION', '0.934-beta' );
3232
3333 $path = dirname( __FILE__ );
3434 set_include_path( implode( PATH_SEPARATOR, array( $path ) ) . PATH_SEPARATOR . get_include_path() );

Follow-up revisions

RevisionCommit summaryAuthorDate
r95804deleted unnecessary RequestContext calls and moved it to the single place whe...wikinaut19:08, 30 August 2011

Comments

#Comment by Wikinaut (talk | contribs)   08:34, 30 August 2011

If possible, I would like to ask

  • Dantman, and
  • Hashar, and perhaps
  • Ryan

to have a deeper look ( code review ) to my patch, and also to

as such (if everything is in line with current standards).

Thanks in advance.

I confirm, that the OpenID extension (trunk version) works as it should, together with MediaWiki trunk. Some minor improvements will follow: see list of open OpenID bugs https://bugzilla.wikimedia.org/buglist.cgi?component=OpenID&resolution=--- .

#Comment by Wikinaut (talk | contribs)   19:10, 30 August 2011

in the follow up commit r95804 , the two RequestContext calls are consolidated into one, and only when it is needed

Status & tagging log