Save password cookie fixes
authorBrion Vibber <brion@users.mediawiki.org>
Wed, 10 Mar 2004 05:21:58 +0000 (05:21 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Wed, 10 Mar 2004 05:21:58 +0000 (05:21 +0000)
includes/DefaultSettings.php
includes/Setup.php
includes/User.php

index 60a17a1..fc1aff1 100644 (file)
@@ -252,7 +252,7 @@ $wgSiteNotice = "";
 
 $wgAllowAnonymousMinor = false;
 
-# Enable experimental smarty skins (put Smart/libs in your include_path!)
+# Enable experimental smarty skins (put Smarty/libs in your include_path!)
 $wgUseSmarty = false;
 
 if( !isset( $wgCommandLineMode ) ) {
index d7fc9da..8a190e8 100644 (file)
@@ -158,7 +158,7 @@ if ( $wgUseDynamicDates ) {
        $wgDateFormatter = new DateFormatter;
 }
 
-if( !$wgCommandLineMode && isset( $_COOKIE[ini_get("session.name")] )  ) {
+if( !$wgCommandLineMode && ( isset( $_COOKIE[ini_get("session.name")] ) || isset( $_COOKIE["{$wgDBname}Password"] ) ) ) {
        User::SetupSession();
 }
 
index f157b5c..7024b98 100644 (file)
@@ -164,8 +164,8 @@ class User {
                }
                if ( isset( $_SESSION['wsUserName'] ) ) {
                        $sName = $_SESSION['wsUserName'];
-               } else if ( isset( $HTTP_COOKIE_VARS["{$wgDBname}UserName"] ) ) {
-                       $sName = $HTTP_COOKIE_VARS["{$wgDBname}UserName"];
+               } else if ( isset( $_COOKIE["{$wgDBname}UserName"] ) ) {
+                       $sName = $_COOKIE["{$wgDBname}UserName"];
                        $_SESSION['wsUserName'] = $sName;
                } else {
                        return new User();
@@ -184,8 +184,8 @@ class User {
 
                if ( isset( $_SESSION['wsUserPassword'] ) ) {
                        $passwordCorrect = $_SESSION['wsUserPassword'] == $user->mPassword;
-               } else if ( isset( $HTTP_COOKIE_VARS["{$wgDBname}Password"] ) ) {
-                       $user->mCookiePassword = $HTTP_COOKIE_VARS["{$wgDBname}Password"];
+               } else if ( isset( $_COOKIE["{$wgDBname}Password"] ) ) {
+                       $user->mCookiePassword = $_COOKIE["{$wgDBname}Password"];
                        $_SESSION['wsUserPassword'] = $user->addSalt( $user->mCookiePassword );
                        $passwordCorrect = $_SESSION['wsUserPassword'] == $user->mPassword;
                } else {