From: Bryan Tong Minh Date: Thu, 29 May 2008 18:57:06 +0000 (+0000) Subject: (bug 14335) Use proper $wgUser methods instead of using $_SESSION X-Git-Tag: 1.31.0-rc.0~47299 X-Git-Url: http://git.cyclocoop.org/data/Luca_Pacioli_%28Gemaelde%29.jpeg?a=commitdiff_plain;h=cf40d9023da5b3dbdf1d4b9c833ae0e0c2cff84f;p=lhc%2Fweb%2Fwiklou.git (bug 14335) Use proper $wgUser methods instead of using $_SESSION --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 9355d36c18..877a195470 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -383,6 +383,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * (bug 14243) Only accept post requests in action=edit; patch by HardDisk * action=block now returns an ISO8601 timestamp, like all other modules do * Added md5 parameter to action=edit +* (bug 14335) Use proper $wgUser methods instead of using $_SESSION === Languages updated in 1.13 === diff --git a/includes/User.php b/includes/User.php index 77dce0b7c1..5a36eea029 100644 --- a/includes/User.php +++ b/includes/User.php @@ -1578,6 +1578,12 @@ class User { $this->mNewpassword = ''; $this->mNewpassTime = null; } + + function getToken() { + $this->load(); + return $this->mToken; + } + /** * Set the random token (used for persistent authentication) * Called from loadDefaults() among other places. diff --git a/includes/api/ApiLogin.php b/includes/api/ApiLogin.php index 0b216000a3..525ec2d9e7 100644 --- a/includes/api/ApiLogin.php +++ b/includes/api/ApiLogin.php @@ -105,9 +105,9 @@ class ApiLogin extends ApiBase { $wgUser->setCookies(); $result['result'] = 'Success'; - $result['lguserid'] = $_SESSION['wsUserID']; - $result['lgusername'] = $_SESSION['wsUserName']; - $result['lgtoken'] = $_SESSION['wsToken']; + $result['lguserid'] = $wgUser->getId(); + $result['lgusername'] = $wgUser->getName(); + $result['lgtoken'] = $wgUser->getToken(); $result['cookieprefix'] = $wgCookiePrefix; $result['sessionid'] = session_id(); break;