Index: trunk/extensions/OpenID/SpecialOpenIDLogin.body.php |
— | — | @@ -266,11 +266,6 @@ |
267 | 267 | ); |
268 | 268 | } |
269 | 269 | |
270 | | - function loginSetCookie( $openid ) { |
271 | | - global $wgRequest, $wgOpenIDCookieExpiration; |
272 | | - $wgRequest->response()->setcookie( 'OpenID', $openid, time() + $wgOpenIDCookieExpiration ); |
273 | | - } |
274 | | - |
275 | 270 | /** |
276 | 271 | * Handle "Choose name" form submission |
277 | 272 | */ |
Index: trunk/extensions/OpenID/SpecialOpenID.body.php |
— | — | @@ -281,6 +281,11 @@ |
282 | 282 | } |
283 | 283 | } |
284 | 284 | |
| 285 | + function loginSetCookie( $openid ) { |
| 286 | + global $wgRequest, $wgOpenIDCookieExpiration; |
| 287 | + $wgRequest->response()->setcookie( 'OpenID', $openid, time() + $wgOpenIDCookieExpiration ); |
| 288 | + } |
| 289 | + |
285 | 290 | # Find the user with the given openid, if any |
286 | 291 | public static function getUserUrl( $user ) { |
287 | 292 | $openid_urls = array(); |
Index: trunk/extensions/OpenID/SpecialOpenIDConvert.body.php |
— | — | @@ -237,6 +237,8 @@ |
238 | 238 | |
239 | 239 | self::addUserUrl( $wgUser, $openid_url ); |
240 | 240 | |
| 241 | + $this->loginSetCookie( $openid_url ); |
| 242 | + |
241 | 243 | $wgOut->setPageTitle( wfMsg( 'openidconvertsuccess' ) ); |
242 | 244 | $wgOut->setRobotPolicy( 'noindex,nofollow' ); |
243 | 245 | $wgOut->setArticleRelated( false ); |
Index: trunk/extensions/OpenID/OpenIDProvider.body.php |
— | — | @@ -37,13 +37,16 @@ |
38 | 38 | function getSmallButtonHTML() { return $this->getButtonHTML( false ); } |
39 | 39 | |
40 | 40 | function getLoginFormHTML() { |
| 41 | + global $wgCookiePrefix; |
| 42 | + |
41 | 43 | $html = '<div id="provider_form_' . $this->id . '"' . |
42 | 44 | ( $this->id == 'openid' ? '' : ' style="display:none"' ) . '>' . |
43 | 45 | '<div><label for="openid_url">' . $this->label . '</label></div>'; |
44 | 46 | |
45 | 47 | if ( $this->id == 'openid' ) { |
46 | | - $html .= '<input type="text" name="openid_url" id="openid_url" size="45" value="" />'; |
47 | | - $html .= '<input type="submit" value="' . wfMsg( 'login' ) . '"/>'; |
| 48 | + $url = isset( $_COOKIE[$wgCookiePrefix.'OpenID'] ) ? htmlspecialchars( $_COOKIE[$wgCookiePrefix.'OpenID'] ) : ''; |
| 49 | + $html .= '<input type="text" name="openid_url" id="openid_url" size="45" value="' . $url . '" />'; |
| 50 | + $html .= Xml::submitButton( wfMsg( 'login' ) ); |
48 | 51 | } else { |
49 | 52 | $html .= '<input type="hidden" id="openid_provider_url_' . $this->id . '" value="' . $this->url . '" />'; |
50 | 53 | if ( strpos( $this->url, '{' ) === false ) { |
— | — | @@ -51,7 +54,7 @@ |
52 | 55 | } else { |
53 | 56 | $html .= '<input type="text" id="openid_provider_param_' . $this->id . '" size="25" value="" />'; |
54 | 57 | } |
55 | | - $html .= '<input type="submit" value="' . wfMsg( 'login' ) . '"/>'; |
| 58 | + $html .= Xml::submitButton( wfMsg( 'login' ) ); |
56 | 59 | } |
57 | 60 | $html .= '</div>'; |
58 | 61 | |