From 93d5016848b5f0489fcac4cfe131f50ca5071189 Mon Sep 17 00:00:00 2001 From: Gregory Roussac Date: Mon, 29 Apr 2013 21:54:26 +0200 Subject: [PATCH] [-] Bo : Admin login loop under Firefox --- classes/controller/AdminController.php | 4 +++- js/login.js | 7 +++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/classes/controller/AdminController.php b/classes/controller/AdminController.php index 87f4d5ea7..b66e31688 100644 --- a/classes/controller/AdminController.php +++ b/classes/controller/AdminController.php @@ -1760,7 +1760,9 @@ class AdminControllerCore extends Controller $this->context->employee->logout(); if ($this->controller_name != 'AdminLogin' && (!isset($this->context->employee) || !$this->context->employee->isLoggedBack())) - Tools::redirectAdmin($this->context->link->getAdminLink('AdminLogin').(!isset($_GET['logout']) ? '&redirect='.$this->controller_name : '')); + { + Tools::redirectAdmin($this->context->link->getAdminLink('AdminLogin').((!isset($_GET['logout']) && $this->controller_name != 'AdminNotFound') ? '&redirect='.$this->controller_name : '')); + } // Set current index $current_index = 'index.php'.(($controller = Tools::getValue('controller')) ? '?controller='.$controller : ''); diff --git a/js/login.js b/js/login.js index 934e44261..0ca9bf5b1 100644 --- a/js/login.js +++ b/js/login.js @@ -75,11 +75,10 @@ function doAjaxLogin(redirect) { redirect: redirect }, success: function(jsonData) { - if (jsonData.hasErrors) { + if (jsonData.hasErrors) displayErrors(jsonData.errors); - } else { - window.location.href = jsonData.redirect; - } + else + window.location.assign(jsonData.redirect); }, error: function(XMLHttpRequest, textStatus, errorThrown) { $('#error').html('

TECHNICAL ERROR:

Details: Error thrown: ' + XMLHttpRequest + '

Text status: ' + textStatus + '

').show();