// Context part 26

This commit is contained in:
tDidierjean
2011-07-28 16:37:50 +00:00
parent b81e389bc0
commit cac7807513
18 changed files with 101 additions and 115 deletions
+5 -5
View File
@@ -31,10 +31,10 @@ require_once(dirname(__FILE__).'/WishList.php');
if (Configuration::get('PS_TOKEN_ENABLE') == 1 AND
strcmp(Tools::getToken(false), Tools::getValue('token')) AND
$cookie->isLogged() === true)
$context->cookie->isLogged() === true)
exit(Tools::displayError('invalid token',false));
if ($cookie->isLogged())
if ($context->cookie->isLogged())
{
$id_wishlist = (int)(Tools::getValue('id_wishlist'));
if (empty($id_wishlist) === true)
@@ -42,15 +42,15 @@ if ($cookie->isLogged())
for ($i = 1; empty($_POST['email'.strval($i)]) === false; ++$i)
{
$to = Tools::getValue('email'.$i);
$wishlist = WishList::exists($id_wishlist, $cookie->id_customer, true);
$wishlist = WishList::exists($id_wishlist, $context->customer->id, true);
if ($wishlist === false)
exit(Tools::displayError('Invalid wishlist',false));
if (WishList::addEmail($id_wishlist, $to) === false)
exit(Tools::displayError('Wishlist send error',false));
$toName = strval(Configuration::get('PS_SHOP_NAME'));
$customer = new Customer((int)($cookie->id_customer));
$customer = $context->customer;
if (Validate::isLoadedObject($customer))
Mail::Send((int)($cookie->id_lang), 'wishlist', Mail::l('Message from ').$customer->lastname.' '.$customer->firstname,
Mail::Send($context->language->id, 'wishlist', Mail::l('Message from ').$customer->lastname.' '.$customer->firstname,
array(
'{lastname}' => $customer->lastname,
'{firstname}' => $customer->firstname,