diff --git a/scripts/emailings/reset-invalid-emails.php b/scripts/emailings/reset-invalid-emails.php index cfd61bdddcf..e332bbec24b 100755 --- a/scripts/emailings/reset-invalid-emails.php +++ b/scripts/emailings/reset-invalid-emails.php @@ -23,7 +23,7 @@ */ if (!defined('NOSESSION')) define('NOSESSION', '1'); -if (!defined('MAXEMAILS')) define('MAXEMAILS',100); +if (!defined('MAXEMAILS')) define('MAXEMAILS', 100); $sapi_type = php_sapi_name(); $script_file = basename(__FILE__); @@ -68,27 +68,27 @@ if (!empty($login)) $db->begin(); -$myfile = fopen($id,"r") or die("Unable to open file\n"); +$myfile = fopen($id, "r") or die("Unable to open file\n"); $groupofemails=array(); for ($i=0; $i < MAXEMAILS; $i++) { $tmp =fgets($myfile); - if($tmp == null) + if ($tmp == null) { break; } - $groupofemails[$i] = trim($tmp,"\n"); + $groupofemails[$i] = trim($tmp, "\n"); } // For each groupofemail, we update tables to set email field to empty $sql_base = "UPDATE ".MAIN_DB_PREFIX; -foreach($groupofemails as $email) +foreach ($groupofemails as $email) { if ($type == 'all' || $type == 'thirdparty') { // Loop on each record and update the email to null if email into $groupofemails - + $sql=$sql_base."societe as s SET s.email = NULL WHERE s.email = '".$email."';"; $db->query($sql); } @@ -99,7 +99,6 @@ foreach($groupofemails as $email) $sql=$sql_base."socpeople as s SET s.email = NULL WHERE s.email = '".$email."';"; $db->query($sql); - } if ($type == 'all' || $type == 'user') @@ -108,7 +107,6 @@ foreach($groupofemails as $email) $sql=$sql_base."user as u SET u.email = NULL WHERE u.email = '".$email."';"; $db->query($sql); - } if ($type == 'all' || $type == 'member')