Index: trunk/extensions/OpenID/OpenID.setup.php |
— | — | @@ -27,7 +27,7 @@ |
28 | 28 | exit( 1 ); |
29 | 29 | } |
30 | 30 | |
31 | | -define( 'MEDIAWIKI_OPENID_VERSION', '0.928-beta' ); |
| 31 | +define( 'MEDIAWIKI_OPENID_VERSION', '0.929-beta' ); |
32 | 32 | |
33 | 33 | $path = dirname( __FILE__ ); |
34 | 34 | set_include_path( implode( PATH_SEPARATOR, array( $path ) ) . PATH_SEPARATOR . get_include_path() ); |
— | — | @@ -208,6 +208,13 @@ |
209 | 209 | $wgOpenIDAllowServingOpenIDUserAccounts = true; |
210 | 210 | |
211 | 211 | /** |
| 212 | + * When merging accounts with the UserMerge and Delete extension, |
| 213 | + * should OpenIDs associated to the "from" account automatically be associated |
| 214 | + * to the "to" account ? |
| 215 | + */ |
| 216 | +$wgOpenIDMergeOnAccountMerge = false; |
| 217 | + |
| 218 | +/** |
212 | 219 | * If true, will show provider icons instead of the text. |
213 | 220 | */ |
214 | 221 | $wgOpenIDShowProviderIcons = false; |
— | — | @@ -272,9 +279,11 @@ |
273 | 280 | $wgHooks['BeforePageDisplay'][] = 'OpenIDHooks::onBeforePageDisplay'; |
274 | 281 | $wgHooks['ArticleViewHeader'][] = 'OpenIDHooks::onArticleViewHeader'; |
275 | 282 | $wgHooks['SpecialPage_initList'][] = 'OpenIDHooks::onSpecialPage_initList'; |
276 | | - |
277 | 283 | $wgHooks['LoadExtensionSchemaUpdates'][] = 'OpenIDHooks::onLoadExtensionSchemaUpdates'; |
278 | 284 | |
| 285 | +$wgHooks['DeleteAccount'][] = 'OpenIDHooks::onDeleteAccount'; |
| 286 | +$wgHooks['MergeAccountFromTo'][] = 'OpenIDHooks::onMergeAccountFromTo'; |
| 287 | + |
279 | 288 | # 1.16+ |
280 | 289 | $wgHooks['GetPreferences'][] = 'OpenIDHooks::onGetPreferences'; |
281 | 290 | |
Index: trunk/extensions/OpenID/TODO |
— | — | @@ -1,4 +1,4 @@ |
2 | | -Status: 0.928-beta 20110525 |
| 2 | +Status: 0.929-beta 20110528 |
3 | 3 | |
4 | 4 | ? more details are needed to understand the "to do" |
5 | 5 | * resolved, or partially resolved, wontfix |
— | — | @@ -19,13 +19,8 @@ |
20 | 20 | $path=array( dirname( __FILE__ ) ); |
21 | 21 | set_include_path(implode(PATH_SEPARATOR,$path).PATH_SEPARATOR.get_include_path()); |
22 | 22 | in OpenID.setup.php. I don't know, if it can be avoided. |
23 | | -- allow user to set a password in case of !$wgOpenIDClientOnly && $wgOpenIDOnly |
24 | | - (https://bugzilla.wikimedia.org/show_bug.cgi?id=29027) |
25 | | - = case Server/OpenID-Only |
26 | 23 | - keep user from mailing new password in OpenID account except case S/OO |
27 | 24 | - keep user from setting password in OpenID account except case S/OO |
28 | | -- be aware of user deletions done by extension UserMerge and Delete (and others) |
29 | | - https://bugzilla.wikimedia.org/show_bug.cgi?id=28993 |
30 | 25 | - participate in account-creation throttle |
31 | 26 | - audit to prevent circumventing blocks/bans |
32 | 27 | - share timezone when/if available |
— | — | @@ -43,6 +38,12 @@ |
44 | 39 | * Configure some stuff through Special:Preferences or a dedicated control panel |
45 | 40 | (under construction, see Special:OpenIDDashboard) |
46 | 41 | |
| 42 | ++ be aware of user deletions done by extension UserMerge and Delete (and others) |
| 43 | + https://bugzilla.wikimedia.org/show_bug.cgi?id=28993 |
| 44 | ++ allow user to set or reset a password in case of |
| 45 | + !$wgOpenIDClientOnly && $wgOpenIDOnly |
| 46 | + (https://bugzilla.wikimedia.org/show_bug.cgi?id=29027) |
| 47 | + = case Server/OpenID-Only |
47 | 48 | + Execute MediaWiki hook 'AddNewAccount' when new account is added |
48 | 49 | https://bugzilla.wikimedia.org/show_bug.cgi?id=21711 |
49 | 50 | + Add a Storage class for $wgMemc |
Index: trunk/extensions/OpenID/OpenIDProvider.body.php |
— | — | @@ -46,7 +46,7 @@ |
47 | 47 | if ( $this->id == 'openid' ) { |
48 | 48 | $url = isset( $_COOKIE[$wgCookiePrefix.'OpenID'] ) ? htmlspecialchars( $_COOKIE[$wgCookiePrefix.'OpenID'] ) : ''; |
49 | 49 | $html .= '<input type="text" name="openid_url" id="openid_url" size="45" value="' . $url . '" />'; |
50 | | - $html .= Xml::submitButton( wfMsg( 'login' ) ); |
| 50 | + $html .= Xml::submitButton( wfMsg( 'userlogin' ) ); |
51 | 51 | } else { |
52 | 52 | $html .= '<input type="hidden" id="openid_provider_url_' . $this->id . '" value="' . $this->url . '" />'; |
53 | 53 | if ( strpos( $this->url, '{' ) === false ) { |
— | — | @@ -54,7 +54,7 @@ |
55 | 55 | } else { |
56 | 56 | $html .= '<input type="text" id="openid_provider_param_' . $this->id . '" size="25" value="" />'; |
57 | 57 | } |
58 | | - $html .= Xml::submitButton( wfMsg( 'login' ) ); |
| 58 | + $html .= Xml::submitButton( wfMsg( 'userlogin' ) ); |
59 | 59 | } |
60 | 60 | $html .= '</div>'; |
61 | 61 | |
Index: trunk/extensions/OpenID/OpenID.i18n.php |
— | — | @@ -107,6 +107,7 @@ |
108 | 108 | You would not able to log in without an OpenID.', |
109 | 109 | 'openiddelete-sucess' => 'The OpenID has been successfully removed from your account.', |
110 | 110 | 'openiddelete-error' => 'An error occured while removing the OpenID from your account.', |
| 111 | + 'openid-openids-were-not-merged' => 'OpenID(s) were not merged when merging the user accounts.', |
111 | 112 | |
112 | 113 | 'prefs-openid' => 'OpenID', |
113 | 114 | 'openid-prefstext' => '[http://openid.net/ OpenID] preferences', |
— | — | @@ -184,6 +185,7 @@ |
185 | 186 | 'openid-dashboard-title-admin' => 'Display name and page title for the adminstrator OpenID dashboard on Special:SpecialPages', |
186 | 187 | 'openid-dashboard-introduction' => 'Intro text for the special OpenID dashboard page: the user gets status information about the current OpenID settings of this wiki. |
187 | 188 | * $1 is the url of the help page explaining the parameters', |
| 189 | + 'openid-openids-were-not-merged' => 'When merging user accounts by UserMerge or similar extensions, OpenID(s) are not merged if $wgOpenIDMergeOnAccountMerge=false (default).', |
188 | 190 | ); |
189 | 191 | |
190 | 192 | /** Faeag Rotuma (Faeag Rotuma) |
Index: trunk/extensions/OpenID/README.OpenID-mediawiki-extension |
— | — | @@ -360,6 +360,11 @@ |
361 | 361 | exists i.e. has content. The mere existence of a user account is (currently) |
362 | 362 | not sufficient. |
363 | 363 | |
| 364 | +* $wgOpenIDMergeOnAccountMerge (default: false) |
| 365 | + When merging accounts with the UserMerge and Delete extension, |
| 366 | + should OpenIDs associated to the "from" account automatically be associated |
| 367 | + to the "to" account ? |
| 368 | + |
364 | 369 | * $wgOpenIDShowProviderIcons -- defaults to false due to potential |
365 | 370 | brand issues. With this enabled, users will see button graphics |
366 | 371 | instead of just links in OpenID provider UI. |
Index: trunk/extensions/OpenID/OpenID.hooks.php |
— | — | @@ -235,6 +235,59 @@ |
236 | 236 | } |
237 | 237 | |
238 | 238 | |
| 239 | + public static function onDeleteAccount( $userObj ) { |
| 240 | + global $wgOut; |
| 241 | + |
| 242 | + if ( is_object( $userObj ) ) { |
| 243 | + |
| 244 | + $username = $userObj->getName(); |
| 245 | + $userID = $userObj->getID(); |
| 246 | + |
| 247 | + $dbw = wfGetDB( DB_MASTER ); |
| 248 | + |
| 249 | + $dbw->delete( 'user_openid', array( 'uoi_user' => $userID ) ); |
| 250 | + $wgOut->addHTML( "OpenID " . wfMsg( 'usermerge-userdeleted', $username, $userID ) ); |
| 251 | + |
| 252 | + wfDebug( "OpenID: deleted OpenID user $username ($userID)\n" ); |
| 253 | + |
| 254 | + } |
| 255 | + |
| 256 | + return true; |
| 257 | + |
| 258 | + } |
| 259 | + |
| 260 | + public static function onMergeAccountFromTo( $fromUserObj, $toUserObj ) { |
| 261 | + global $wgOut,$wgOpenIDMergeOnAccountMerge; |
| 262 | + |
| 263 | + if ( is_object( $fromUserObj ) && is_object( $toUserObj) ) { |
| 264 | + |
| 265 | + $fromUsername = $fromUserObj->getName(); |
| 266 | + $fromUserID = $fromUserObj->getID(); |
| 267 | + $toUsername = $toUserObj->getName(); |
| 268 | + $toUserID = $toUserObj->getID(); |
| 269 | + |
| 270 | + if ( $wgOpenIDMergeOnAccountMerge ) { |
| 271 | + |
| 272 | + $dbw = wfGetDB( DB_MASTER ); |
| 273 | + |
| 274 | + $dbw->update( 'user_openid', array( 'uoi_user' => $toUserID ), array( 'uoi_user' => $fromUserID ) ); |
| 275 | + $wgOut->addHTML( "OpenID " . wfMsg('usermerge-updating', 'user_openid', $fromUsername, $toUsername ) . "<br />\n" ); |
| 276 | + |
| 277 | + wfDebug( "OpenID: transferred OpenID(s) of $fromUsername ($fromUserID) => $toUsername ($toUserID)\n" ); |
| 278 | + |
| 279 | + } else { |
| 280 | + |
| 281 | + $wgOut->addHTML( wfMsg( 'openid-openids-were-not-merged' ) . "<br />\n" ); |
| 282 | + wfDebug( "OpenID: OpenID(s) were not merged for merged users $fromUsername ($fromUserID) => $toUsername ($toUserID)\n" ); |
| 283 | + |
| 284 | + } |
| 285 | + |
| 286 | + } |
| 287 | + |
| 288 | + return true; |
| 289 | + |
| 290 | + } |
| 291 | + |
239 | 292 | # list of preferences used by extension |
240 | 293 | private static $oidPrefs = array( 'hide' ); |
241 | 294 | private static $oidUpdateOnLogin = array( 'nickname', 'email', 'fullname', |
Index: trunk/extensions/OpenID/SpecialOpenIDLogin.body.php |
— | — | @@ -334,7 +334,7 @@ |
335 | 335 | Xml::openElement( 'tr' ) . "\n" . |
336 | 336 | Xml::element( 'td', array(), '' ) . "\n" . |
337 | 337 | Xml::tags( 'td', array( 'class' => 'mw-submit' ), |
338 | | - Xml::submitButton( wfMsg( 'login' ), array( 'name' => 'wpOK' ) ) . |
| 338 | + Xml::submitButton( wfMsg( 'userlogin' ), array( 'name' => 'wpOK' ) ) . |
339 | 339 | Xml::submitButton( wfMsg( 'cancel' ), array( 'name' => 'wpCancel' ) ) |
340 | 340 | ) . "\n" . |
341 | 341 | Xml::closeElement( 'tr' ) . "\n" . |