From 623ca89c8bf25f608d3e112b6c677915e6db6800 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Wed, 10 Mar 2004 05:21:58 +0000 Subject: [PATCH] Save password cookie fixes --- includes/DefaultSettings.php | 2 +- includes/Setup.php | 2 +- includes/User.php | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 60a17a19cf..fc1aff1a88 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -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 ) ) { diff --git a/includes/Setup.php b/includes/Setup.php index d7fc9da2cf..8a190e8846 100644 --- a/includes/Setup.php +++ b/includes/Setup.php @@ -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(); } diff --git a/includes/User.php b/includes/User.php index f157b5cb95..7024b983b3 100644 --- a/includes/User.php +++ b/includes/User.php @@ -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 { -- 2.20.1