From 8813128b44c18a6cf5dbbc2c679c3ad98c33edbf Mon Sep 17 00:00:00 2001 From: mBertholino Date: Mon, 26 Dec 2011 11:07:19 +0000 Subject: [PATCH] [-] FO : if th user doesn't have any account and he's still trying to log in, he will be redirected to the create account form --- controllers/front/AuthController.php | 10 +++++++++- themes/default/authentication.tpl | 8 ++++---- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/controllers/front/AuthController.php b/controllers/front/AuthController.php index db1ba053b..141141388 100644 --- a/controllers/front/AuthController.php +++ b/controllers/front/AuthController.php @@ -281,7 +281,15 @@ class AuthControllerCore extends FrontController { // Handle brute force attacks sleep(1); - $this->errors[] = Tools::displayError('Authentication failed'); + + if (!Customer::customerExists($email)) + { + $this->create_account = true; + $this->context->smarty->assign('email_create', Tools::safeOutput($email)); + $_POST['email'] = $email; + } + else + $this->errors[] = Tools::displayError('Authentication failed'); } else { diff --git a/themes/default/authentication.tpl b/themes/default/authentication.tpl index 019ee6617..d62a72ce2 100644 --- a/themes/default/authentication.tpl +++ b/themes/default/authentication.tpl @@ -151,7 +151,7 @@ $(function(){ldelim} } {/literal} - {if isset($authentification_error)} +

{l s='Create your account'}

@@ -362,7 +362,7 @@ $(function(){ldelim} {/if} {else} - {if isset($account_error)} +
{$HOOK_CREATE_ACCOUNT_TOP}