Index: trunk/extensions/OpenID/README.OpenID-mediawiki-extension |
— | — | @@ -1,5 +1,5 @@ |
2 | 2 | MediaWiki OpenID extension README.OpenID-mediawiki-extension file |
3 | | -version 0.934-beta 20110829 |
| 3 | +version 0.937-beta 20110019 |
4 | 4 | |
5 | 5 | Homepage and manual http://www.mediawiki.org/wiki/Extension:OpenID |
6 | 6 | |
— | — | @@ -462,7 +462,6 @@ |
463 | 463 | == TODO == |
464 | 464 | |
465 | 465 | * Code review http://preview.tinyurl.com/openid-codereview |
466 | | - |
467 | 466 | * Move TODO file and things below into Bugzilla |
468 | 467 | |
469 | 468 | The TODO file in this distribution has stuff I think needs to be |
— | — | @@ -477,6 +476,7 @@ |
478 | 477 | into that account now |
479 | 478 | |
480 | 479 | == CHANGES == |
| 480 | +* 0.937 added uoi_user_registration timestamp field (bug30623) |
481 | 481 | * 0.934 fixes |
482 | 482 | bug 29543 After logging in with OpenID, user page link in the personal toolbar |
483 | 483 | pt portlet) still has the User:IP link (needs refresh to link to |
Index: trunk/extensions/OpenID/OpenID.hooks.php |
— | — | @@ -139,8 +139,17 @@ |
140 | 140 | $rows = ''; |
141 | 141 | foreach ( $urls as $url ) { |
142 | 142 | $rows .= Xml::tags( 'tr', array(), |
143 | | - Xml::tags( 'td', array(), Xml::element( 'a', array( 'href' => $url ), $url ) ) . |
144 | | - Xml::tags( 'td', array(), $sk->link( $delTitle, wfMsgHtml( 'openid-urls-delete' ), array(), array( 'url' => $url ) ) ) |
| 143 | + Xml::tags( 'td', |
| 144 | + array(), |
| 145 | + Xml::element( 'a', array( 'href' => $url ), $url ) |
| 146 | + ) . |
| 147 | + Xml::tags( 'td', |
| 148 | + array(), |
| 149 | + $sk->link( $delTitle, wfMsgHtml( 'openid-urls-delete' ), |
| 150 | + array(), |
| 151 | + array( 'url' => $url ) |
| 152 | + ) |
| 153 | + ) |
145 | 154 | ) . "\n"; |
146 | 155 | } |
147 | 156 | $info = Xml::tags( 'table', array( 'class' => 'wikitable' ), |
— | — | @@ -293,6 +302,7 @@ |
294 | 303 | if ( $wgDBtype == 'mysql' ) { |
295 | 304 | $wgExtNewTables[] = array( 'user_openid', "$base/openid_table.sql" ); |
296 | 305 | $wgUpdates['mysql'][] = array( array( __CLASS__, 'makeUoiUserNotUnique' ) ); |
| 306 | + $wgUpdates['mysql'][] = array( array( __CLASS__, 'addUoiUserRegistration' ) ); |
297 | 307 | } elseif ( $wgDBtype == 'postgres' ) { |
298 | 308 | $wgExtNewTables[] = array( 'user_openid', "$base/openid_table.pg.sql" ); |
299 | 309 | # This doesn't work since MediaWiki doesn't use $wgUpdates when |
— | — | @@ -305,6 +315,7 @@ |
306 | 316 | $updater->addExtensionUpdate( array( 'addTable', 'user_openid', $dbPatch, true ) ); |
307 | 317 | if ( $updater->getDB()->getType() == 'mysql' ) { |
308 | 318 | $updater->addExtensionUpdate( array( array( __CLASS__, 'makeUoiUserNotUnique' ) ) ); |
| 319 | + $updater->addExtensionUpdate( array( array( __CLASS__, 'addUoiUserRegistration' ) ) ); |
309 | 320 | } |
310 | 321 | } |
311 | 322 | |
— | — | @@ -322,14 +333,31 @@ |
323 | 334 | |
324 | 335 | $info = $db->fieldInfo( 'user_openid', 'uoi_user' ); |
325 | 336 | if ( !$info->isMultipleKey() ) { |
326 | | - echo( "Making uoi_user filed not unique..." ); |
| 337 | + echo( "Making uoi_user field not unique..." ); |
327 | 338 | $db->sourceFile( dirname( __FILE__ ) . '/patches/patch-uoi_user-not-unique.sql' ); |
328 | 339 | echo( " done.\n" ); |
329 | 340 | } else { |
330 | 341 | echo( "...uoi_user field is already not unique.\n" ); |
331 | 342 | } |
332 | 343 | } |
| 344 | + public static function addUoiUserRegistration( $updater = null ) { |
| 345 | + if ( $updater === null ) { |
| 346 | + $db = wfGetDB( DB_MASTER ); |
| 347 | + } else { |
| 348 | + $db = $updater->getDB(); |
| 349 | + } |
| 350 | + if ( !$db->tableExists( 'user_openid' ) ) |
| 351 | + return; |
333 | 352 | |
| 353 | + if ( !$db->fieldExists( 'user_openid', 'uoi_user_registration' ) ) { |
| 354 | + echo( "Adding uoi_user_registration field..." ); |
| 355 | + $db->sourceFile( dirname( __FILE__ ) . '/patches/patch-uoi_user_registration-not-present.sql' ); |
| 356 | + echo( " done.\n" ); |
| 357 | + } else { |
| 358 | + echo( "...uoi_user_registration field present.\n" ); |
| 359 | + } |
| 360 | + } |
| 361 | + |
334 | 362 | private static function loginStyle() { |
335 | 363 | global $wgOpenIDLoginLogoUrl; |
336 | 364 | return <<<EOS |
Index: trunk/extensions/OpenID/patches/openid_table.sql |
— | — | @@ -4,7 +4,8 @@ |
5 | 5 | |
6 | 6 | CREATE TABLE /*_*/user_openid ( |
7 | 7 | uoi_openid varchar(255) NOT NULL PRIMARY KEY, |
8 | | - uoi_user int(5) unsigned NOT NULL |
| 8 | + uoi_user int(5) unsigned NOT NULL, |
| 9 | + uoi_user_registration binary(14) |
9 | 10 | ) /*$wgDBTableOptions*/; |
10 | 11 | |
11 | 12 | CREATE INDEX /*i*/user_openid_user ON /*_*/user_openid(uoi_user); |
Index: trunk/extensions/OpenID/SpecialOpenID.body.php |
— | — | @@ -334,7 +334,7 @@ |
335 | 335 | $dbr = wfGetDB( DB_SLAVE ); |
336 | 336 | $res = $dbr->select( |
337 | 337 | array( 'user_openid' ), |
338 | | - array( 'uoi_openid' ), |
| 338 | + array( 'uoi_openid', 'uoi_user_registration' ), |
339 | 339 | array( 'uoi_user' => $user->getId() ), |
340 | 340 | __METHOD__ |
341 | 341 | ); |
— | — | @@ -371,7 +371,8 @@ |
372 | 372 | 'user_openid', |
373 | 373 | array( |
374 | 374 | 'uoi_user' => $user->getId(), |
375 | | - 'uoi_openid' => $url |
| 375 | + 'uoi_openid' => $url, |
| 376 | + 'uoi_user_registration' => wfTimestamp( TS_MW ) |
376 | 377 | ), |
377 | 378 | __METHOD__ |
378 | 379 | ); |
Index: trunk/extensions/OpenID/OpenID.php |
— | — | @@ -27,7 +27,7 @@ |
28 | 28 | exit( 1 ); |
29 | 29 | } |
30 | 30 | |
31 | | -define( 'MEDIAWIKI_OPENID_VERSION', '0.936-beta 20110831' ); |
| 31 | +define( 'MEDIAWIKI_OPENID_VERSION', '0.937-beta 20110919' ); |
32 | 32 | |
33 | 33 | $path = dirname( __FILE__ ); |
34 | 34 | set_include_path( implode( PATH_SEPARATOR, array( $path ) ) . PATH_SEPARATOR . get_include_path() ); |