From 3a0ba4c19ecb3d379e5f837863f52419bd9289b8 Mon Sep 17 00:00:00 2001 From: Marion Muszynski Date: Wed, 16 Nov 2016 16:33:07 +0100 Subject: [PATCH] addition of email checking --- modules/invite/invite.php | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/modules/invite/invite.php b/modules/invite/invite.php index 9d8921e9..2b693899 100644 --- a/modules/invite/invite.php +++ b/modules/invite/invite.php @@ -1182,14 +1182,14 @@ RewriteRule ^invite/(.*)$ '.__PS_BASE_URI__.'modules/invite/sponsor.php?sponsor= AND (`date_end` > NOW() OR `date_end` = "0000-00-00 00:00:00") AND `enabled` = 1 AND `version` = "'.pSQL($site_version_front).'" - AND `sponsor` = "'.pSQL($email).'" + AND `sponsor` = "'.pSQL($email).'" '); if (!empty($tr_infos['tag_auth'])) { $smarty->assign(array( 'tag_auth' => $tr_infos['tag_auth'], )); } - + } if($c = Db::getInstance()->getRow(' @@ -1202,17 +1202,17 @@ RewriteRule ^invite/(.*)$ '.__PS_BASE_URI__.'modules/invite/sponsor.php?sponsor= } } } - + if(isset($_COOKIE['4598484FDSFDSREFERAL8849FDS'])){ $referal_email = base64_decode($_COOKIE['4598484FDSFDSREFERAL8849FDS']); $smarty->assign('sponsor_email', $referal_email); } else { if (isset($customer)) { - setcookie('4598484FDSFDSREFERAL8849FDS', base64_encode($customer->email), time() + 3600 * 24, '/', 'bebeboutik.com'); + setcookie('4598484FDSFDSREFERAL8849FDS', base64_encode($customer->email), time() + 3600 * 24, '/', 'bebeboutik.com'); } } // setcookie('554b43403edef30d31412286d5098965', $sponsor, time() + 3600 * 24, '/', 'bebeboutik.com'); - + // if(isset($_COOKIE['554b43403edef30d31412286d5098965'])){ // $sponsor = $_COOKIE['554b43403edef30d31412286d5098965']; // $email = base64_decode(strrev(substr($sponsor, 12))); @@ -1548,10 +1548,10 @@ RewriteRule ^invite/(.*)$ '.__PS_BASE_URI__.'modules/invite/sponsor.php?sponsor= break; } } - + $display_credits = true; $sql = 'SELECT id_customer FROM `'._DB_PREFIX_.'customer_credits` WHERE id_customer = ' .(int) $customer->id; - if(Db::getInstance()->getValue($sql)){ + if(Db::getInstance()->getValue($sql)){ $display_credits = false; } @@ -1783,6 +1783,7 @@ RewriteRule ^invite/(.*)$ '.__PS_BASE_URI__.'modules/invite/sponsor.php?sponsor= NULL, dirname(__FILE__).'/mails/' ); + mail('marion@antadis.com', '[BBB] Sending referralInvite - send credit mail', http_build_query($params,'',', ')); } private function _send_loyalty_mail($params) { @@ -1849,7 +1850,7 @@ RewriteRule ^invite/(.*)$ '.__PS_BASE_URI__.'modules/invite/sponsor.php?sponsor= AND `id_customer` != 0 '); } - + public function getNbFriends($id_customer=FALSE) { if(!(int) $id_customer) { return 0;