Index: trunk/extensions/CentralAuth/CentralAuthUser.php |
— | — | @@ -1464,13 +1464,6 @@ |
1465 | 1465 | |
1466 | 1466 | // Reset the auth token. |
1467 | 1467 | $this->resetAuthToken(); |
1468 | | - |
1469 | | - // Set cookies if this is the currently logged-in user |
1470 | | - global $wgUser; |
1471 | | - if ( isset( $wgUser->centralAuthObj ) && $wgUser->centralAuthObj === $this ) { |
1472 | | - $this->setGlobalCookies(); |
1473 | | - } |
1474 | | - |
1475 | 1468 | $this->invalidateCache(); |
1476 | 1469 | return true; |
1477 | 1470 | } |
Index: trunk/extensions/CentralAuth/CentralAuth.php |
— | — | @@ -54,10 +54,10 @@ |
55 | 55 | * For instance, '.wikipedia.org' to work on all wikipedia.org subdomains |
56 | 56 | * instead of just the current one. |
57 | 57 | * |
58 | | - * Leave blank to set the cookie for the current domain only, such as if |
| 58 | + * Leave false to set the cookie for the current domain only, such as if |
59 | 59 | * all your wikis are hosted on the same subdomain. |
60 | 60 | */ |
61 | | -$wgCentralAuthCookieDomain = ''; |
| 61 | +$wgCentralAuthCookieDomain = false; |
62 | 62 | |
63 | 63 | /** |
64 | 64 | * Prefix for CentralAuth global authentication cookies. |
Index: trunk/extensions/CentralAuth/CentralAuthHooks.php |
— | — | @@ -95,9 +95,7 @@ |
96 | 96 | |
97 | 97 | $centralUser = CentralAuthUser::getInstance( $user ); |
98 | 98 | |
99 | | - if ($centralUser->exists() && $centralUser->isAttached()) { |
100 | | - $centralUser->setGlobalCookies($user); |
101 | | - } else { |
| 99 | + if (!$centralUser->exists() || !$centralUser->isAttached()) { |
102 | 100 | return true; |
103 | 101 | } |
104 | 102 | |
— | — | @@ -450,14 +448,22 @@ |
451 | 449 | */ |
452 | 450 | static function onUserSetCookies( $user, &$session, &$cookies ) { |
453 | 451 | global $wgCentralAuthCookies, $wgCentralAuthCookieDomain; |
454 | | - if ( !$wgCentralAuthCookies || !$wgCentralAuthCookieDomain || $user->isAnon() ) { |
| 452 | + if ( !$wgCentralAuthCookies || $wgCentralAuthCookieDomain === false || $user->isAnon() ) { |
455 | 453 | return true; |
456 | 454 | } |
457 | 455 | $centralUser = CentralAuthUser::getInstance( $user ); |
458 | | - if ( $centralUser->isAttached() ) { |
459 | | - unset( $session['wsToken'] ); |
| 456 | + if ( !$centralUser->isAttached() ) { |
| 457 | + return true; |
| 458 | + } |
| 459 | + |
| 460 | + unset( $session['wsToken'] ); |
| 461 | + if ( !empty( $cookies['Token'] ) ) { |
460 | 462 | unset( $cookies['Token'] ); |
| 463 | + $remember = true; |
| 464 | + } else { |
| 465 | + $remember = false; |
461 | 466 | } |
| 467 | + $centralUser->setGlobalCookies( $remember ); |
462 | 468 | return true; |
463 | 469 | } |
464 | 470 | |