Changeset 10385 for extensions/Mail_supervisor/include
- Timestamp:
- Apr 15, 2011, 4:09:41 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/Mail_supervisor/include/fonctions.php
r9702 r10385 25 25 if (!defined('MAIL_SUPERV_PATH')) define('MAIL_SUPERV_PATH' , PHPWG_PLUGINS_PATH.basename(dirname(__FILE__)).'/'); 26 26 27 27 28 global $superv_champs , $superv_type ,$superv_bl_champs , $superv_bl_type ; 28 29 // if (!isset($_COOKIE[session_name()])){} … … 31 32 global $template ; 32 33 //=============================================== 33 function corrige_header($Carbonne,$headers,$args,$cl_list_mail) 34 { 35 global $mails_options,$conf_mail,$mailto,$infos_message; 36 37 if (!empty($args[$Carbonne])) 38 { 39 if ( count($args[$Carbonne]) > 0 ) 40 { 41 if ($mails_options['check_header_carbon'] == 'on') { 42 $cl_list_mail = str_replace(","," , ",get_strict_email_list(implode(',', $args[$Carbonne])))." \n" ; 43 $headers = preg_replace('/.*'.$Carbonne.'(.*).\n/i', $Carbonne.': '.$cl_list_mail, $headers); 44 } 45 } 46 47 } else { 48 // Raz Bcc, Cc dans headers 49 $headers = preg_replace('/.*'.$Carbonne.'(.*).\n/i', "" , $headers); 50 } 51 52 $headers = str_replace("\n.", "\n..",$headers ); 53 $ret->headers = $headers ; 54 $ret->list_mail = $cl_list_mail ; 55 return $ret; 56 57 58 } 34 function corrige_header($Carbonne,$headers,$args,$cl_list_mail,$mailto="") { 35 global $mails_options,$conf_mail,$infos_message; 36 if (!empty($args[$Carbonne]) && count($args[$Carbonne]) > 0 ){ 37 $cl_list_mail = str_replace(","," , ",get_strict_email_list(implode(',', $args[$Carbonne])))." \n" ; 38 $cl_liste_dest = implode(', ', $args[$Carbonne])." \n"; 39 if ($mails_options['check_header_carbon'] == 'on') { 40 $headers = preg_replace('/.*'.$Carbonne.':(.*).\n/i', $Carbonne.': '. $cl_list_mail, $headers); 41 } 42 $ret->list_mail = $cl_list_mail ; 43 } else { 44 // Raz Bcc, Cc dans headers 45 $headers = preg_replace('/.*'.$Carbonne.'(.*).\n/i', "" , $headers); 46 $ret->list_mail = "" ; 47 } 48 $ret->headers = $headers ; 49 return $ret; 50 } 59 51 60 function int_to_heure($int) 61 { 62 global $lang,$mails_donnees ; 63 64 $v0=Date_to_numeric(l10n('Day') ); 52 function int_to_heure($int){ 53 global $lang,$mails_donnees ; 54 $v0=Date_to_numeric(l10n('Day') ); 65 55 66 56 … … 88 78 $secondes = substr ('00'.$secondes,-2,2); 89 79 90 $retour="";91 $Week=explode(" ",l10n('Week %d'));92 $Week= ($Week[0]);93 94 if ($week > 0 ) $retour .= "+" . $week ." " . $Week ;95 if ($day > 0) $retour .= "+" . $day ." " .l10n('Day');96 if ($heures > 0) $retour .= "+" . $heures." " .l10n('Hour');97 if ($minutes > 0) $retour .= "+" . $minutes." " .l10n('Minute');98 if ($secondes > 0) $retour .= "+" . $secondes." " .l10n('Second');99 $retour=str_replace("+0","+",$retour);100 //================================================================================================101 return $retour;80 $retour=""; 81 $Week=explode(" ",l10n('Week %d')); 82 $Week= ($Week[0]); 83 84 if ($week > 0 ) $retour .= "+" . $week ." " . $Week ; 85 if ($day > 0) $retour .= "+" . $day ." " .l10n('Day'); 86 if ($heures > 0) $retour .= "+" . $heures." " .l10n('Hour'); 87 if ($minutes > 0) $retour .= "+" . $minutes." " .l10n('Minute'); 88 if ($secondes > 0) $retour .= "+" . $secondes." " .l10n('Second'); 89 $retour=str_replace("+0","+",$retour); 90 //================================================================================================ 91 return $retour; 102 92 } 103 93 … … 148 138 } 149 139 150 function get_liste($group_id) 151 { 140 function get_liste($group_id){ 152 141 global $conf ; 153 142 $query = ' … … 168 157 169 158 if (!empty($datas)) { 170 while ($group = mysql_fetch_array($datas,MYSQL_ASSOC)) 171 { 172 if (!empty($group['email'])) 173 { array_push($groups, format_email($group['username'], $group['email'] )); 159 while ($group = mysql_fetch_array($datas,MYSQL_ASSOC)){ 160 if (!empty($group['email'])){ 161 array_push($groups, format_email($group['username'], $group['email'] )); 174 162 } 175 163 } … … 259 247 } 260 248 //===================================================================== 261 function verif_mails_donnees() 262 { 263 global $mails_donnees,$infos_message,$erreur_message,$page; 249 function verif_mails_donnees(){ 250 global $mails_donnees,$infos_message,$erreur_message,$page; 264 251 265 252 if (!is_numeric($mails_donnees['nb_mails_periode'])){ … … 286 273 } 287 274 //======================================================================= 288 function Date_to_numeric( $Valeurs ) 289 { 275 function Date_to_numeric( $Valeurs ){ 290 276 global $lang,$erreur_message,$infos_message; 291 277 … … 294 280 295 281 if (!isset($lang['Sv_second'])) { 296 $Week=explode(" ",l10n('Week %d'));297 $Week= ($Week[0]);298 299 $lang['Sv_week'] = $Week;300 $lang['Sv_day'] = l10n('Day') ;301 $lang['Sv_hour'] = l10n('Hour') ;302 $lang['Sv_minute'] = l10n('Minute') ;303 $lang['Sv_second'] = l10n('Second');304 305 $lang['Sv_'. $lang['Sv_week']] = 'week';306 $lang['Sv_'. $lang['Sv_day']] = 'day';307 $lang['Sv_'. $lang['Sv_hour']] = 'hour';308 $lang['Sv_'. $lang['Sv_minute']] = 'minute';309 $lang['Sv_'. $lang['Sv_second']] = 'second';282 $Week=explode(" ",l10n('Week %d')); 283 $Week= ($Week[0]); 284 285 $lang['Sv_week'] = $Week; 286 $lang['Sv_day'] = l10n('Day') ; 287 $lang['Sv_hour'] = l10n('Hour') ; 288 $lang['Sv_minute'] = l10n('Minute') ; 289 $lang['Sv_second'] = l10n('Second'); 290 291 $lang['Sv_'. $lang['Sv_week']] = 'week'; 292 $lang['Sv_'. $lang['Sv_day']] = 'day'; 293 $lang['Sv_'. $lang['Sv_hour']] = 'hour'; 294 $lang['Sv_'. $lang['Sv_minute']] = 'minute'; 295 $lang['Sv_'. $lang['Sv_second']] = 'second'; 310 296 311 297 } … … 326 312 $nv = explode(" ", $nv ); 327 313 328 foreach($nv as $nv1) 329 { 330 if (!isset($lang['Sv_'. $nv1]) ) { 331 //==== au cas pluriel === 332 333 $nv0 = substr($nv1, 0,-1) ; 334 $a_ajouter= str_replace( $nv1,$nv0, $a_ajouter); 335 $nv1 = $nv0 ; 336 314 foreach($nv as $nv1){ 315 if (!isset($lang['Sv_'. $nv1]) ) { 316 //==== au cas pluriel === 317 $nv0 = substr($nv1, 0,-1) ; 318 $a_ajouter= str_replace( $nv1,$nv0, $a_ajouter); 319 $nv1 = $nv0 ; 320 } 321 if (!isset($lang['Sv_'. $nv1]) ) { 322 $erreur_message .= $nv1. " ".l10n('not_found')."<br />"; 323 // die($erreur_message); 324 }else { 325 ob_start(); 326 $match = $conv[strtolower($lang['Sv_'. $nv1])] ; 327 $a_ajouter = str_replace($nv1," ". $match ." ",$a_ajouter) ; 328 $erreur_message .= ob_get_contents(); 329 ob_end_clean(); 330 } 337 331 } 338 339 if (!isset($lang['Sv_'. $nv1]) ) { 340 $erreur_message .= $nv1. " ".l10n('not_found')."<br />"; 341 // die($erreur_message); 342 343 }else { 344 ob_start(); 345 $match = $conv[strtolower($lang['Sv_'. $nv1])] ; 346 $a_ajouter = str_replace($nv1," ". $match ." ",$a_ajouter) ; 347 $erreur_message .= ob_get_contents(); 348 ob_end_clean(); 349 } 350 351 } 352 353 $a_ajouter = "+ " . $a_ajouter ; 354 $a_ajouter=sup_double_espace($a_ajouter); 355 $v1 = array('- ','+ ',' -', ' +', ' '); 356 $v2 = array('-' ,'+' ,'|-', '|+', "*"); 357 358 $new_valeur = str_replace($v1,$v2,$a_ajouter) ; 359 $new_valeur = str_replace('++','+',$new_valeur ) ; 332 333 $a_ajouter = "+ " . $a_ajouter ; 334 $a_ajouter=sup_double_espace($a_ajouter); 335 $v1 = array('- ','+ ',' -', ' +', ' '); 336 $v2 = array('-' ,'+' ,'|-', '|+', "*"); 337 338 $new_valeur = str_replace($v1,$v2,$a_ajouter) ; 339 $new_valeur = str_replace('++','+',$new_valeur ) ; 360 340 361 return $new_valeur;341 return $new_valeur; 362 342 } 363 343 //===================================================================== … … 571 551 } 572 552 //===================================================================================== 573 function test_spam($ip =0,$user_name ='', $mail_adresse = "") 574 { 553 function test_spam($ip =0,$user_name ='', $mail_adresse = ""){ 575 554 $buffer=""; 576 555 global $page,$infos_message; … … 616 595 } 617 596 //================================================================== 618 function lire_fichier_distant($fichier) 619 { 620 $buffer=""; 621 $handle = @fopen($fichier,"r"); 622 if ($handle) { 623 while (!feof($handle)) { 624 $buffer .= fgets($handle, 4096); 625 } 626 fclose($handle); 627 } 597 function lire_fichier_distant($fichier){ 598 $buffer=""; 599 $handle = @fopen($fichier,"r"); 600 if ($handle) { 601 while (!feof($handle)) { 602 $buffer .= fgets($handle, 4096); 603 } 604 fclose($handle); 605 } 628 606 629 607 return $buffer ; 630 608 631 609 } 632 610 //================================================ 633 function clj_is_ip($ip) 634 { 611 function clj_is_ip($ip){ 635 612 if (preg_match("/^(((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]{1}[0-9]|[1-9])\.){1}((25[0-5]|2[0-4][0-9]|[1]{1}[0-9]{2}|[1-9]{1}[0-9]|[0-9])\.){2}((25[0-5]|2[0-4][0-9]|[1]{1}[0-9]{2}|[1-9]{1}[0-9]|[0-9]){1}))$/",$ip)) return true ; 636 613
Note: See TracChangeset
for help on using the changeset viewer.