[-] MO : #PSTEST-303 - Fixed problems using deprecated methods
// Change baseDir vars to use the current domain // Change css rules
This commit is contained in:
@@ -232,15 +232,19 @@ class FrontControllerCore extends Controller
|
||||
setlocale(LC_NUMERIC, 'en_US.UTF-8');
|
||||
|
||||
/* get page name to display it in body id */
|
||||
// @todo check here
|
||||
$page_name = Dispatcher::getInstance()->getController();
|
||||
$page_name = (preg_match('/^[0-9]/', $page_name)) ? 'page_'.$page_name : $page_name;
|
||||
|
||||
// Are we in a module ?
|
||||
if (preg_match('#^'.preg_quote($this->context->shop->getPhysicalURI(), '#').'modules/([a-zA-Z0-9_-]+?)/(.*)$#', $_SERVER['REQUEST_URI'], $m))
|
||||
|
||||
// Are we in a payment module
|
||||
$module_name = Tools::getValue('module');
|
||||
if (Tools::getValue('controller') == 'module' && $module_name != '' && new $module_name() instanceof PaymentModule)
|
||||
$page_name = 'module-payment-submit';
|
||||
// Are we in a module
|
||||
else if (preg_match('#^'.preg_quote($this->context->shop->getPhysicalURI(), '#').'modules/([a-zA-Z0-9_-]+?)/(.*)$#', $_SERVER['REQUEST_URI'], $m))
|
||||
$page_name = 'module-'.$m[1].'-'.str_replace(array('.php', '/'), array('', '-'), $m[2]);
|
||||
if (Tools::getValue('controller') == 'module' && Tools::getValue('module') != '')
|
||||
$page_name = 'module-paypal-payment-submit';
|
||||
else
|
||||
{
|
||||
$page_name = Dispatcher::getInstance()->getController();
|
||||
$page_name = (preg_match('/^[0-9]/', $page_name)) ? 'page_'.$page_name : $page_name;
|
||||
}
|
||||
|
||||
$this->context->smarty->assign(Tools::getMetaTags($this->context->language->id, $page_name));
|
||||
$this->context->smarty->assign('request_uri', Tools::safeOutput(urldecode($_SERVER['REQUEST_URI'])));
|
||||
@@ -272,7 +276,7 @@ class FrontControllerCore extends Controller
|
||||
'page_name' => $page_name,
|
||||
'base_dir' => _PS_BASE_URL_.__PS_BASE_URI__,
|
||||
'base_dir_ssl' => $protocol_link.Tools::getShopDomainSsl().__PS_BASE_URI__,
|
||||
'content_dir' => $protocol_content.(($useSSL)?Tools::getShopDomainSsl():Tools::getShopDomain()).__PS_BASE_URI__,
|
||||
'content_dir' => $protocol_content.Tools::getServerName().__PS_BASE_URI__,
|
||||
'tpl_dir' => _PS_THEME_DIR_,
|
||||
'modules_dir' => _MODULE_DIR_,
|
||||
'mail_dir' => _MAIL_DIR_,
|
||||
|
||||
@@ -30,21 +30,21 @@ if (!defined('_PS_VERSION_'))
|
||||
|
||||
class Blocknewsletter extends Module
|
||||
{
|
||||
const GUEST_NOT_REGISTERED = -1;
|
||||
const CUSTOMER_NOT_REGISTERED = 0;
|
||||
const GUEST_REGISTERED = 1;
|
||||
const CUSTOMER_REGISTERED = 2;
|
||||
const GUEST_NOT_REGISTERED = -1;
|
||||
const CUSTOMER_NOT_REGISTERED = 0;
|
||||
const GUEST_REGISTERED = 1;
|
||||
const CUSTOMER_REGISTERED = 2;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->name = 'blocknewsletter';
|
||||
$this->tab = 'front_office_features';
|
||||
public function __construct()
|
||||
{
|
||||
$this->name = 'blocknewsletter';
|
||||
$this->tab = 'front_office_features';
|
||||
$this->need_instance = 0;
|
||||
|
||||
parent::__construct();
|
||||
parent::__construct();
|
||||
|
||||
$this->displayName = $this->l('Newsletter block');
|
||||
$this->description = $this->l('Adds a block for newsletter subscription.');
|
||||
$this->displayName = $this->l('Newsletter block');
|
||||
$this->description = $this->l('Adds a block for newsletter subscription.');
|
||||
$this->confirmUninstall = $this->l('Are you sure you want to delete all your contacts ?');
|
||||
|
||||
$this->version = '1.4';
|
||||
@@ -58,20 +58,20 @@ class Blocknewsletter extends Module
|
||||
1 => 'txt'
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
public function install()
|
||||
{
|
||||
if (parent::install() == false OR $this->registerHook('leftColumn') == false OR $this->registerHook('header') == false)
|
||||
return false;
|
||||
public function install()
|
||||
{
|
||||
if (parent::install() == false OR $this->registerHook('leftColumn') == false OR $this->registerHook('header') == false)
|
||||
return false;
|
||||
|
||||
Configuration::updateValue('NW_SALT', Tools::passwdGen(16));
|
||||
Configuration::updateValue('NW_SALT', Tools::passwdGen(16));
|
||||
|
||||
return Db::getInstance()->execute('
|
||||
return Db::getInstance()->execute('
|
||||
CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'newsletter` (
|
||||
`id` int(6) NOT NULL AUTO_INCREMENT,
|
||||
`id_shop` INTEGER UNSIGNED NOT NULL DEFAULT \'1\',
|
||||
`id_group_shop` INTEGER UNSIGNED NOT NULL DEFAULT \'1\',
|
||||
`id_group_shop` INTEGER UNSIGNED NOT NULL DEFAULT \'1\',
|
||||
`email` varchar(255) NOT NULL,
|
||||
`newsletter_date_add` DATETIME NULL,
|
||||
`ip_registration_newsletter` varchar(15) NOT NULL,
|
||||
@@ -79,14 +79,14 @@ class Blocknewsletter extends Module
|
||||
`active` TINYINT(1) NOT NULL DEFAULT \'0\',
|
||||
PRIMARY KEY(`id`)
|
||||
) ENGINE='._MYSQL_ENGINE_.' default CHARSET=utf8');
|
||||
}
|
||||
}
|
||||
|
||||
public function uninstall()
|
||||
{
|
||||
if (!parent::uninstall())
|
||||
return false;
|
||||
return Db::getInstance()->execute('DROP TABLE '._DB_PREFIX_.'newsletter');
|
||||
}
|
||||
public function uninstall()
|
||||
{
|
||||
if (!parent::uninstall())
|
||||
return false;
|
||||
return Db::getInstance()->execute('DROP TABLE '._DB_PREFIX_.'newsletter');
|
||||
}
|
||||
|
||||
public function getContent()
|
||||
{
|
||||
@@ -159,19 +159,19 @@ class Blocknewsletter extends Module
|
||||
* 1 = registered in block
|
||||
* 2 = registered in customer
|
||||
*/
|
||||
private function isNewsletterRegistered($customerEmail)
|
||||
{
|
||||
$sql = 'SELECT `email`
|
||||
FROM '._DB_PREFIX_.'newsletter
|
||||
WHERE `email` = \''.pSQL($customerEmail).'\'
|
||||
AND id_shop = '.$this->context->shop->getID(true);
|
||||
private function isNewsletterRegistered($customerEmail)
|
||||
{
|
||||
$sql = 'SELECT `email`
|
||||
FROM '._DB_PREFIX_.'newsletter
|
||||
WHERE `email` = \''.pSQL($customerEmail).'\'
|
||||
AND id_shop = '.$this->context->shop->getID(true);
|
||||
|
||||
if (Db::getInstance()->getRow($sql))
|
||||
return self::GUEST_REGISTERED;
|
||||
if (Db::getInstance()->getRow($sql))
|
||||
return self::GUEST_REGISTERED;
|
||||
|
||||
$sql = 'SELECT `newsletter`
|
||||
FROM '._DB_PREFIX_.'customer
|
||||
WHERE `email` = \''.pSQL($customerEmail).'\'
|
||||
$sql = 'SELECT `newsletter`
|
||||
FROM '._DB_PREFIX_.'customer
|
||||
WHERE `email` = \''.pSQL($customerEmail).'\'
|
||||
AND id_shop = '.$this->context->shop->getID(true);
|
||||
|
||||
if (!$registered = Db::getInstance()->getRow($sql))
|
||||
@@ -181,44 +181,44 @@ class Blocknewsletter extends Module
|
||||
return self::CUSTOMER_REGISTERED;
|
||||
|
||||
return self::CUSTOMER_NOT_REGISTERED;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Register in block newsletter
|
||||
*/
|
||||
private function newsletterRegistration()
|
||||
{
|
||||
if (empty($_POST['email']) OR !Validate::isEmail($_POST['email']))
|
||||
/**
|
||||
* Register in block newsletter
|
||||
*/
|
||||
private function newsletterRegistration()
|
||||
{
|
||||
if (empty($_POST['email']) OR !Validate::isEmail($_POST['email']))
|
||||
return $this->error = $this->l('Invalid e-mail address');
|
||||
|
||||
/* Unsubscription */
|
||||
/* Unsubscription */
|
||||
else if ($_POST['action'] == '1')
|
||||
{
|
||||
$register_status = $this->isNewsletterRegistered($_POST['email']);
|
||||
if ($register_status < 1)
|
||||
return $this->error = $this->l('E-mail address not registered');
|
||||
else if ($register_status == self::GUEST_REGISTERED)
|
||||
{
|
||||
if (!Db::getInstance()->execute('DELETE FROM '._DB_PREFIX_.'newsletter WHERE `email` = \''.pSQL($_POST['email']).'\' AND id_shop = '.$this->context->shop->getID(true)))
|
||||
return $this->error = $this->l('Error during unsubscription');
|
||||
return $this->valid = $this->l('Unsubscription successful');
|
||||
}
|
||||
$register_status = $this->isNewsletterRegistered($_POST['email']);
|
||||
if ($register_status < 1)
|
||||
return $this->error = $this->l('E-mail address not registered');
|
||||
else if ($register_status == self::GUEST_REGISTERED)
|
||||
{
|
||||
if (!Db::getInstance()->execute('DELETE FROM '._DB_PREFIX_.'newsletter WHERE `email` = \''.pSQL($_POST['email']).'\' AND id_shop = '.$this->context->shop->getID(true)))
|
||||
return $this->error = $this->l('Error during unsubscription');
|
||||
return $this->valid = $this->l('Unsubscription successful');
|
||||
}
|
||||
else if ($register_status == self::CUSTOMER_REGISTERED)
|
||||
{
|
||||
if (!Db::getInstance()->execute('UPDATE '._DB_PREFIX_.'customer SET `newsletter` = 0 WHERE `email` = \''.pSQL($_POST['email']).'\' AND id_shop = '.$this->context->shop->getID(true)))
|
||||
return $this->error = $this->l('Error during unsubscription');
|
||||
return $this->valid = $this->l('Unsubscription successful');
|
||||
if (!Db::getInstance()->execute('UPDATE '._DB_PREFIX_.'customer SET `newsletter` = 0 WHERE `email` = \''.pSQL($_POST['email']).'\' AND id_shop = '.$this->context->shop->getID(true)))
|
||||
return $this->error = $this->l('Error during unsubscription');
|
||||
return $this->valid = $this->l('Unsubscription successful');
|
||||
}
|
||||
}
|
||||
/* Subscription */
|
||||
/* Subscription */
|
||||
else if ($_POST['action'] == '0')
|
||||
{
|
||||
$register_status = $this->isNewsletterRegistered($_POST['email']);
|
||||
if ($register_status > 0)
|
||||
return $this->error = $this->l('E-mail address already registered');
|
||||
$register_status = $this->isNewsletterRegistered($_POST['email']);
|
||||
//if ($register_status > 0)
|
||||
// return $this->error = $this->l('E-mail address already registered');
|
||||
|
||||
$email = pSQL($_POST['email']);
|
||||
if (!$this->isRegistered($register_status))
|
||||
if (true || !$this->isRegistered($register_status))
|
||||
{
|
||||
if (Configuration::get('NW_VERIFICATION_EMAIL'))
|
||||
{
|
||||
@@ -229,49 +229,48 @@ class Blocknewsletter extends Module
|
||||
if (!$token = $this->getToken($email, $register_status))
|
||||
return $this->error = $this->l('Error during subscription');
|
||||
|
||||
$this->sendVerificationEmail($email, $token);
|
||||
return $this->valid = $this->l('A verification email has been sent. Please check your email.');
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($this->register($email, $register_status))
|
||||
$this->valid = $this->l('Subscription successful');
|
||||
else
|
||||
return $this->error = $this->l('Error during subscription');
|
||||
if ($this->register($email, $register_status))
|
||||
$this->valid = $this->l('Subscription successful');
|
||||
else
|
||||
return $this->error = $this->l('Error during subscription');
|
||||
|
||||
if ($code = Configuration::get('NW_VOUCHER_CODE'))
|
||||
$this->sendVoucher($email, $code);
|
||||
if ($code = Configuration::get('NW_VOUCHER_CODE'))
|
||||
$this->sendVoucher($email, $code);
|
||||
|
||||
if (Configuration::get('NW_CONFIRMATION_EMAIL'))
|
||||
if (Configuration::get('NW_CONFIRMATION_EMAIL'))
|
||||
$this->sendConfirmationEmail($email);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return true if the registered status correspond to a registered user
|
||||
* @param int $register_status
|
||||
* @return bool
|
||||
*/
|
||||
protected function isRegistered($register_status)
|
||||
{
|
||||
return in_array(
|
||||
$register_status,
|
||||
array(self::GUEST_REGISTERED, self::CUSTOMER_REGISTERED)
|
||||
);
|
||||
}
|
||||
/**
|
||||
* Return true if the registered status correspond to a registered user
|
||||
* @param int $register_status
|
||||
* @return bool
|
||||
*/
|
||||
protected function isRegistered($register_status)
|
||||
{
|
||||
return in_array(
|
||||
$register_status,
|
||||
array(self::GUEST_REGISTERED, self::CUSTOMER_REGISTERED)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Subscribe an email to the newsletter. It will create an entry in the newsletter table
|
||||
* or update the customer table depending of the register status
|
||||
*
|
||||
* @param unknown_type $email
|
||||
* @param unknown_type $register_status
|
||||
*/
|
||||
protected function register($email, $register_status)
|
||||
{
|
||||
/**
|
||||
* Subscribe an email to the newsletter. It will create an entry in the newsletter table
|
||||
* or update the customer table depending of the register status
|
||||
*
|
||||
* @param unknown_type $email
|
||||
* @param unknown_type $register_status
|
||||
*/
|
||||
protected function register($email, $register_status)
|
||||
{
|
||||
if ($register_status == self::GUEST_NOT_REGISTERED)
|
||||
{
|
||||
if (!$this->registerGuest(Tools::getValue('email')))
|
||||
@@ -280,38 +279,38 @@ class Blocknewsletter extends Module
|
||||
else if ($register_status == self::CUSTOMER_NOT_REGISTERED)
|
||||
{
|
||||
if (!$this->registerUser(Tools::getValue('email')))
|
||||
return false;
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Subscribe a customer to the newsletter
|
||||
*
|
||||
* @param string $email
|
||||
* @return bool
|
||||
*/
|
||||
protected function registerUser($email)
|
||||
{
|
||||
/**
|
||||
* Subscribe a customer to the newsletter
|
||||
*
|
||||
* @param string $email
|
||||
* @return bool
|
||||
*/
|
||||
protected function registerUser($email)
|
||||
{
|
||||
$sql = 'UPDATE '._DB_PREFIX_.'customer
|
||||
SET `newsletter` = 1, newsletter_date_add = NOW(), `ip_registration_newsletter` = \''.pSQL(Tools::getRemoteAddr()).'\'
|
||||
WHERE `email` = \''.pSQL($email).'\'
|
||||
AND id_shop = '.$this->context->shop->getID(true);
|
||||
|
||||
return Db::getInstance()->execute($sql);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Subscribe a guest to the newsletter
|
||||
*
|
||||
* @param string $email
|
||||
* @param bool $active
|
||||
* @return bool
|
||||
*/
|
||||
protected function registerGuest($email, $active = true)
|
||||
{
|
||||
$sql = 'INSERT INTO '._DB_PREFIX_.'newsletter (id_shop, id_group_shop, email, newsletter_date_add, ip_registration_newsletter, http_referer, active)
|
||||
/**
|
||||
* Subscribe a guest to the newsletter
|
||||
*
|
||||
* @param string $email
|
||||
* @param bool $active
|
||||
* @return bool
|
||||
*/
|
||||
protected function registerGuest($email, $active = true)
|
||||
{
|
||||
$sql = 'INSERT INTO '._DB_PREFIX_.'newsletter (id_shop, id_group_shop, email, newsletter_date_add, ip_registration_newsletter, http_referer, active)
|
||||
VALUES
|
||||
('.$this->context->shop->getID().',
|
||||
'.$this->context->shop->getGroupID().',
|
||||
@@ -328,55 +327,55 @@ class Blocknewsletter extends Module
|
||||
)';
|
||||
|
||||
return Db::getInstance()->execute($sql);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function activateGuest($email)
|
||||
{
|
||||
return Db::getInstance()->execute('UPDATE `'._DB_PREFIX_.'newsletter`
|
||||
SET `active` = 1
|
||||
WHERE `email` = \''.pSQL($email).'\''
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a guest email by token
|
||||
* @param string $token
|
||||
* @return string email
|
||||
*/
|
||||
protected function getGuestEmailByToken($token)
|
||||
{
|
||||
$sql = 'SELECT `email`
|
||||
FROM `'._DB_PREFIX_.'newsletter`
|
||||
WHERE MD5(CONCAT( `email` , `newsletter_date_add`, \''.pSQL(Configuration::get('NW_SALT')).'\')) = \''.pSQL($token).'\'
|
||||
AND `active` = 0';
|
||||
|
||||
return Db::getInstance()->getValue($sql);
|
||||
}
|
||||
public function activateGuest($email)
|
||||
{
|
||||
return Db::getInstance()->execute('UPDATE `'._DB_PREFIX_.'newsletter`
|
||||
SET `active` = 1
|
||||
WHERE `email` = \''.pSQL($email).'\''
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a customer email by token
|
||||
* @param string $token
|
||||
* @return string email
|
||||
*/
|
||||
protected function getUserEmailByToken($token)
|
||||
{
|
||||
$sql = 'SELECT `email`
|
||||
FROM `'._DB_PREFIX_.'customer`
|
||||
WHERE MD5(CONCAT( `email` , `date_add`, \''.pSQL(Configuration::get('NW_SALT')).'\')) = \''.pSQL($token).'\'
|
||||
AND `newsletter` = 0';
|
||||
* Returns a guest email by token
|
||||
* @param string $token
|
||||
* @return string email
|
||||
*/
|
||||
protected function getGuestEmailByToken($token)
|
||||
{
|
||||
$sql = 'SELECT `email`
|
||||
FROM `'._DB_PREFIX_.'newsletter`
|
||||
WHERE MD5(CONCAT( `email` , `newsletter_date_add`, \''.pSQL(Configuration::get('NW_SALT')).'\')) = \''.pSQL($token).'\'
|
||||
AND `active` = 0';
|
||||
|
||||
return Db::getInstance()->getValue($sql);
|
||||
}
|
||||
return Db::getInstance()->getValue($sql);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a token associated to an user
|
||||
*
|
||||
* @param string $email
|
||||
* @param string $register_status
|
||||
*/
|
||||
protected function getToken($email, $register_status)
|
||||
{
|
||||
/**
|
||||
* Returns a customer email by token
|
||||
* @param string $token
|
||||
* @return string email
|
||||
*/
|
||||
protected function getUserEmailByToken($token)
|
||||
{
|
||||
$sql = 'SELECT `email`
|
||||
FROM `'._DB_PREFIX_.'customer`
|
||||
WHERE MD5(CONCAT( `email` , `date_add`, \''.pSQL(Configuration::get('NW_SALT')).'\')) = \''.pSQL($token).'\'
|
||||
AND `newsletter` = 0';
|
||||
|
||||
return Db::getInstance()->getValue($sql);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a token associated to an user
|
||||
*
|
||||
* @param string $email
|
||||
* @param string $register_status
|
||||
*/
|
||||
protected function getToken($email, $register_status)
|
||||
{
|
||||
if (in_array($register_status, array(self::GUEST_NOT_REGISTERED, self::GUEST_REGISTERED)))
|
||||
{
|
||||
$sql = 'SELECT MD5(CONCAT( `email` , `newsletter_date_add`, \''.pSQL(Configuration::get('NW_SALT')).'\')) as token
|
||||
@@ -393,40 +392,40 @@ class Blocknewsletter extends Module
|
||||
}
|
||||
|
||||
return Db::getInstance()->getValue($sql);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Ends the registration process to the newsletter
|
||||
*
|
||||
* @param string $token
|
||||
*/
|
||||
public function confirmEmail($token)
|
||||
{
|
||||
$activated = false;
|
||||
/**
|
||||
* Ends the registration process to the newsletter
|
||||
*
|
||||
* @param string $token
|
||||
*/
|
||||
public function confirmEmail($token)
|
||||
{
|
||||
$activated = false;
|
||||
|
||||
if ($email = $this->getGuestEmailByToken($token))
|
||||
$activated = $this->activateGuest($email);
|
||||
else if ($email = $this->getUserEmailByToken($token))
|
||||
$activated = $this->registerUser($email);
|
||||
if ($email = $this->getGuestEmailByToken($token))
|
||||
$activated = $this->activateGuest($email);
|
||||
else if ($email = $this->getUserEmailByToken($token))
|
||||
$activated = $this->registerUser($email);
|
||||
|
||||
if (!$activated)
|
||||
return $this->l('Email already registered or invalid');
|
||||
if (!$activated)
|
||||
return $this->l('Email already registered or invalid');
|
||||
|
||||
if ($discount = Configuration::get('NW_VOUCHER_CODE'))
|
||||
if ($discount = Configuration::get('NW_VOUCHER_CODE'))
|
||||
$this->sendVoucher($email, $discount);
|
||||
|
||||
if (Configuration::get('NW_CONFIRMATION_EMAIL'))
|
||||
if (Configuration::get('NW_CONFIRMATION_EMAIL'))
|
||||
$this->sendConfirmationEmail($email);
|
||||
|
||||
return $this->l('Thank you for subscribing to our newsletter.');
|
||||
}
|
||||
return $this->l('Thank you for subscribing to our newsletter.');
|
||||
}
|
||||
|
||||
/**
|
||||
* Send an email containing a voucher code
|
||||
* @param string $email
|
||||
* @param string $discount
|
||||
/**
|
||||
* Send an email containing a voucher code
|
||||
* @param string $email
|
||||
* @param string $discount
|
||||
* @return bool
|
||||
*/
|
||||
*/
|
||||
protected function sendVoucher($email, $code)
|
||||
{
|
||||
return Mail::Send($this->context->language->id, 'newsletter_voucher', Mail::l('Newsletter voucher', $this->context->language->id), array('{discount}' => $code), $email, null, null, null, null, null, dirname(__FILE__).'/mails/');
|
||||
@@ -450,7 +449,7 @@ class Blocknewsletter extends Module
|
||||
*/
|
||||
protected function sendVerificationEmail($email, $token)
|
||||
{
|
||||
$verif_url = Tools::getShopDomain(true)._MODULE_DIR_.$this->name.'/verification.php?token='.$token;
|
||||
$verif_url = Context::getContext()->link->getModuleLink('blocknewsletter', 'verification').'&token='.$token;
|
||||
return Mail::Send($this->context->language->id, 'newsletter_verif', Mail::l('Email verification', $this->context->language->id), array('{verif_url}' => $verif_url), $email, null, null, null, null, null, dirname(__FILE__).'/mails/');
|
||||
}
|
||||
|
||||
@@ -482,7 +481,7 @@ class Blocknewsletter extends Module
|
||||
}
|
||||
}
|
||||
$this->smarty->assign('this_path', $this->_path);
|
||||
return $this->display(__FILE__, 'blocknewsletter.tpl');
|
||||
return $this->display(__FILE__, 'blocknewsletter.tpl');
|
||||
}
|
||||
|
||||
public function hookDisplayHeader($params)
|
||||
|
||||
74
modules/blocknewsletter/blocknewsletterController.php
Normal file
74
modules/blocknewsletter/blocknewsletterController.php
Normal file
@@ -0,0 +1,74 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2011 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2011 PrestaShop SA
|
||||
* @version Release: $Revision$
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
/**
|
||||
* @since 1.5.0
|
||||
*/
|
||||
class ModuleBlocknewsletterController extends ModuleController
|
||||
{
|
||||
private $message = '';
|
||||
|
||||
/**
|
||||
* @see FrontController::postProcess()
|
||||
*/
|
||||
public function postProcess()
|
||||
{
|
||||
$this->display_column_left = true;
|
||||
if ($this->process == 'verification')
|
||||
$this->processVerification();
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate cheque payment
|
||||
*/
|
||||
public function processVerification()
|
||||
{
|
||||
$module = new Blocknewsletter();
|
||||
$this->message = $module->confirmEmail(Tools::getValue('token'));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see FrontController::initContent()
|
||||
*/
|
||||
public function initContent()
|
||||
{
|
||||
parent::initContent();
|
||||
|
||||
if ($this->process == 'verification')
|
||||
$this->assignVerificationExecution();
|
||||
}
|
||||
|
||||
/**
|
||||
* Assign cheque payment template
|
||||
*/
|
||||
public function assignVerificationExecution()
|
||||
{
|
||||
$this->context->smarty->assign('message', $this->message);
|
||||
|
||||
$this->setTemplate('verification_execution.tpl');
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
require_once(dirname(__FILE__).'/../../config/config.inc.php');
|
||||
Tools::displayFileAsDeprecated();
|
||||
|
||||
require_once('blocknewsletter.php');
|
||||
|
||||
$module = new Blocknewsletter();
|
||||
|
||||
26
modules/blocknewsletter/verification_execution.tpl
Normal file
26
modules/blocknewsletter/verification_execution.tpl
Normal file
@@ -0,0 +1,26 @@
|
||||
{*
|
||||
* 2007-2011 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2011 PrestaShop SA
|
||||
* @version Release: $Revision$
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*}
|
||||
{$message}
|
||||
@@ -23,12 +23,6 @@
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*}
|
||||
<script type="text/javascript">
|
||||
// <![CDATA[
|
||||
var baseDir = '{$base_dir_ssl}';
|
||||
//]]>
|
||||
</script>
|
||||
|
||||
{*
|
||||
** Compatibility code for Prestashop older than 1.4.2 using a recent theme
|
||||
** Ignore list isn't require here
|
||||
|
||||
@@ -78,7 +78,6 @@
|
||||
|
||||
<script type="text/javascript">
|
||||
//<![CDATA[
|
||||
var baseDir = '{$base_dir_ssl}';
|
||||
{literal}
|
||||
$(document).ready(function()
|
||||
{
|
||||
|
||||
@@ -1000,6 +1000,7 @@ margin: 10px 0 0 0;*/
|
||||
#order .delivery_option.alternate_item, #orderopc .delivery_option.alternate_item {
|
||||
border-top: 1px solid #bdc2c9;
|
||||
background: #f1f2f4;
|
||||
border-bottom: 1px solid #bdc2c9;
|
||||
}
|
||||
#order .delivery_option label > table.resume td, #orderopc .delivery_option label > table.resume td {
|
||||
padding: 0 8px;
|
||||
@@ -1018,7 +1019,7 @@ margin: 10px 0 0 0;*/
|
||||
padding-left:10px;
|
||||
width: 160px;
|
||||
}
|
||||
#order .delivery_options_address .delivery_option_logo img, #orderopc .delivery_options_address .delivery_option_logo img { height: 40px; }
|
||||
#order .delivery_options_address .delivery_option_logo img, #orderopc .delivery_options_address .delivery_option_logo img { /*height: 40px;*/ }
|
||||
#orderopc .delivery_option_carrier {
|
||||
margin: 0 0 0 45px;
|
||||
padding: 5px;
|
||||
@@ -1032,10 +1033,10 @@ margin: 10px 0 0 0;*/
|
||||
|
||||
.order_carrier_content {
|
||||
padding:15px;
|
||||
border:1px solid #ccc;
|
||||
border:1px solid #ccc;
|
||||
font-size:12px;
|
||||
color:#000;
|
||||
background:#f8f8f8
|
||||
background:#f8f8f8
|
||||
}
|
||||
.order_carrier_content h3 {
|
||||
padding:15px 0 10px 0;
|
||||
@@ -1609,8 +1610,8 @@ ul#suppliers_list li .right_side {float:right;}
|
||||
/* ************************************************************************************************
|
||||
addons paypal
|
||||
************************************************************************************************ */
|
||||
#module-paypal-payment-submit #left_column {display:none}
|
||||
#module-paypal-payment-submit #center_column{width:757px}
|
||||
#module-payment-submit #left_column {display:none}
|
||||
#module-payment-submit #center_column{width:757px}
|
||||
|
||||
|
||||
/* ************************************************************************************************
|
||||
|
||||
@@ -23,13 +23,6 @@
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*}
|
||||
|
||||
<script type="text/javascript">
|
||||
//<![CDATA[
|
||||
var baseDir = '{$base_dir_ssl}';
|
||||
//]]>
|
||||
</script>
|
||||
|
||||
{capture name=path}<a href="{$link->getPageLink('my-account.php', true)}">{l s='My account'}</a><span class="navigation-pipe">{$navigationPipe}</span>{l s='My Vouchers'}{/capture}
|
||||
{include file="$tpl_dir./breadcrumb.tpl"}
|
||||
|
||||
|
||||
@@ -24,12 +24,6 @@
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*}
|
||||
|
||||
<script type="text/javascript">
|
||||
//<![CDATA[
|
||||
var baseDir = '{$base_dir_ssl}';
|
||||
//]]>
|
||||
</script>
|
||||
|
||||
{capture name=path}<a href="{$link->getPageLink('my-account', true)}">{l s='My account'}</a><span class="navigation-pipe">{$navigationPipe}</span>{l s='Order history'}{/capture}
|
||||
{include file="$tpl_dir./breadcrumb.tpl"}
|
||||
{include file="$tpl_dir./errors.tpl"}
|
||||
|
||||
@@ -24,12 +24,6 @@
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*}
|
||||
|
||||
<script type="text/javascript">
|
||||
//<![CDATA[
|
||||
var baseDir = '{$base_dir_ssl}';
|
||||
//]]>
|
||||
</script>
|
||||
|
||||
{capture name=path}<a href="{$link->getPageLink('my-account', true)}">{l s='My account'}</a><span class="navigation-pipe">{$navigationPipe}</span>{l s='Your personal information'}{/capture}
|
||||
{include file="$tpl_dir./breadcrumb.tpl"}
|
||||
|
||||
|
||||
@@ -24,12 +24,6 @@
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*}
|
||||
|
||||
<script type="text/javascript">
|
||||
//<![CDATA[
|
||||
var baseDir = '{$base_dir_ssl}';
|
||||
//]]>
|
||||
</script>
|
||||
|
||||
{capture name=path}{l s='My account'}{/capture}
|
||||
{include file="$tpl_dir./breadcrumb.tpl"}
|
||||
|
||||
|
||||
@@ -24,12 +24,6 @@
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*}
|
||||
|
||||
<script type="text/javascript">
|
||||
//<![CDATA[
|
||||
var baseDir = '{$base_dir_ssl}';
|
||||
//]]>
|
||||
</script>
|
||||
|
||||
{capture name=path}{l s='Order confirmation'}{/capture}
|
||||
{include file="$tpl_dir./breadcrumb.tpl"}
|
||||
|
||||
|
||||
@@ -24,12 +24,6 @@
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*}
|
||||
|
||||
<script type="text/javascript">
|
||||
//<![CDATA[
|
||||
var baseDir = '{$base_dir_ssl}';
|
||||
//]]>
|
||||
</script>
|
||||
|
||||
{capture name=path}<a href="{$link->getPageLink('my-account', true)}">{l s='My account'}</a><span class="navigation-pipe">{$navigationPipe}</span>{l s='Return Merchandise Authorization (RMA)'}{/capture}
|
||||
{include file="$tpl_dir./breadcrumb.tpl"}
|
||||
|
||||
|
||||
@@ -32,7 +32,6 @@
|
||||
{else}
|
||||
<script type="text/javascript">
|
||||
// <![CDATA[
|
||||
var baseDir = '{$base_dir_ssl}';
|
||||
var imgDir = '{$img_dir}';
|
||||
var authenticationUrl = '{$link->getPageLink("authentication", true)}';
|
||||
var orderOpcUrl = '{$link->getPageLink("order-opc", true)}';
|
||||
|
||||
@@ -27,7 +27,6 @@
|
||||
{if !$opc}
|
||||
<script type="text/javascript">
|
||||
// <![CDATA[
|
||||
var baseDir = '{$base_dir_ssl}';
|
||||
var currencySign = '{$currencySign|html_entity_decode:2:"UTF-8"}';
|
||||
var currencyRate = '{$currencyRate|floatval}';
|
||||
var currencyFormat = '{$currencyFormat|intval}';
|
||||
|
||||
@@ -24,12 +24,6 @@
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*}
|
||||
|
||||
<script type="text/javascript">
|
||||
//<![CDATA[
|
||||
var baseDir = '{$base_dir_ssl}';
|
||||
//]]>
|
||||
</script>
|
||||
|
||||
{capture name=path}<a href="{$link->getPageLink('my-account', true)}">{l s='My account'}</a><span class="navigation-pipe">{$navigationPipe}</span>{l s='Credit slips'}{/capture}
|
||||
{include file="$tpl_dir./breadcrumb.tpl"}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user