From edee6f6c2d02e2b9943d639adc445c98ca4b4dbf 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 git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@11758 b9a71923-0436-4b27-9f14-aed3839534dd --- 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}