// Fix ajax create account

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@10631 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
rGaillard
2011-11-23 22:52:34 +00:00
parent c3e7c28220
commit ffc24ed10b
+17 -18
View File
@@ -123,6 +123,23 @@ class AuthControllerCore extends FrontController
'HOOK_CREATE_ACCOUNT_FORM' => Hook::exec('createAccountForm'),
'HOOK_CREATE_ACCOUNT_TOP' => Hook::exec('createAccountTop')
));
if ($this->ajax)
{
// Call a hook to display more information on form
$this->context->smarty->assign(array(
'PS_REGISTRATION_PROCESS_TYPE' => Configuration::get('PS_REGISTRATION_PROCESS_TYPE'),
'genders' => Gender::getGenders()
));
$return = array(
'hasError' => !empty($this->errors),
'errors' => $this->errors,
'page' => $this->context->smarty->fetch(_PS_THEME_DIR_.'authentication.tpl'),
'token' => Tools::getToken(false)
);
die(Tools::jsonEncode($return));
}
$this->setTemplate(_PS_THEME_DIR_.'authentication.tpl');
}
@@ -573,24 +590,6 @@ class AuthControllerCore extends FrontController
$this->context->smarty->assign('email_create', Tools::safeOutput($email));
$_POST['email'] = $email;
}
if ($this->ajax)
{
// Call a hook to display more information on form
$this->context->smarty->assign(array(
'HOOK_CREATE_ACCOUNT_FORM' => Hook::exec('createAccountForm'),
'HOOK_CREATE_ACCOUNT_TOP' => Hook::exec('createAccountTop'),
'PS_REGISTRATION_PROCESS_TYPE' => Configuration::get('PS_REGISTRATION_PROCESS_TYPE'),
'genders' => Gender::getGenders()
));
$return = array(
'hasError' => !empty($this->errors),
'errors' => $this->errors,
'page' => $this->context->smarty->fetch(_PS_THEME_DIR_.'authentication.tpl'),
'token' => Tools::getToken(false)
);
die(Tools::jsonEncode($return));
}
}
/**