bebeboutik/override/controllers/IndexController.php
Srv Bebeboutik 340bc7c146 push site
2016-01-04 12:48:08 +01:00

35 lines
849 B
PHP
Executable File

<?php
class IndexController extends IndexControllerCore
{
public function displayContent() {
global $cookie;
if(!$cookie->isLogged()
&& Tools::getValue('validation') == 1 ) {
Tools::redirect();
}
if($cookie->isLogged()
&& Tools::getValue('validation') == 1 ) {
$sponsor = Db::getInstance()->ExecuteS('
SELECT *
FROM `'._DB_PREFIX_.'invite`
WHERE `id_customer` = '.(int) $cookie->id_customer
);
if(count($sponsor) > 0) {
$s = new Customer($sponsor[0]['id_sponsor']);
self::$smarty->assign(array('email_sponsor' => $s->email));
}
self::$smarty->assign(array(
'email_customer' => $cookie->email,
'id_customer' => (int) $cookie->id_customer,
'HOOK_ACCOUNT_VALIDATION' => Module::hookExec('accountValidation', array('sponsor' => $s)),
));
}
parent::displayContent();
}
}