Changeset 10385
- Timestamp:
- Apr 15, 2011, 4:09:41 PM (13 years ago)
- Location:
- extensions/Mail_supervisor
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/Mail_supervisor/admin/clear/theme.css
r10179 r10385 1 .Style1 {2 color: #6699CC;3 }4 .items {5 font-style: italic;6 }7 .row2 {8 font-style: italic;9 border: 0;10 }11 .row1 {12 font-style: italic;13 border: 0;14 }15 .info {16 color: #5599FF;17 }18 1 .bug { 19 background-image: url( ../smilies/mouche.gif);2 background-image: url('../../smilies/mouche.gif'); 20 3 background-repeat: no-repeat; 21 4 width: 100px; 22 5 height: 75px; 23 }24 .frame_ {25 height: 40px;26 }27 28 .erreur {29 color: #FF0000;30 6 } 31 7 .instructions { -
extensions/Mail_supervisor/admin/default/theme.css
r10179 r10385 1 /* Bloc expand-collapse instructions */ 2 .instructionBlock 3 { 1 .bug { 2 background-image: url('../../smilies/mouche.gif'); 3 background-repeat: no-repeat; 4 width: 100px; 5 height: 75px; 6 } 7 /* Bloc expand-collapse instructions */ 8 .instructionBlock{ 4 9 border: 1px solid #666; 5 10 margin: 5px; 6 11 overflow: hidden; 7 12 } 8 9 .instructionBlockHeaderCollapsed, .instructionBlockHeaderExpanded 10 { 13 .instructionBlockHeaderCollapsed, .instructionBlockHeaderExpanded{ 11 14 background-color:#111; 12 15 background-position:15px center; … … 19 22 text-align: left; 20 23 } 21 22 .instructionBlockHeaderCollapsed span, .instructionBlockHeaderExpanded span 23 { 24 .instructionBlockHeaderCollapsed span, .instructionBlockHeaderExpanded span{ 24 25 border-bottom: none; 25 26 } … … 31 32 background-image: url('./clear/icon/collapse.gif')); 32 33 } 33 .instructionBlockContent 34 { 34 .instructionBlockContent{ 35 35 padding:0 15px 15px; 36 36 } -
extensions/Mail_supervisor/admin/header_2_1.tpl
r10179 r10385 1 { html_head}2 {known_script id="jquery " src= $ROOT_URL|@cat:$path_js|@cat:"jquery.packed.js" }3 {known_script id="jquery. cluetip" src=$ROOT_URL|@cat:$path_js|@cat:"plugins/jquery.cluetip.packed.js"}1 {known_script id="jquery" src = $ROOT_URL|@cat:"themes/default/js/jquery.packed.js" now=0} 2 {known_script id="jquery.cluetip" src = $ROOT_URL|@cat:"themes/default/js/plugins/jquery.cluetip.packed.js"} 3 {known_script id="jquery.ui" src= $ROOT_URL|@cat:"themes/default/js/ui/minified/ui.core.min.js"} 4 4 {known_script id="mail_script" src= $MAIL_SUPERV_PATH|@cat:"include/Scripts.js"} 5 {html_head} 5 6 <link rel="stylesheet" type="text/css" href="{$MAIL_SUPERV_PATH}admin/{$theme}/theme.css" /> 6 7 7 {/html_head} 8 8 <input id="action_spam" name="action_spam" type="hidden" value="{$action_spam}" /> -
extensions/Mail_supervisor/admin/header_2_2.tpl
r10179 r10385 1 {combine_script id="jquery" path= $ROOT_URL|@cat:$path_js|@cat:"jquery.min.js" }2 {combine_script id="jquery.cluetip" path= $ROOT_URL|@cat:$path_js|@cat:"plugins/jquery.cluetip.js" require="jquery"}1 {combine_script id="jquery" path= "themes/default/js/jquery.min.js" } 2 {combine_script id="jquery.cluetip" path= "themes/default/js/plugins/jquery.cluetip.js" require="jquery"} 3 3 {combine_script id="my_script" path= $MAIL_SUPERV_PATH|@cat:"include/Scripts.js" } 4 5 <input id="action_spam" name="action_spam" type="hidden" value="{$action_spam}" /> 4 {if $theme=='default'}{combine_css path= $MAIL_SUPERV_PATH|@cat:'admin/clear/theme.css'}{/if} 6 5 {if $theme=='clear'}{combine_css path= $MAIL_SUPERV_PATH|@cat:'admin/clear/theme.css'}{/if} 7 6 {if $theme=='roma'}{combine_css path= $MAIL_SUPERV_PATH|@cat:'admin/roma/theme.css'}{/if} 8 { if $theme=='default'}{combine_css path= $MAIL_SUPERV_PATH|@cat:'admin/clear/theme.css'}{/if}7 {html_head} 9 8 9 {/html_head} -
extensions/Mail_supervisor/admin/mail_superv_admin.php
r10155 r10385 358 358 $template->assign( 359 359 array( 360 361 362 363 364 365 366 367 360 'Groupe' => $groups, 361 'message_test' => $mails_donnees['message_test'] , 362 'liste' => $destinataires , 363 'version' => $version , 364 'MAIL_CONTENT' => $mails_donnees['message_test'], 365 'path_js' => $path_js, 366 'MAIL_SUPERV_PATH_ABS' => MAIL_SUPERV_PATH_ABS, 367 'MAIL_SUPERV_PATH' => MAIL_SUPERV_PATH , 368 368 ) 369 369 ); … … 433 433 $champs_ip=array(); 434 434 $champs_bl=array(); 435 if (!empty($liste_ip)) 435 if (!empty($liste_ip)) $champs_ip=array_keys($liste_ip[0]); 436 436 if (!empty($liste_bl)) $champs_bl=array_keys($liste_bl[0]); 437 437 $smile_bonjour=MAIL_SUPERV_PATH."smilies/mouche.gif" ; … … 467 467 'version' => $version , 468 468 'MAIL_SUPERV_PATH_ABS' => MAIL_SUPERV_PATH_ABS, 469 'path_js' => $path_js,469 470 470 ) 471 471 ); … … 487 487 $template->assign( 488 488 array( 489 490 491 492 493 489 'smile_bonjour' => $smile_bonjour , 490 'version' => $version , 491 'MAIL_SUPERV_PATH' => MAIL_SUPERV_PATH , 492 'path_js' => $path_js, 493 'MAIL_SUPERV_PATH_ABS' => MAIL_SUPERV_PATH_ABS 494 494 ) 495 495 ); -
extensions/Mail_supervisor/admin/roma/theme.css
r10179 r10385 1 /* Bloc expand-collapse instructions */ 2 .instructionBlock 3 { 1 .bug { 2 background-image: url('../../smilies/mouche.gif'); 3 background-repeat: no-repeat; 4 width: 100px; 5 height: 75px; 6 } 7 /* Bloc expand-collapse instructions */ 8 .instructionBlock{ 4 9 border: 1px solid #666; 5 10 margin: 5px; 6 11 overflow: hidden; 7 12 } 8 9 .instructionBlockHeaderCollapsed, .instructionBlockHeaderExpanded 10 { 13 .instructionBlockHeaderCollapsed, .instructionBlockHeaderExpanded{ 11 14 background-color:#111; 12 15 background-position:15px center; … … 19 22 text-align: left; 20 23 } 21 22 .instructionBlockHeaderCollapsed span, .instructionBlockHeaderExpanded span 23 { 24 border-bottom: none; 24 .instructionBlockHeaderCollapsed span, .instructionBlockHeaderExpanded span{ 25 border-bottom: none; 25 26 } 26 27 … … 28 29 background-image: url(expand.gif); 29 30 } 30 31 .instructionBlockHeaderExpanded 32 { 31 .instructionBlockHeaderExpanded{ 33 32 background-image: url(collapse.gif) ; 34 33 } 35 34 36 .instructionBlockContent 37 { 35 .instructionBlockContent{ 38 36 padding:0 15px 15px; 39 37 } -
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 -
extensions/Mail_supervisor/language/fr_FR/help/plugin.lang.php
r10094 r10385 9 9 $lang['Sv_Fonctionality']='Fonctionnalites'; 10 10 11 $lang['Sv_ Oversees_management_emails']='Supervise la gestion des mails et bloque l\' envoie des mails lors de la mise en quarantaine';11 $lang['Sv_oversees_management_emails']='Supervise la gestion des mails et bloque l\' envoie des mails lors de la mise en quarantaine'; 12 12 $lang['Sv_hlp_1_1']='Compte le nombre de mails envoyes par le site.'; 13 13 $lang['Sv_hlp_1_2']='Detecte les differents messages d\'alertes generes par la fonction mail[]'; -
extensions/Mail_supervisor/mail_super.inc.php
r10179 r10385 20 20 // | USA. | 21 21 // +-----------------------------------------------------------------------+ 22 if (!defined('MAIL_SUPERV_PATH'))23 define('MAIL_SUPERV_PATH', PHPWG_PLUGINS_PATH.basename(dirname(__FILE__)).'/');24 if (!defined('ROOT_URL'))25 define( 'ROOT_URL', get_root_url().'/' );26 $MAIL_SUPERV_PATH_ABS=str_replace('\\','/',dirname(__FILE__) );27 if (!defined('MAIL_SUPERV_PATH_ABS'))28 define('MAIL_SUPERV_PATH_ABS', $MAIL_SUPERV_PATH_ABS."/");29 22 30 23 class mail_supervisor { … … 46 39 */ 47 40 static public function init() { 48 global $template,$version,$path_js,$icon_path; 49 50 $theme="default"; 51 41 global $template,$version,$icon_path; 42 $action_spam = pwg_get_session_var('action_spam') ; 43 $theme="default"; 44 $themeconf=$template->get_template_vars('themeconf'); 45 $theme=$themeconf['id']; 46 if (file_exists ( 'admin/themes/clear/icon/help.png')) $icon_path = 'themes/default/icon/help.png'; 47 else $icon_path = "admin/template/goto/theme/clear/icon/help.png"; 52 48 if (PHPWG_VERSION < 2.2 ) { 53 49 $file =MAIL_SUPERV_PATH_ABS.'admin/header_2_1.tpl' ; 54 if (PHPWG_VERSION < 2.0 ) $path_js = "template-common/lib/"; 55 else $path_js= 'themes/default/js/' ; 56 $themeconf=$template->get_template_vars('themeconf'); 57 $theme=$themeconf['id']; 58 50 59 51 } else { 60 $themeconf=$template->get_template_vars('themeconf'); 61 $theme=$themeconf['id']; 62 $file =MAIL_SUPERV_PATH_ABS.'admin/header_2_2.tpl' ; 63 $path_js= 'themes/default/js/' ; 52 $file = MAIL_SUPERV_PATH_ABS.'admin/header_2_2.tpl' ; 53 64 54 } 65 55 if(isset($_GET['action_spam']) and $_GET['action_spam']=="no"){ 66 $action_spam = pwg_get_session_var('action_spam') ;67 56 pwg_set_session_var('action_spam', "false"); 68 57 unset ($_SESSION['pwg_'.'action_spam']); 69 58 } 70 71 59 $action_spam=pwg_get_session_var('action_spam'); 72 60 $template->set_filenames(array('mail_superv_init'=> $file )); 73 if (file_exists ( 'admin/themes/clear/icon/help.png')) $icon_path = 'themes/default/icon/help.png'; 74 else $icon_path = "admin/template/goto/theme/clear/icon/help.png"; 75 $template->assign( 76 array('theme' => $theme,'version' => $version, 77 'PHPWG_VERSION' => PHPWG_VERSION , 78 'MAIL_SUPERV_PATH' => MAIL_SUPERV_PATH , 79 'path_js' => $path_js, 80 'MAIL_SUPERV_PATH_ABS' => MAIL_SUPERV_PATH_ABS, 81 'action_spam' => pwg_get_session_var('action_spam') 82 ) 83 ); 61 $MAIL_SUPERV_PATH=str_replace(PHPWG_ROOT_PATH,"",MAIL_SUPERV_PATH) ; 62 $profile=array('theme' => $theme, 63 'PHPWG_VERSION' => PHPWG_VERSION , 64 'MAIL_SUPERV_PATH' => $MAIL_SUPERV_PATH , 65 'MAIL_SUPERV_PATH_ABS' => MAIL_SUPERV_PATH_ABS 66 ); 67 68 $template->assign( $profile ); 69 $template->append('footer_elements', '<input id="action_spam" name="action_spam" type="hidden" value="'.$action_spam.'" />'); 84 70 $template->parse( 'mail_superv_init', false); 85 86 71 return ;// 87 72 }// function init … … 190 175 ob_start(); 191 176 echo '<pre>'; 177 if(count($variables)>1){ 192 178 foreach($variables as $key => $line){ 193 179 echo $key . " => " . $line ; 194 180 echo "<br />"; 195 181 } 182 }else{ 183 echo "<i>".$variables."</i><br />"; 184 } 185 196 186 $m= ob_get_contents(); 197 187 ob_end_clean(); -
extensions/Mail_supervisor/main.inc.php
r9702 r10385 11 11 if (!defined('mail_superv_DIR')) define('mail_superv_DIR' , basename(dirname(__FILE__))); 12 12 if (!defined('MAIL_SUPERV_PATH')) define('MAIL_SUPERV_PATH' , PHPWG_PLUGINS_PATH.basename(dirname(__FILE__)).'/'); 13 $MAIL_SUPERV_PATH_ABS=str_replace('\\','/',dirname(__FILE__) ); 13 14 $MAIL_SUPERV_PATH_ABS = str_replace('\\','/',dirname(__FILE__) ); 14 15 if (!defined('MAIL_SUPERV_PATH_ABS')) define( 'MAIL_SUPERV_PATH_ABS', $MAIL_SUPERV_PATH_ABS."/"); 16 15 17 global $conf,$mails_options ; 16 18 include_once (MAIL_SUPERV_PATH.'include/constants.php'); 17 19 include_once(MAIL_SUPERV_PATH.'mail_super.inc.php'); 20 18 21 $mail_supervisor = new mail_supervisor(); 19 22 add_event_handler('get_admin_plugin_menu_links', array(&$mail_supervisor,'admin_menu') ); … … 23 26 // 24 27 // 28 include_once (PHPWG_ROOT_PATH.'include/functions_mail.inc.php' ); 25 29 include_once (MAIL_SUPERV_PATH.'include/fonctions.php'); 26 30 //===============loc_begin_index==============loc_after_page_header============================================================= 27 add_event_handler('loc_ after_page_header', array(&$mail_supervisor,'init') );31 add_event_handler('loc_begin_page_header', array(&$mail_supervisor,'init') ); 28 32 add_event_handler('loc_begin_page_tail', array(&$mail_supervisor,'affiche_message') ); 29 33 … … 31 35 add_event_handler('send_mail', 'clj_mail',EVENT_HANDLER_PRIORITY_NEUTRAL - 10, 6); 32 36 function clj_mail($result, $mailto, $subject, $content, $headers, $args) { 33 global $conf, $user, $lang_info; 34 global $conf_mail,$mails_options,$mails_donnees ; 35 global $template,$page ,$erreur_message,$infos_message, $lang; 36 global $errors; 37 38 // lecture config table ------------- 39 include_once (MAIL_SUPERV_PATH.'include/fonctions.php'); 40 load_language('plugin.lang', MAIL_SUPERV_PATH); 41 if (isset($_POST["Submit"]) ) { 42 if ($_POST["Submit"] != l10n('Sv_Envoyer') ) return true ; 43 } 44 // remove_event_handler('send_mail', 'pwg_send_mail'); 45 46 $message =""; 47 if (!isset($infos_message)) { $infos_message = ""; } 48 if (!isset($erreur_message)) { $erreur_message = ''; } 37 global $conf, $user, $lang_info; 38 global $conf_mail,$mails_options,$mails_donnees ; 39 global $template,$page ,$erreur_message,$infos_message, $lang; 40 global $errors; 41 // lecture config table ------------- 42 include_once (MAIL_SUPERV_PATH.'include/fonctions.php'); 43 load_language('plugin.lang', MAIL_SUPERV_PATH); 44 if (isset($_POST["Submit"]) ) { 45 if ($_POST["Submit"] != l10n('Sv_Envoyer') ) return true ; 46 } 47 // remove_event_handler('send_mail', 'pwg_send_mail'); 48 $message =""; 49 if (!isset($infos_message)) { $infos_message = ""; } 50 if (!isset($erreur_message)) { $erreur_message = ''; } 49 51 50 51 52 //======== verification si envoie de mail ou blocage connexion =====================53 54 52 // $mails_options = explode("," , $conf['mail_superv']); 53 $envoie_ok=true ; 54 //======== verification si envoie de mail ou blocage connexion ===================== 55 56 if ($mails_options['no_mail_list']=='on' || $mails_options['no_connect'] == 'on' ) { 55 57 if (kill_list()) { 56 58 $nb_destinataires=0; ; … … 58 60 $erreur_message .= "<BR />".l10n('Sv_is_a_spam') ; 59 61 $infos_message = l10n('Sv_mail_not_send')."<BR />"; 60 if ($mails_options['no_connect'] == 'on' ){ 61 if ($user['status'] == 'webmaster' ) { 62 //---------- continuer si web master ---------- 63 64 }else{ 65 if (!isset($_GET['admin'])) { 66 die('Blacklist : <br />' .$erreur_message. '<br /> Hacking attempt!'); 67 }elseif ($_GET['admin'] != 'piwigo') 68 { 69 die('blacklist Hacking attempt!'); 70 } 71 72 } 73 74 } 75 62 if ($mails_options['no_connect'] == 'on' ){ 63 if ($user['status'] == 'webmaster'){ 64 //---------- continuer si web master ---------- 65 }else{ 66 if (!isset($_GET['admin'])) { 67 die('Blacklist : <br />' .$erreur_message. '<br /> Hacking attempt!'); 68 }elseif ($_GET['admin'] != 'piwigo') 69 { 70 die('blacklist Hacking attempt!'); 71 } 72 } 73 } 76 74 return true; 77 75 } 78 76 } 79 // lecture donnees ------------- 80 $mails_donnees = mail_supervisor::Get_Datas(); 81 82 $nb_mails = $mails_donnees['nb_mails'] ; 83 $next_day = $mails_donnees['date_mail'] ; 84 85 $reste = $mails_donnees['reste'] ; 86 87 88 $rest_mail = $mails_donnees['rest_mail'] ; 77 // lecture donnees ------------- 78 $mails_donnees = mail_supervisor::Get_Datas(); 79 $nb_mails = $mails_donnees['nb_mails'] ; 80 $next_day = $mails_donnees['date_mail'] ; 81 $reste = $mails_donnees['reste'] ; 82 $rest_mail = $mails_donnees['rest_mail'] ; 89 83 if ($rest_mail <=0 || $mails_donnees['nb_mails'] ==0 ){ 90 84 $mails_donnees['nb_mails'] =0 ; 91 85 $mails_donnees['date_mail'] = time(); 92 } 93 86 } 94 87 $rest_spam = $mails_donnees['rest_spam'] ; 95 88 if ($rest_spam <=0 || $mails_donnees['nb_spams'] ==0 ){ 96 89 $mails_donnees['nb_spams'] =0 ; 97 90 $mails_donnees['date_spam'] = time(); 98 } 99 100 $alerte = ( $mails_donnees['reste'] >0 ) ? true : false ; 101 91 } 92 $alerte = ( $mails_donnees['reste'] >0 ) ? true : false ; 102 93 $alerte_mail = ( $mails_donnees['nb_mails'] > $mails_donnees['nb_mails_maxi']-1 ) ? true : false ; 103 $alerte_spam = ( $mails_donnees['nb_spams'] > $mails_donnees['nb_spams_maxi']-1 ) ? true : false ; 104 105 106 if ( ( !$alerte && !$alerte_spam && !$alerte_mail ) ) { 107 $nb_destinataires=0; 108 if ($mails_options['check_mailto'] == 'on') { 109 if ($mailto == "" ) $mailto = $conf_mail['email_webmaster']; 110 } 111 if ($mailto<>"" ) $nb_destinataires +=1; 112 if (!empty($args['Bcc'])) { $nb_destinataires += count($args['Bcc']); } 113 if (!empty($args['Cc'])) { $nb_destinataires += count($args['Cc']); } 114 115 116 $infos_message .= "<hr> Theme :" . ($args['theme'] ) ."<br />"; 117 $infos_message .="nombre de destinataire:".$nb_destinataires." <br />" ; 118 119 //================= reecriture de l'entete =============================== 120 $match=array("<",">"); 121 $string=array("<",">") ; 122 123 if ( $nb_destinataires == 1 && $mailto != "" ) 124 { 125 $infos_message .="--> Mailto: " . $mailto." \n" ; 126 127 if ($mailto != "" ) 128 { 129 130 $mailto = $mailto ." \n" ; 131 $headers = preg_replace('/.*Bcc(.*).\n/i', '', $headers); 132 $headers = preg_replace('/.*Cc(.*).\n/i', '', $headers); 133 134 135 } 136 //============================================================================= 94 $alerte_spam = ( $mails_donnees['nb_spams'] > $mails_donnees['nb_spams_maxi']-1 ) ? true : false ; 95 96 if ( ( !$alerte && !$alerte_spam && !$alerte_mail ) ) { 97 $nb_destinataires=0; 98 //==================================================== 99 $match_email = $conf_mail['email_webmaster']; 100 $new_args=array(); 101 foreach($args['Bcc'] as $key => $val){ 102 if (!preg_match('/'. $match_email.'/', $val)){ 103 array_push($new_args, $val); 104 }else{ 105 $mailto = $match_email; 106 } 107 } 108 $args['Bcc']=$new_args; 109 //======================================================================= 110 $nb_destinataires=0; 111 if ($mailto<>"" ) $nb_destinataires +=1; 112 if (!empty($args['Cc'])) { 113 $nb_destinataires += count($args['Cc']); 114 115 } 116 if (!empty($args['Bcc'])) { 117 $nb_destinataires += count($args['Bcc']); 118 } 119 if ($mailto == "" && $nb_destinataires==0 ) { 120 $mailto = $conf_mail['email_webmaster']; 121 $nb_destinataires ++; 122 } 123 124 if ($mails_options['check_mailto'] == 'on') { 125 if ($mailto == "" && $nb_destinataires > 1 ) $mailto = $conf_mail['email_webmaster']; 126 } 127 128 $infos_message .= "nb_destinataires : $nb_destinataires Theme :" . ($args['theme'] ) ."<br />"; 129 //================= réecriture de l'entete =============================== 130 $match=array("<",">"); 131 $string=array("<",">") ; 132 if ( $nb_destinataires == 1 ) { 133 if ($mailto == "" ) { 134 if (!empty($args['Bcc'])){ 135 $mailto = get_strict_email_list(implode(',', $args['Bcc'])); 136 $args['Bcc']=array(); 137 }else{ 138 if (!empty($args['Cc']) ){ $mailto=get_strict_email_list(implode(',', $args['Cc'])); 139 $args['Cc']=array(); 140 }; 141 } 142 } 143 if ($mailto == "" ) {$nb_destinataires = 0 ;} 144 $mailto = $mailto ." \n" ; 145 $headers = preg_replace('/.*Bcc(.*).\n/i', '', $headers); 146 $headers = preg_replace('/.*Cc(.*).\n/i', '', $headers); 147 $infos_message .="Destinataire:" .$mailto ; 148 //============================================================================= 149 150 }else{ 151 //=== plusieurs destinataires =========== 152 $cl_list_mail=""; 153 if ($mailto !="") $infos_message .="To: " . $mailto . " "."<br />" ; 154 if (!empty($args['Cc'])) { 155 $ret= corrige_header('Cc',$headers,$args,$cl_list_mail,$mailto); 156 $headers = $ret->headers; 157 if($ret->list_mail!="") $infos_message .="Cc: " . ( $ret->list_mail)." <br />" ; 137 158 138 139 if (!empty($args['Bcc']) ) $infos_message .="Bcc: " . mail_supervisor::Memo_Var($args['Bcc']) ." \n"; 140 if (!empty($args['Cc']) ) $infos_message .="Cc: " . mail_supervisor::Memo_Var($args['Cc'])." \n" ; 141 $infos_message .="Mailto: [" . $mailto . "]"." \n".$headers; 142 143 }else{ 144 //=== plusieurs destinataires =========== 145 $cl_list_mail=""; 146 147 if ($mailto !="") $infos_message .="To: " . $mailto . " "." /n" ; 148 if (!empty($args['Cc'])) { 149 $ret= corrige_header('Cc',$headers,$args,$cl_list_mail); 150 $headers = $ret->headers; 151 $infos_message .="Cc: " . ( $ret->list_mail)." <br />" ; 152 } 153 if (!empty($args['Bcc'])){ 154 $ret = corrige_header('Bcc',$headers,$args,$cl_list_mail); 155 156 $headers = $ret->headers ; 157 $infos_message .="Bcc: " . ( $ret->list_mail) ." <br />"; 158 } 159 } 160 if (!empty($args['Bcc'])){ 161 $ret = corrige_header('Bcc',$headers,$args,$cl_list_mail,$mailto); 162 $headers = $ret->headers ; 163 if($ret->list_mail!="") $infos_message .="Bcc: " . ( $ret->list_mail) ." <br />"; 164 165 } 166 $infos_message .= " " ; 167 } 168 159 169 160 $infos_message .= " " ;161 }162 // $infos_message .= $content ;163 170 //============================================================================= 164 171 if ($mails_options['check_header_text']=='on') { … … 171 178 $texte .= "\n\n"; 172 179 $content =$texte .$content ; 173 } 174 175 $ret=false; 176 //======== Non mise en quarantaine ============= 180 } 181 // corrige erreur 'mail dropped, bare LF found' 182 /* if ( preg_match('/\n\./',$content)){ 183 $content=preg_replace('/\n\./', '/\n\.\./', $content); 184 185 // $infos_message .= $content ; 186 } 187 $content = str_replace("\n.", "\n/./.", $content); 188 $headers = str_replace("\n.", "\n..", $headers); 189 $subject = str_replace("\n.", "\n..", $subject); 190 $mailto = str_replace("\n.", "\n..", $mailto); 191 */ 192 193 $ret=false; 194 //======== Non mise en quarantaine ============= 195 196 177 197 ob_start(); 178 $ret = false; 179 if ($nb_destinataires > 0) { 180 // corrige erreur 'mail dropped, bare LF found' 181 $content = str_replace("\n.", "\n..", $content); 182 $headers = str_replace("\n.", "\n..", $headers); 183 $subject = str_replace("\n.", "\n..", $subject); 184 $mailto = str_replace("\n.", "\n..", $mailto); 185 if( $envoie_ok) $ret = mail($mailto, $subject, $content, $headers); 186 187 }else{ 188 $message .= l10n('Sv_no_receiver_available'); 189 } 190 $message .= ob_get_contents(); 191 ob_end_clean(); 192 $mails_donnees['message']=$message; 193 Gestion_erreurs($message,$ret,$nb_destinataires,$headers,$mailto); 198 if ($nb_destinataires > 0) { 199 200 if( $envoie_ok) $ret = mail($mailto, $subject,$content, $headers); 201 202 }else{ 203 $message .= l10n('Sv_no_receiver_available'); 204 } 205 $message .= ob_get_contents(); 206 ob_end_clean(); 207 $mails_donnees['message']=$message; 208 Gestion_erreurs($message,$ret,$nb_destinataires,$headers,$mailto); 194 209 } else { 195 210 //================== Est en quarantaine ======================= … … 225 240 } 226 241 $infos_message .= l10n('Sv_mail_not_send'); 227 } 242 } 243 $infos_message .= "<hr>"; 228 244 mail_supervisor::sauve_donnees(); 229 245 mail_supervisor::affiche_message();
Note: See TracChangeset
for help on using the changeset viewer.