// Fix Bug on admin login - errors messages was twice printed

This commit is contained in:
mDeflotte
2012-02-03 08:15:21 +00:00
parent 61bf599496
commit 0adca03b0c
2 changed files with 6 additions and 5 deletions
+3 -3
View File
@@ -29,19 +29,19 @@
{$conf}
</div>
{/if}
{if count($errors)} {* @todo what is ??? AND $this->_includeContainer *}
{if count($errors) && (!isset($disableDefaultErrorOutPut) || $disableDefaultErrorOutPut == false)} {* @todo what is ??? AND $this->_includeContainer *}
<div class="error">
<span style="float:right">
<a id="hideError" href="#"><img alt="X" src="../img/admin/close.png" /></a>
</span>
{if count($errors) == 1}
{$errors[0]}
{else}
{$errors|count} {l s='errors'}
<br/>
<ol>
{foreach $errors AS $error}
{foreach $errors as $error}
<li>{$error}</li>
{/foreach}
</ol>
+3 -2
View File
@@ -59,7 +59,7 @@ class AdminLoginControllerCore extends AdminController
$clientIsMaintenanceOrLocal = in_array(Tools::getRemoteAddr(), array_merge(array('127.0.0.1'), explode(',', Configuration::get('PS_MAINTENANCE_IP'))));
// If ssl is enabled, https protocol is required. Exception for maintenance and local (127.0.0.1) IP
if ($clientIsMaintenanceOrLocal)
$this->errors = Tools::displayError('SSL is activated. However, your IP is allowed to use unsecure mode (Maintenance or local IP).');
$this->errors[] = Tools::displayError('SSL is activated. However, your IP is allowed to use unsecure mode (Maintenance or local IP).');
else
{
$warningSslMessage = Tools::displayError('SSL is activated. Please connect using the following url to log in in secure mode (https).');
@@ -83,7 +83,8 @@ class AdminLoginControllerCore extends AdminController
array(
'errors' => $this->errors,
'nbErrors' => $nbErrors,
'shop_name' => Tools::safeOutput(Configuration::get('PS_SHOP_NAME'))
'shop_name' => Tools::safeOutput(Configuration::get('PS_SHOP_NAME')),
'disableDefaultErrorOutPut' => true,
)
);
$this->setMedia();