Changed cookie name to avoid conflict with parallel b2 installations.
git-svn-id: https://develop.svn.wordpress.org/trunk@69 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
7255926c54
commit
fa071483d9
@ -20,7 +20,7 @@ if (!function_exists('_')) {
|
||||
function get_currentuserinfo() { // a bit like get_userdata(), on steroids
|
||||
global $HTTP_COOKIE_VARS,$user_login,$userdata,$user_level,$user_ID,$user_nickname,$user_email,$user_url,$user_pass_md5;
|
||||
// *** retrieving user's data from cookies and db - no spoofing
|
||||
$user_login = $HTTP_COOKIE_VARS["cafeloguser"];
|
||||
$user_login = $HTTP_COOKIE_VARS["wordpressuser"];
|
||||
$userdata = get_userdatabylogin($user_login);
|
||||
$user_level = $userdata["user_level"];
|
||||
$user_ID=$userdata['ID'];
|
||||
|
@ -11,9 +11,9 @@ function veriflog() {
|
||||
global $HTTP_COOKIE_VARS;
|
||||
global $tableusers,$tablesettings,$tablecategories,$tableposts,$tablecomments;
|
||||
|
||||
if (!empty($HTTP_COOKIE_VARS["cafeloguser"])) {
|
||||
$user_login = $HTTP_COOKIE_VARS["cafeloguser"];
|
||||
$user_pass_md5 = $HTTP_COOKIE_VARS["cafelogpass"];
|
||||
if (!empty($HTTP_COOKIE_VARS["wordpressuser"])) {
|
||||
$user_login = $HTTP_COOKIE_VARS["wordpressuser"];
|
||||
$user_pass_md5 = $HTTP_COOKIE_VARS["wordpresspass"];
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
@ -45,7 +45,7 @@ function veriflog() {
|
||||
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
|
||||
header("Cache-Control: no-cache, must-revalidate");
|
||||
header("Pragma: no-cache");
|
||||
if (!empty($HTTP_COOKIE_VARS["cafeloguser"])) {
|
||||
if (!empty($HTTP_COOKIE_VARS["wordpressuser"])) {
|
||||
$error="<b>Error</b>: wrong login or password";
|
||||
}
|
||||
include("b2login.php");
|
||||
|
22
b2login.php
22
b2login.php
@ -49,8 +49,8 @@ switch($action) {
|
||||
|
||||
case "logout":
|
||||
|
||||
setcookie("cafeloguser");
|
||||
setcookie("cafelogpass");
|
||||
setcookie("wordpressuser");
|
||||
setcookie("wordpresspass");
|
||||
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
|
||||
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
|
||||
header("Cache-Control: no-cache, must-revalidate"); // for HTTP/1.1
|
||||
@ -130,14 +130,14 @@ case "login":
|
||||
} else {
|
||||
$user_login=$log;
|
||||
$user_pass=$pwd;
|
||||
setcookie("cafeloguser",$user_login,time()+31536000);
|
||||
setcookie("wordpressuser",$user_login,time()+31536000);
|
||||
if ($pass_is_md5) {
|
||||
setcookie("cafelogpass",$user_pass,time()+31536000);
|
||||
setcookie("wordpresspass",$user_pass,time()+31536000);
|
||||
} else {
|
||||
setcookie("cafelogpass",md5($user_pass),time()+31536000);
|
||||
setcookie("wordpresspass",md5($user_pass),time()+31536000);
|
||||
}
|
||||
if (empty($HTTP_COOKIE_VARS["cafelogblogid"])) {
|
||||
setcookie("cafelogblogid","1",time()+31536000);
|
||||
if (empty($HTTP_COOKIE_VARS["wordpressblogid"])) {
|
||||
setcookie("wordpressblogid","1",time()+31536000);
|
||||
}
|
||||
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
|
||||
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
|
||||
@ -254,9 +254,9 @@ break;
|
||||
|
||||
default:
|
||||
|
||||
if((!empty($HTTP_COOKIE_VARS["cafeloguser"])) && (!empty($HTTP_COOKIE_VARS["cafelogpass"]))) {
|
||||
$user_login = $HTTP_COOKIE_VARS["cafeloguser"];
|
||||
$user_pass_md5 = $HTTP_COOKIE_VARS["cafelogpass"];
|
||||
if((!empty($HTTP_COOKIE_VARS["wordpressuser"])) && (!empty($HTTP_COOKIE_VARS["wordpresspass"]))) {
|
||||
$user_login = $HTTP_COOKIE_VARS["wordpressuser"];
|
||||
$user_pass_md5 = $HTTP_COOKIE_VARS["wordpresspass"];
|
||||
}
|
||||
|
||||
function checklogin() {
|
||||
@ -273,7 +273,7 @@ default:
|
||||
}
|
||||
|
||||
if ( !(checklogin()) ) {
|
||||
if (!empty($HTTP_COOKIE_VARS["cafeloguser"])) {
|
||||
if (!empty($HTTP_COOKIE_VARS["wordpressuser"])) {
|
||||
$error="Error: wrong login/password"; //, or your session has expired.";
|
||||
}
|
||||
} else {
|
||||
|
@ -81,7 +81,7 @@ case "update":
|
||||
die ("<strong>ERROR</strong>: you typed two different passwords. Go back to correct that.");
|
||||
$newuser_pass = $HTTP_POST_VARS["pass1"];
|
||||
$updatepassword = "user_pass='$newuser_pass', ";
|
||||
setcookie("cafelogpass",md5($newuser_pass),time()+31536000);
|
||||
setcookie("wordpresspass",md5($newuser_pass),time()+31536000);
|
||||
}
|
||||
|
||||
$newuser_firstname=addslashes($HTTP_POST_VARS["newuser_firstname"]);
|
||||
@ -120,7 +120,7 @@ case "viewprofile":
|
||||
get_currentuserinfo();
|
||||
|
||||
*/ $profiledata=get_userdata($user);
|
||||
if ($HTTP_COOKIE_VARS["cafeloguser"] == $profiledata["user_login"])
|
||||
if ($HTTP_COOKIE_VARS["wordpressuser"] == $profiledata["user_login"])
|
||||
header ("Location: b2profile.php");
|
||||
|
||||
$profile=1; /**/
|
||||
|
Loading…
Reference in New Issue
Block a user