Index: trunk/extensions/OpenID/openid_table.sql |
— | — | @@ -1,10 +0,0 @@ |
2 | | - |
3 | | -CREATE TABLE /*$wgDBprefix*/user_openid ( |
4 | | - uoi_openid varchar(255) NOT NULL PRIMARY KEY, |
5 | | - uoi_user int(5) unsigned NOT NULL |
6 | | -) /*$wgDBTableOptions*/; |
7 | | - |
8 | | -CREATE INDEX /*$wgDBprefix*/user_openid_user ON /*$wgDBprefix*/user_openid(uoi_user); |
Index: trunk/extensions/OpenID/patch-uoi_user-not-unique.sql |
— | — | @@ -1,6 +0,0 @@ |
2 | | - |
3 | | -ALTER TABLE /*$wgDBprefix*/user_openid DROP INDEX uoi_user; |
4 | | -CREATE INDEX /*$wgDBprefix*/user_openid_user ON /*$wgDBprefix*/user_openid(uoi_user); |
Index: trunk/extensions/OpenID/openid_table.pg.sql |
— | — | @@ -1,9 +0,0 @@ |
2 | | - |
3 | | - |
4 | | -CREATE TABLE user_openid ( |
5 | | - uoi_openid VARCHAR(255) NOT NULL PRIMARY KEY, |
6 | | - uoi_user INTEGER NOT NULL REFERENCES mwuser(user_id) |
7 | | -); |
8 | | - |
9 | | -CREATE INDEX user_openid_user ON user_openid(uoi_user); |
Index: trunk/extensions/OpenID/OpenID.hooks.php |
— | — | @@ -150,7 +150,6 @@ |
151 | 151 | $info .= $user->getSkin()->link( SpecialPage::getTitleFor( 'OpenIDConvert' ), wfMsgHtml( 'openid-add-url' ) ); |
152 | 152 | return $info; |
153 | 153 | } |
154 | | - |
155 | 154 | |
156 | 155 | public static function onGetPreferences( $user, &$preferences ) { |
157 | 156 | global $wgOpenIDShowUrlOnUserPage, $wgAllowRealName; |
— | — | @@ -234,7 +233,6 @@ |
235 | 234 | return true; |
236 | 235 | } |
237 | 236 | |
238 | | - |
239 | 237 | public static function onDeleteAccount( &$userObj ) { |
240 | 238 | global $wgOut; |
241 | 239 | |
— | — | @@ -288,105 +286,8 @@ |
289 | 287 | |
290 | 288 | } |
291 | 289 | |
292 | | - # list of preferences used by extension |
293 | | - private static $oidPrefs = array( 'hide' ); |
294 | | - private static $oidUpdateOnLogin = array( 'nickname', 'email', 'fullname', |
295 | | - 'language', 'timezone' ); |
296 | | - |
297 | | - private static function getToggles() { |
298 | | - $toggles = self::$oidPrefs; |
299 | | - foreach( self::$oidUpdateOnLogin as $pref ) { |
300 | | - $toggles[] = 'update-on-login-' . $pref; |
301 | | - } |
302 | | - return $toggles; |
303 | | - } |
304 | | - |
305 | | - public static function onInitPreferencesForm( $prefs, $request ) { |
306 | | - foreach ( self::getToggles() as $oidPref ) { |
307 | | - $prefs->mToggles['openid-' . $oidPref] |
308 | | - = $request->getCheck( "wpOpOpenID-" . $oidPref ) ? 1 : 0; |
309 | | - } |
310 | | - |
311 | | - return true; |
312 | | - } |
313 | | - |
314 | | - public static function onRenderPreferencesForm( $prefs, $out ) { |
315 | | - global $wgUser; |
316 | | - |
317 | | - $out->addHeadItem( 'openidwikitablestyle', self::wikitableStyle() ); |
318 | | - |
319 | | - $out->addHTML( "\n<fieldset>\n<legend>" . wfMsgHtml( 'prefs-openid' ) . "</legend>\n<table>\n" ); |
320 | | - |
321 | | - #$out->addWikiText( wfMsg( 'openid-prefstext' ) ); |
322 | | - |
323 | | - foreach ( self::$oidPrefs as $oidPref ) { |
324 | | - $name = 'wpOpOpenID-' . $oidPref; |
325 | | - $out->addHTML( |
326 | | - Xml::tags( 'tr', array(), |
327 | | - Xml::tags( 'td', array( 'style' => 'width: 20%;' ), '' ) . |
328 | | - Xml::tags( 'td', array(), |
329 | | - Xml::tags( 'div', array( 'class' => 'toggle' ), |
330 | | - Xml::check( $name, $prefs->mToggles['openid-' . $oidPref] ) . |
331 | | - Xml::tags( 'span', array( 'class' => 'toggletext' ), |
332 | | - Xml::label( wfMsg( 'openid-pref-' . $oidPref ), $name ) |
333 | | - ) |
334 | | - ) |
335 | | - ) |
336 | | - ) |
337 | | - ); |
338 | | - } |
339 | | - |
340 | | - $out->addHTML( Xml::openElement( 'tr' ) . Xml::element( 'td', array(), |
341 | | - wfMsg( 'openid-pref-update-userinfo-on-login' ) ) . Xml::openElement( 'td' ) ); |
342 | | - |
343 | | - $first = true; |
344 | | - foreach ( self::$oidUpdateOnLogin as $oidPref ) { |
345 | | - if ( $first ) { |
346 | | - $first = false; |
347 | | - } else { |
348 | | - #$out->addHTML( '<br />' ); |
349 | | - } |
350 | | - $name = 'wpOpOpenID-update-on-login-' . $oidPref; |
351 | | - $out->addHTML( |
352 | | - Xml::tags( 'div', array( 'class' => 'toggle' ), |
353 | | - Xml::check( $name, $prefs->mToggles['openid-update-on-login-' . $oidPref] ) . |
354 | | - Xml::tags( 'span', array( 'class' => 'toggletext' ), |
355 | | - Xml::label( wfMsg( 'openid' . $oidPref ), $name ) |
356 | | - ) |
357 | | - ) |
358 | | - ); |
359 | | - } |
360 | | - |
361 | | - $out->addHTML( |
362 | | - "</td></tr>\n<tr><td>" . wfMsgHtml( 'openid-urls-desc' ) . |
363 | | - "</td><td>" . self::getInfoTable( $wgUser ) . |
364 | | - "</td></tr></table></fieldset>\n\n" |
365 | | - ); |
366 | | - |
367 | | - return true; |
368 | | - } |
369 | | - |
370 | | - public static function onSavePreferences( $prefs, $user, &$message, $old ) { |
371 | | - foreach ( self::getToggles() as $oidPref ) { |
372 | | - $user->setOption( 'openid-' . $oidPref, $prefs->mToggles['openid-' . $oidPref] ); |
373 | | - wfDebugLog( 'OpenID', 'Setting user preferences: ' . print_r( $user, true ) ); |
374 | | - } |
375 | | - |
376 | | - $user->saveSettings(); |
377 | | - |
378 | | - return true; |
379 | | - } |
380 | | - |
381 | | - public static function onResetPreferences( $prefs, $user ) { |
382 | | - foreach ( self::getToggles() as $oidPref ) { |
383 | | - $prefs->mToggles['openid-' . $oidPref] = $user->getOption( 'openid-' . $oidPref ); |
384 | | - } |
385 | | - |
386 | | - return true; |
387 | | - } |
388 | | - |
389 | 290 | public static function onLoadExtensionSchemaUpdates( $updater = null ) { |
390 | | - $base = dirname( __FILE__ ); |
| 291 | + $base = dirname( __FILE__ ) . '/patches'; |
391 | 292 | if ( $updater === null ) { // < 1.17 |
392 | 293 | global $wgDBtype, $wgUpdates, $wgExtNewTables; |
393 | 294 | if ( $wgDBtype == 'mysql' ) { |
— | — | @@ -421,11 +322,11 @@ |
422 | 323 | |
423 | 324 | $info = $db->fieldInfo( 'user_openid', 'uoi_user' ); |
424 | 325 | if ( !$info->isMultipleKey() ) { |
425 | | - wfOut( "Making uoi_user filed not unique..." ); |
| 326 | + echo( "Making uoi_user filed not unique..." ); |
426 | 327 | $db->sourceFile( dirname( __FILE__ ) . '/patch-uoi_user-not-unique.sql' ); |
427 | | - wfOut( " done.\n" ); |
| 328 | + echo( " done.\n" ); |
428 | 329 | } else { |
429 | | - wfOut( "...uoi_user field is already not unique.\n" ); |
| 330 | + echo( "...uoi_user field is already not unique.\n" ); |
430 | 331 | } |
431 | 332 | } |
432 | 333 | |
— | — | @@ -442,29 +343,4 @@ |
443 | 344 | |
444 | 345 | EOS; |
445 | 346 | } |
446 | | - |
447 | | - private static function wikitableStyle() { |
448 | | - return <<<EOS |
449 | | -<style type='text/css'> |
450 | | -table.wikitable { |
451 | | - margin: 1em 1em 1em 0; |
452 | | - background: #f9f9f9; |
453 | | - border: 1px #aaa solid; |
454 | | - border-collapse: collapse; |
455 | 347 | } |
456 | | -.wikitable th, .wikitable td { |
457 | | - border: 1px #aaa solid; |
458 | | - padding: 0.2em; |
459 | | -} |
460 | | -.wikitable th { |
461 | | - background: #f2f2f2; |
462 | | - text-align: center; |
463 | | -} |
464 | | -.wikitable caption { |
465 | | - font-weight: bold; |
466 | | -} |
467 | | -</style> |
468 | | - |
469 | | -EOS; |
470 | | - } |
471 | | -} |
Index: trunk/extensions/OpenID/patches/openid_table.sql |
— | — | @@ -0,0 +1,10 @@ |
| 2 | +-- |
| 3 | +-- SQL schema for OpenID extension |
| 4 | +-- |
| 5 | + |
| 6 | +CREATE TABLE /*_*/user_openid ( |
| 7 | + uoi_openid varchar(255) NOT NULL PRIMARY KEY, |
| 8 | + uoi_user int(5) unsigned NOT NULL |
| 9 | +) /*$wgDBTableOptions*/; |
| 10 | + |
| 11 | +CREATE INDEX /*i*/user_openid_user ON /*_*/user_openid(uoi_user); |
Property changes on: trunk/extensions/OpenID/patches/openid_table.sql |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 12 | + native |
Index: trunk/extensions/OpenID/patches/patch-uoi_user-not-unique.sql |
— | — | @@ -0,0 +1,6 @@ |
| 2 | +-- |
| 3 | +-- SQL schema update for OpenID extension to make the uoi_user field not unique |
| 4 | +-- |
| 5 | + |
| 6 | +ALTER TABLE /*_*/user_openid DROP INDEX uoi_user; |
| 7 | +CREATE INDEX /*i*/user_openid_user ON /*_*/user_openid(uoi_user); |
Property changes on: trunk/extensions/OpenID/patches/patch-uoi_user-not-unique.sql |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 8 | + native |
Index: trunk/extensions/OpenID/patches/openid_table.pg.sql |
— | — | @@ -0,0 +1,9 @@ |
| 2 | + |
| 3 | +-- Schema for the OpenID extension (Postgres version) |
| 4 | + |
| 5 | +CREATE TABLE /*_*/user_openid ( |
| 6 | + uoi_openid VARCHAR(255) NOT NULL PRIMARY KEY, |
| 7 | + uoi_user INTEGER NOT NULL REFERENCES mwuser(user_id) |
| 8 | +); |
| 9 | + |
| 10 | +CREATE INDEX /*i*/user_openid_user ON /*_*/user_openid(uoi_user); |
Property changes on: trunk/extensions/OpenID/patches/openid_table.pg.sql |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 11 | + native |
Index: trunk/extensions/OpenID/OpenID.setup.php |
— | — | @@ -287,17 +287,12 @@ |
288 | 288 | # 1.16+ |
289 | 289 | $wgHooks['GetPreferences'][] = 'OpenIDHooks::onGetPreferences'; |
290 | 290 | |
291 | | -# < 1.16 |
292 | | -$wgHooks['RenderPreferencesForm'][] = 'OpenIDHooks::onRenderPreferencesForm'; |
293 | | -$wgHooks['InitPreferencesForm'][] = 'OpenIDHooks::onInitPreferencesForm'; |
294 | | -$wgHooks['ResetPreferences'][] = 'OpenIDHooks::onResetPreferences'; |
295 | | -$wgHooks['SavePreferences'][] = 'OpenIDHooks::onSavePreferences'; |
296 | | - |
297 | 291 | # FIXME, function does not exist |
298 | 292 | # $wgHooks['UserLoginForm'][] = 'OpenIDHooks::onUserLoginForm'; |
299 | 293 | |
300 | 294 | # new user rights |
301 | | -$wgAvailableRights[] = array( 'openid-dashboard-access', 'openid-dashboard-admin' ); |
| 295 | +$wgAvailableRights[] = 'openid-dashboard-access'; |
| 296 | +$wgAvailableRights[] = 'openid-dashboard-admin'; |
302 | 297 | |
303 | 298 | # allow users to read access the dashboard |
304 | 299 | $wgGroupPermissions['user']['openid-dashboard-access'] = true; |