http://www.mediawiki.org/wiki/Special:Code/MediaWiki/56273
Revision: 56273
Author: happy-melon
Date: 2009-09-13 17:35:53 +0000 (Sun, 13 Sep 2009)
Log Message:
-----------
I *finally* found the cookie-loop bug... :D
Modified Paths:
--------------
branches/happy-melon/phase3/includes/Login.php
branches/happy-melon/phase3/includes/specials/SpecialUserlogin.php
Modified: branches/happy-melon/phase3/includes/Login.php
===================================================================
--- branches/happy-melon/phase3/includes/Login.php 2009-09-13 17:12:32 UTC
(rev 56272)
+++ branches/happy-melon/phase3/includes/Login.php 2009-09-13 17:35:53 UTC
(rev 56273)
@@ -94,7 +94,6 @@
* @return a Login class constant representing the status.
*/
public function attemptLogin(){
- global $wgUser;
$code = $this->authenticateUserData();
if( $code != self::SUCCESS ){
@@ -102,12 +101,15 @@
}
# Log the user in and remember them if they asked for that.
+ global $wgUser;
+ $wgUser = $this->mUser;
if( (bool)$this->mRemember != (bool)$wgUser->getOption(
'rememberpassword' ) ) {
$wgUser->setOption( 'rememberpassword',
$this->mRemember ? 1 : 0 );
$wgUser->saveSettings();
} else {
$wgUser->invalidateCache();
}
+
$wgUser->setCookies();
# Reset the password throttle
Modified: branches/happy-melon/phase3/includes/specials/SpecialUserlogin.php
===================================================================
--- branches/happy-melon/phase3/includes/specials/SpecialUserlogin.php
2009-09-13 17:12:32 UTC (rev 56272)
+++ branches/happy-melon/phase3/includes/specials/SpecialUserlogin.php
2009-09-13 17:35:53 UTC (rev 56273)
@@ -60,6 +60,13 @@
return;
}
+ # Because we're transitioning from logged-out, who might not
+ # have a session, to logged-in, who always do, we need to make
+ # sure that we *always* have a session...
+ if( session_id() == '' ) {
+ wfSetupSession();
+ }
+
$this->loadQuery();
$this->mLogin = new Login();
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs