21 lines
680 B
PHP
Raw Normal View History

2016-08-24 15:46:06 +02:00
<?php
class ant_popovercustomerModuleFrontController extends ModuleFrontController{
public function init(){
if (Tools::getValue('ap_email') && Tools::getValue('ap_email'))
$this->_registerEmail(Tools::getValue('ap_email'));
Tools::redirect('authentication.php?create_account=1&email='.Tools::getValue('ap_email'));
}
private function _registerEmail($email){
if (!Validate::isEmail($email))
return false;
include_once _PS_MODULE_DIR_.'ant_popover/models/AntPopOverEmail.php';
if (AntPopOverEmail::getByEmail($email))
return false;
$ye = new AntPopOverEmail();
$ye->email = $email;
$ye->date_add = date('Y-m-d H:i:s');
$ye->save();
return true;
}
}