[-] BO : BugFix : #PSCFV-3120 : Multishop : employees without shop

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16351 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
vChabot
2012-07-11 15:40:04 +00:00
parent d6937e9d94
commit 3940cb70ce
2 changed files with 10 additions and 2 deletions
+9 -2
View File
@@ -141,11 +141,18 @@ class AdminLoginControllerCore extends AdminController
{
// Find employee
$this->context->employee = new Employee();
if (!$this->context->employee->getByemail($email, $passwd))
$is_employee_loaded = $this->context->employee->getByemail($email, $passwd);
$employee_associated_shop = $this->context->employee->getAssociatedShops();
if (!$is_employee_loaded)
{
$this->errors[] = Tools::displayError('Employee does not exist or password is incorrect.');
$this->context->employee->logout();
}
elseif (empty($employee_associated_shop) && !$this->context->employee->isSuperAdmin())
{
$this->errors[] = Tools::displayError('Employee does not manage any shop anymore (shop has been deleted or permissions have been removed).');
$this->context->employee->logout();
}
else
{
$this->context->employee->remote_addr = ip2long(Tools::getRemoteAddr());
@@ -203,7 +210,7 @@ class AdminLoginControllerCore extends AdminController
$pwd = Tools::passwdGen();
$employee->passwd = md5(pSQL(_COOKIE_KEY_.$pwd));
$employee->last_passwd_gen = date('Y-m-d H:i:s', time());
$params = array(
'{email}' => $employee->email,
'{lastname}' => $employee->lastname,