Add rules

This commit is contained in:
Michael RICOIS 2018-03-12 11:52:00 +01:00
parent d1d0642f91
commit 1920a84634
2 changed files with 32 additions and 28 deletions

View File

@ -136,22 +136,24 @@ if($canSendInvitations) {
// Real association // Real association
$replaceSLD = array( $replaceSLD = array(
'@hotmil.' => '@hotmail.', '@hotmil.' => '@hotmail.',
'@htmail.' => '@hotmail.', '@htmail.' => '@hotmail.',
'@hotmal.' => '@hotmail.', '@hotmal.' => '@hotmail.',
'@hotml.' => '@hotmail.', '@hotml.' => '@hotmail.',
'@hotmai.' => '@hotmail.', '@hotmai.' => '@hotmail.',
'@gmal.' => '@gmail.', '@gmal.' => '@gmail.',
'@gail.' => '@gmail.', '@gail.' => '@gmail.',
'@gml.' => '@gmail.', '@gml.' => '@gmail.',
'@gmai.' => '@gmail.', '@gmai.' => '@gmail.',
'@gmil.' => '@gmail.', '@gmil.' => '@gmail.',
); );
$replaceGlobal = array( $replaceGlobal = array(
'@gmailcom' => '@gmail.com', '@gmailcom' => '@gmail.com',
'@hotmailcom' => '@hotmail.com', '@hotmailcom' => '@hotmail.com',
'@hotmailfr' => '@hotmail.fr', '@hotmailfr' => '@hotmail.fr',
'@yahoocom' => '@yahoo.com',
'@yahoofr' => '@yahoo.fr',
); );
// Real use case replacement // Real use case replacement
$friendEmail = strtr($friendEmail, $replaceGlobal); $friendEmail = strtr($friendEmail, $replaceGlobal);
@ -163,7 +165,7 @@ if($canSendInvitations) {
$sld = substr($friendEmail, $atPos + 1, strlen($friendEmail) - ($atPos+1) - (strlen($tld)+1) ); $sld = substr($friendEmail, $atPos + 1, strlen($friendEmail) - ($atPos+1) - (strlen($tld)+1) );
if (empty($tld)) { if (empty($tld)) {
$this->errors[] = Tools::displayError('Invalid email'); $this->errors[] = Tools::displayError('Invalid email');
$_POST['email'] = ''; $_POST['friendsEmail'] = '';
} }
if (empty($this->errors)) { if (empty($this->errors)) {
// If you have a complete list of TLD, check it ! // If you have a complete list of TLD, check it !

View File

@ -167,22 +167,24 @@ class AuthController extends AuthControllerCore
// Real association // Real association
$replaceSLD = array( $replaceSLD = array(
'@hotmil.' => '@hotmail.', '@hotmil.' => '@hotmail.',
'@htmail.' => '@hotmail.', '@htmail.' => '@hotmail.',
'@hotmal.' => '@hotmail.', '@hotmal.' => '@hotmail.',
'@hotml.' => '@hotmail.', '@hotml.' => '@hotmail.',
'@hotmai.' => '@hotmail.', '@hotmai.' => '@hotmail.',
'@gmal.' => '@gmail.', '@gmal.' => '@gmail.',
'@gail.' => '@gmail.', '@gail.' => '@gmail.',
'@gml.' => '@gmail.', '@gml.' => '@gmail.',
'@gmai.' => '@gmail.', '@gmai.' => '@gmail.',
'@gmil.' => '@gmail.', '@gmil.' => '@gmail.',
); );
$replaceGlobal = array( $replaceGlobal = array(
'@gmailcom' => '@gmail.com', '@gmailcom' => '@gmail.com',
'@hotmailcom' => '@hotmail.com', '@hotmailcom' => '@hotmail.com',
'@hotmailfr' => '@hotmail.fr', '@hotmailfr' => '@hotmail.fr',
'@yahoocom' => '@yahoo.com',
'@yahoofr' => '@yahoo.fr',
); );
// Real use case replacement // Real use case replacement
$email = strtr($email, $replaceGlobal); $email = strtr($email, $replaceGlobal);
@ -220,7 +222,7 @@ class AuthController extends AuthControllerCore
} }
} }
} }
echo $email; exit;
/* Preparing customer */ /* Preparing customer */
$customer = new Customer(); $customer = new Customer();
$lastnameAddress = $_POST['lastname']; $lastnameAddress = $_POST['lastname'];