Merge branch 'release' of https://github.com/PrestaShop/PrestaShop into release

This commit is contained in:
gRoussac committed 2013-08-07 15:06:50 +02:00
commit 5df213f5ae
2 files changed
+11 -1

No files matched your search

+1 -1
View File
@@ -248,7 +248,7 @@ class EmployeeCore extends ObjectModel
{ {
/* Employee is valid only if it can be load and if cookie password is the same as database one */ /* Employee is valid only if it can be load and if cookie password is the same as database one */
Cache::store('isLoggedBack'.$this->id, ( Cache::store('isLoggedBack'.$this->id, (
$this->id && Validate::isUnsignedId($this->id) && Employee::checkPassword($this->id, $this->passwd) $this->id && Validate::isUnsignedId($this->id) && Employee::checkPassword($this->id, Context::getContext()->cookie->passwd)
&& (!isset($this->remote_addr) || $this->remote_addr == ip2long(Tools::getRemoteAddr()) || !Configuration::get('PS_COOKIE_CHECKIP')) && (!isset($this->remote_addr) || $this->remote_addr == ip2long(Tools::getRemoteAddr()) || !Configuration::get('PS_COOKIE_CHECKIP'))
)); ));
} }
@@ -463,6 +463,16 @@ class AdminEmployeesControllerCore extends AdminController
return parent::initContent(); return parent::initContent();
} }
protected function afterUpdate($object)
{
$res = parent::afterUpdate($object);
// Update cookie if needed
if (Tools::getValue('id_employee') == $this->context->employee->id && Tools::getValue('passwd') && $object->passwd != $this->context->employee->passwd)
$this->context->cookie->passwd = $this->context->employee->passwd = $object->passwd;
return $res;
}
public function ajaxProcessGetTabByIdProfile() public function ajaxProcessGetTabByIdProfile()
{ {
$id_profile = Tools::getValue('id_profile'); $id_profile = Tools::getValue('id_profile');