r97770 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r97769‎ | r97770 | r97771 >
Date:23:18, 21 September 2011
Author:wikinaut
Status:ok (Comments)
Tags:
Comment:
follow up to r97447 r97566 . changed function name getUserUrl to getUserOpenIDInformation because this now returns not only OpenID Url/s but also registration timestamps. added the updater for sql database, which was, oops, forgotten in former commits.
Modified paths:
  • /trunk/extensions/OpenID/OpenID.hooks.php (modified) (history)
  • /trunk/extensions/OpenID/OpenID.php (modified) (history)
  • /trunk/extensions/OpenID/README.OpenID-mediawiki-extension (modified) (history)
  • /trunk/extensions/OpenID/SpecialOpenID.body.php (modified) (history)
  • /trunk/extensions/OpenID/SpecialOpenIDConvert.body.php (modified) (history)
  • /trunk/extensions/OpenID/SpecialOpenIDServer.body.php (modified) (history)
  • /trunk/extensions/OpenID/patches/patch-uoi_user_registration-not-present.sql (added) (history)

Diff [purge]

Index: trunk/extensions/OpenID/README.OpenID-mediawiki-extension
@@ -1,5 +1,5 @@
22 MediaWiki OpenID extension README.OpenID-mediawiki-extension file
3 -version 0.938-beta 20110920
 3+version 0.939-beta 20110922
44
55 Homepage and manual http://www.mediawiki.org/wiki/Extension:OpenID
66
@@ -421,15 +421,6 @@
422422 $wgOpenIDProposeUsernameFromSREG = false;
423423 $wgOpenIDAllowAutomaticUsername = false;
424424
425 -
426 -== Skins ==
427 -
428 -If you are customizing a skin, and you want to show the OpenID
429 -identity for a user (say, on their user page), use the function
430 -OpenIDGetUserUrl($user). It takes a User object (not a name or an id!)
431 -and returns the user's OpenID identity if it exists, or null if it
432 -doesn't.
433 -
434425 == Translation ==
435426
436427 The user interface strings for this extension are configurable and all start
@@ -476,6 +467,7 @@
477468 into that account now
478469
479470 == CHANGES ==
 471+* 0.939 function name changes
480472 * 0.938 list uoi_user_registration timestamp if present in openid-preference tab
481473 * 0.937 added uoi_user_registration timestamp field (bug30623)
482474 * 0.934 fixes
Index: trunk/extensions/OpenID/OpenID.hooks.php
@@ -58,7 +58,7 @@
5959 if ( $nt && $nt->getNamespace() == NS_USER && strpos( $nt->getText(), '/' ) === false ) {
6060 $user = User::newFromName( $nt->getText() );
6161 if ( $user && $user->getID() != 0 ) {
62 - $openid = SpecialOpenID::getUserUrl( $user );
 62+ $openid = SpecialOpenID::getUserOpenIDInformation( $user );
6363 if ( count( $openid ) && strlen( $openid[0] ) != 0 ) {
6464 global $wgOpenIDShowUrlOnUserPage;
6565
@@ -134,7 +134,7 @@
135135
136136 private static function getInfoTable( $user ) {
137137 global $wgLang;
138 - $openid_urls_registration = SpecialOpenID::getUserUrl( $user );
 138+ $openid_urls_registration = SpecialOpenID::getUserOpenIDInformation( $user );
139139 $delTitle = SpecialPage::getTitleFor( 'OpenIDConvert', 'Delete' );
140140 $sk = $user->getSkin();
141141 $rows = '';
Index: trunk/extensions/OpenID/patches/patch-uoi_user_registration-not-present.sql
@@ -0,0 +1,4 @@
 2+--
 3+-- SQL schema update for OpenID extension to add the uoi_user_registration field
 4+--
 5+ALTER TABLE /*_*/user_openid ADD uoi_user_registration BINARY(14);
Index: trunk/extensions/OpenID/SpecialOpenIDServer.body.php
@@ -246,7 +246,7 @@
247247
248248 # Is the user an OpenID user?
249249
250 - if ( !$wgOpenIDAllowServingOpenIDUserAccounts && $this->getUserUrl( $user ) ) {
 250+ if ( !$wgOpenIDAllowServingOpenIDUserAccounts && $this->getUserOpenIDInformation( $user ) ) {
251251 wfDebug( "OpenID: Not one of our users; logs in with OpenID.\n" );
252252 return $request->answer( false, $this->serverUrl() );
253253 }
Index: trunk/extensions/OpenID/SpecialOpenID.body.php
@@ -326,9 +326,9 @@
327327 $wgRequest->response()->setcookie( 'OpenID', $openid, time() + $wgOpenIDCookieExpiration );
328328 }
329329
330 - # Find the user with the given openid, if any
331 - # return openid url and registration timestamp
332 - public static function getUserUrl( $user ) {
 330+ # Find the user with the given openid
 331+ # return the registered OpenID urls and registration timestamps (if available)
 332+ public static function getUserOpenIDInformation( $user ) {
333333 $openid_urls_registration = array();
334334
335335 if ( $user instanceof User && $user->getId() != 0 ) {
Index: trunk/extensions/OpenID/SpecialOpenIDConvert.body.php
@@ -161,7 +161,7 @@
162162 $wgOut->setPageTitle( wfMsg( 'openiddelete' ) );
163163
164164 # Check if the user is removing it's last OpenID url
165 - $urls = self::getUserUrl( $wgUser );
 165+ $urls = self::getUserOpenIDInformation( $wgUser );
166166 if ( count( $urls ) == 1 ) {
167167 if ( $wgUser->mPassword == '' ) {
168168 $wgOut->showErrorPage( 'openiderror', 'openiddeleteerrornopassword' );
Index: trunk/extensions/OpenID/OpenID.php
@@ -27,7 +27,7 @@
2828 exit( 1 );
2929 }
3030
31 -define( 'MEDIAWIKI_OPENID_VERSION', '0.938-beta 20110920' );
 31+define( 'MEDIAWIKI_OPENID_VERSION', '0.939-beta 20110922' );
3232
3333 $path = dirname( __FILE__ );
3434 set_include_path( implode( PATH_SEPARATOR, array( $path ) ) . PATH_SEPARATOR . get_include_path() );

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r97447v0.937 added uoi_user_registration timestamp when a new OpenID identity is ad...wikinaut23:55, 18 September 2011
r97566follow up to r97447 : show OpenID registration timestamps in OpenID preferenc...wikinaut22:18, 19 September 2011

Comments

#Comment by Wikinaut (talk | contribs)   23:20, 21 September 2011

looks complicated, but isn't. Current version is confirmed again to be working with MW trunk (as any commit should!)

#Comment by 😂 (talk | contribs)   20:07, 5 October 2011

patch-uoi_user_registration-not-present.sql needs eol-style. Otherwise this looks ok.

#Comment by IAlex (talk | contribs)   20:09, 5 October 2011

Already done in r97841.

#Comment by 😂 (talk | contribs)   20:10, 5 October 2011

Ah ok nevermind then :)

Status & tagging log