From fed5d1c6143731d8e82f5df4dee143bf3c261d24 Mon Sep 17 00:00:00 2001 From: mDeflotte Date: Wed, 25 Jul 2012 15:30:47 +0000 Subject: [PATCH] [-] FO : #PSCFV-3242 - Add PS version in cookie hach name --- classes/Cookie.php | 12 ++++++------ controllers/admin/AdminLoginController.php | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/classes/Cookie.php b/classes/Cookie.php index 4fc5c5f73..74257d5d1 100644 --- a/classes/Cookie.php +++ b/classes/Cookie.php @@ -63,7 +63,7 @@ class CookieCore { $this->_content = array(); $this->_expire = isset($expire) ? (int)($expire) : (time() + 1728000); - $this->_name = md5($name); + $this->_name = md5(_PS_VERSION_.$name); $this->_path = trim(Context::getContext()->shop->physical_uri.$path, '/\\').'/'; if ($this->_path{0} != '/') $this->_path = '/'.$this->_path; $this->_path = rawurlencode($this->_path); @@ -273,8 +273,8 @@ class CookieCore { $tmpTab2 = explode('|', $keyAndValue); if (count($tmpTab2) == 2) - $this->_content[$tmpTab2[0]] = $tmpTab2[1]; - } + $this->_content[$tmpTab2[0]] = $tmpTab2[1]; + } /* Blowfish fix */ if (isset($this->_content['checksum'])) $this->_content['checksum'] = (int)($this->_content['checksum']); @@ -309,7 +309,7 @@ class CookieCore else { $content = 0; - $time = time() - 1; + $time = 1; } if (PHP_VERSION_ID <= 50200) /* PHP version > 5.2.0 */ return setcookie($this->_name, $content, $time, $this->_path, $this->_domain, 0); @@ -318,8 +318,8 @@ class CookieCore } /** - * Save cookie with setcookie() - */ + * Save cookie with setcookie() + */ public function write() { $cookie = ''; diff --git a/controllers/admin/AdminLoginController.php b/controllers/admin/AdminLoginController.php index 0b7a8f585..51f61e172 100755 --- a/controllers/admin/AdminLoginController.php +++ b/controllers/admin/AdminLoginController.php @@ -139,7 +139,7 @@ class AdminLoginControllerCore extends AdminController if (!count($this->errors)) { - // Find employee + // Find employee $this->context->employee = new Employee(); $is_employee_loaded = $this->context->employee->getByemail($email, $passwd); $employee_associated_shop = $this->context->employee->getAssociatedShops(); @@ -156,7 +156,7 @@ class AdminLoginControllerCore extends AdminController else { $this->context->employee->remote_addr = ip2long(Tools::getRemoteAddr()); - // Update cookie + // Update cookie $cookie = Context::getContext()->cookie; $cookie->id_employee = $this->context->employee->id; $cookie->email = $this->context->employee->email;