Changeset 8917
- Timestamp:
- Jan 26, 2011, 3:59:23 PM (13 years ago)
- Location:
- extensions/Mail_supervisor
- Files:
-
- 2 added
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/Mail_supervisor/admin/mail_black_liste.tpl
r6874 r8917 1 1 {* $Id: mail_black_liste.tpl 3723 2009-08-07 04:53:38Z rvelices $ *} 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"} 2 {html_head} 3 {if PHPWG_VERSION < 2.2 } {include file=$MAIL_SUPERV_PATH_ABS|@cat:'header_2_1.tpl'} 4 {else} {include file= $MAIL_SUPERV_PATH_ABS|@cat:'header_2_2.tpl'} {/if} {/html_head} 4 5 5 6 <script type="text/javascript"> … … 26 27 <table> 27 28 <td><input type="checkbox" name="no_mail_list" value="on" {$no_mail_list} /> {'Sv_no_mail_list'|translate} </td> 28 <td><input type="checkbox" name="no_connect" value="on" {$no_connect} /> {'Sv_no_connect'|translate}</td>29 <td><input type="checkbox" name="set_auto" value="on" {$set_auto} /> {'Sv_set_auto'|translate}</td>29 <td><input type="checkbox" style="visibility:hidden" name="no_connect" value="off" {$no_connect} /> </td> 30 <td><input type="checkbox" style="visibility:hidden" name="set_auto" value="off" {$set_auto} /> </td> 30 31 <td><input type="checkbox" name="set_id" value="on" {$set_id} /> {'Sv_set_id'|translate}</td> 31 32 <tr><p></p><td> -
extensions/Mail_supervisor/admin/mail_superv_admin.php
r7050 r8917 28 28 29 29 if (!defined('MAIL_SUPERV_PATH')) define('MAIL_SUPERV_PATH' , PHPWG_PLUGINS_PATH.basename(dirname(__FILE__)).'/'); 30 if (!defined('MAIL_SUPERV_PATH_ABS')) define('MAIL_SUPERV_PATH_ABS' , dirname(__FILE__).'/'); 30 31 31 32 global $user, $lang, $conf, $errors,$mails_donnees; … … 77 78 78 79 $tabhelp= ' <img src="'.PHPWG_ROOT_PATH. $icon_path .'" width=10px alt="(?)"> '; 79 80 81 82 80 $tabsheet = new tabsheet(); 83 81 $tabsheet->add('mail_superv_admin', … … 98 96 $my_base_url.'&tab=mail_superv_help'); 99 97 100 101 98 $tabsheet->select($page['tab']); 102 99 $tabsheet->assign(); … … 133 130 if (!isset($mails_options[check_header_carbon])) $mails_options[check_header_carbon] = 'off' ; //1 134 131 if (!isset($mails_options[check_mailto])) $mails_options[check_mailto] = 'off' ; //0 135 //================================================================================================ 132 //================================================================================================ 133 $mails_options[set_auto] = 'off' ; 134 $mails_options[no_connect] = 'off' ; 135 136 136 $mails_donnees = Get_Datas(); 137 137 … … 144 144 $aff_nb=true; 145 145 146 147 148 146 // ************************************************************************* 149 147 // | Selection de l'onglet | … … 151 149 152 150 $modif=false ; 153 /* 154 $sql="SELECT * 155 FROM `".$prefixeTable."plugins` 156 WHERE `id` LIKE 'Mail_supervisor' 157 "; 158 $result = @pwg_query($sql); 159 if ($result) { 160 $versions = mysql_fetch_array($result,MYSQL_ASSOC); 161 } 162 $version = $versions['version']; 163 */ 164 $plugin = Get_Version_plugins( MAIL_SUPERV_PATH); 165 $version = $plugin['version'] ; 151 152 $plugin = Get_Version_plugins( MAIL_SUPERV_PATH); 153 $version = $plugin['version'] ; 166 154 //========================================================= 167 155 … … 219 207 } 220 208 221 209 //=================================================================== 222 210 if ( $_POST['submit'] == l10n('Sv_Valider') ) 223 211 { … … 287 275 'version' => $version , 288 276 'MAIL_SUPERV_PATH' => MAIL_SUPERV_PATH , 289 'path_js' => $path_js 277 'path_js' => $path_js, 278 'MAIL_SUPERV_PATH_ABS' => MAIL_SUPERV_PATH_ABS, 279 290 280 ) 291 281 ); 292 282 293 283 $template->set_filenames(array('plugin_admin_content' => realpath(MAIL_SUPERV_PATH . 'admin/mail_superv_admin.tpl'))); 294 $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content'); 284 285 286 $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content'); 295 287 296 288 break; … … 302 294 303 295 case 'mail_superv_test': 304 305 $mails_donnees = Get_Datas() ;306 $group_id = isset($_POST['group']) ? $_POST['group'] : '-1' ;307 if ($group_id >= 0) { 308 $query = ' 309 310 name311 FROM '.GROUPS_TABLE.'312 WHERE id = '.$group_id.'313 ;';314 list($group_name) = mysql_fetch_row(pwg_query($query));296 load_language('plugin.lang', MAIL_SUPERV_PATH); 297 $mails_donnees = Get_Datas() ; 298 $group_id = isset($_POST['group']) ? $_POST['group'] : '-1' ; 299 300 if ($group_id >= 0) { 301 $query = 'SELECT 302 name 303 FROM '.GROUPS_TABLE.' 304 WHERE id = '.$group_id.' 305 ;'; 306 list($group_name) = mysql_fetch_row(pwg_query($query)); 315 307 } else { 316 308 $group_name=""; 317 309 } 310 318 311 //================================================ 319 312 // info by email to an access granted group of category informations 320 if (isset($_POST['submitEmail']) and !empty($_POST['group'])) 313 314 315 if (isset($_POST['Submit']) and !empty($_POST['group'])) 321 316 { 322 317 set_make_full_url(); 318 323 319 /* TODO: if $category['representative_picture_id'] 324 320 is empty find child representative_picture_id */ 325 /* 326 * send en email to user's group 327 * 328 * @param: 329 * - group_id: mail are sent to group with this Id 330 * - email_format: mail format 331 * - keyargs_subject: mail subject on l10n_args format 332 * - dirname: short name of directory including template 333 * - tpl_shortname: short template name without extension 334 * - assign_vars: array used to assign_vars to mail template 335 * - language_selected: send mail only to user with this selected language 336 * 337 * @return boolean (Ok or not) 338 */ 339 340 if (function_exists('get_user_language_desc') ) $titre = get_user_language_desc($conf['gallery_title']); 341 else 342 $titre=$conf['gallery_title']; 343 344 $message = empty($_POST['MAIL_CONTENT']) ? $mails_donnees['message_test'] : stripslashes($_POST['MAIL_CONTENT']); 321 322 323 if (function_exists('get_user_language_desc') ) $titre = get_user_language_desc($conf['gallery_title']); 324 else $titre=$conf['gallery_title']; 325 326 $message = empty($_POST['MAIL_CONTENT']) ? $mails_donnees['message_test'] : stripslashes($_POST['MAIL_CONTENT']); 345 327 346 328 if (function_exists('get_user_language_desc') ) $message = get_user_language_desc($message); 347 // TODO Mettre un array pour traduction subjet 348 349 350 pwg_mail_group( 351 $_POST['group'], 352 get_str_email_format(true), 353 get_l10n_args('[%s] ---> %s', array($titre,'Information') ), //sujet 354 'cat_group_info', // template 355 array 356 ( 357 'CPL_CONTENT' => $message."\n\n".$user['username'] 358 ), 359 '' ); 360 361 362 $mails_donnees['message_test']= str_replace('"',"'",$message) ; 363 unset_make_full_url(); 329 330 if ( $_POST['Submit']==l10n('Sv_Envoyer') ) { 331 /* 332 * send en email to user's group 333 * 334 * @param: 335 * - group_id: mail are sent to group with this Id 336 * - email_format: mail format 337 * - keyargs_subject: mail subject on l10n_args format 338 * - dirname: short name of directory including template 339 * - tpl_shortname: short template name without extension 340 * - assign_vars: array used to assign_vars to mail template 341 * - language_selected: send mail only to user with this selected language 342 * 343 * @return boolean (Ok or not) 344 */ 345 pwg_mail_group( 346 $_POST['group'], 347 get_str_email_format(true), 348 get_l10n_args('[%s] ---> %s', array($titre,'Information') ), //sujet 349 'cat_group_info', // template 350 array ('CPL_CONTENT' => $message."\n\n".$user['username'] ), 351 '' ); 352 353 $mails_donnees['message_test']= str_replace('"',"'",$message) ; 354 355 unset_make_full_url(); 364 356 sauve_donnees(); 365 $mails_donnees = Get_Datas() ; 366 367 $query = ' 368 SELECT 369 name 370 FROM '.GROUPS_TABLE.' 371 WHERE id = '.$_POST['group'].' 372 ;'; 373 list($group_name) = mysql_fetch_row(pwg_query($query)); 374 375 array_push( 376 $page['infos'], 377 sprintf( 378 l10n('An information email was sent to group "%s"'), 379 $group_name 380 ) 381 ); 357 $mails_donnees = Get_Datas() ; 358 $query = 'SELECT 359 name 360 FROM '.GROUPS_TABLE.' 361 WHERE id = '.$_POST['group'].' 362 ;'; 363 list($group_name) = mysql_fetch_row(pwg_query($query)); 364 365 array_push( 366 $page['infos'], 367 sprintf( l10n('An information email was sent to group "%s"'), 368 $group_name ) 369 ); 370 $group_id =-1 ; 371 } 382 372 } 383 load_language('plugin.lang', MAIL_SUPERV_PATH); 384 //===================================================================================== 385 if ( isset($_POST['test_envoie']) ) { 386 $mails_donnees['message_test'] = empty($_POST['MAIL_CONTENT']) ? '' : stripslashes($_POST['MAIL_CONTENT']); 387 $message=$mails_donnees['message_test']; 388 //test_envoie($message,$group_name,$group_id); 389 sauve_donnees(); 390 391 $mails_donnees = Get_Datas() ; 392 393 } 394 373 374 //====================================================================================== 395 375 $groups[-1] = '---------'; 396 397 $query = ' 398 SELECT id, name 399 FROM '.GROUPS_TABLE.' 400 ORDER BY name ASC 401 ;'; 376 $query = ' SELECT id, name 377 FROM '.GROUPS_TABLE.' 378 ORDER BY name ASC 379 ;'; 402 380 403 381 $result = pwg_query($query); 404 382 //---------------------------------------------------------------- 405 383 while ($row = mysql_fetch_array($result,MYSQL_ASSOC)) 406 { 407 $groups[$row['id']] = $row['name']; 408 } 384 { $groups[$row['id']] = $row['name']; } 409 385 //--------------------------------------------------------------- 410 386 if ( isset($_POST['Submit'])) $group_id=-1; 411 387 $template->assign( 412 388 'Group', 413 array( 414 'group_options'=> $groups, 415 'selected' => $group_id 389 array( 'group_options'=> $groups, 390 'selected' => $group_id 416 391 ) 417 392 ); 418 393 //================================================================= 419 394 $destinataires= implode("<br />",get_liste($group_id)); 395 if( $destinataires !="" ) 396 $infos_message .= " List :<hr>" . $destinataires . "<hr>" ; 397 420 398 $template->assign( 421 399 array( 422 'Groupe' => $groups, 423 'message_test' => $mails_donnees['message_test'] , 424 'liste' => $destinataires , 425 'version' => $version , 426 'MAIL_CONTENT' => $mails_donnees['message_test'], 427 'path_js' => $path_js 400 'Groupe' => $groups, 401 'message_test' => $mails_donnees['message_test'] , 402 'liste' => $destinataires , 403 'version' => $version , 404 'MAIL_CONTENT' => $mails_donnees['message_test'], 405 'path_js' => $path_js, 406 'MAIL_SUPERV_PATH_ABS' => MAIL_SUPERV_PATH_ABS, 407 'MAIL_SUPERV_PATH' => MAIL_SUPERV_PATH , 428 408 ) 429 409 ); 430 410 431 $template->set_filenames(array('plugin_admin_content' => realpath(MAIL_SUPERV_PATH . 'admin/mail_superv_test.tpl'))); 432 $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content'); 433 434 $toolbar = 'Basic'; 435 $width = '750px'; 436 $height = '200px'; 437 $areas = array(); 438 $areas[]='MAIL_CONTENT'; 439 // $areas[]= 'MAIL_CONTENT'; 440 if (!empty($areas)) 441 { 442 if (function_exists('set_fckeditor_instance')) 443 set_fckeditor_instance($areas, $toolbar, $width, $height); 444 } 445 411 $template->set_filenames(array('plugin_admin_content' => realpath(MAIL_SUPERV_PATH . 'admin/mail_superv_test.tpl'))); 412 $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content'); 413 //========================================================================= 414 $toolbar = 'Basic'; 415 $width = '750px'; 416 $height = '200px'; 417 $areas = array(); 418 $areas[]='MAIL_CONTENT'; 419 if (!empty($areas)){ 420 if (function_exists('set_fckeditor_instance')) 421 set_fckeditor_instance($areas, $toolbar, $width, $height); 422 } 423 446 424 break; 447 425 // ************************************************************************* … … 453 431 //------------------------------------------------------------------------------------ 454 432 $mails_options[no_mail_list] = isset($_POST['no_mail_list']) ? $_POST['no_mail_list'] : $mails_options[no_mail_list] ; 455 $mails_options[no_connect] = isset($_POST['no_connect']) ? $_POST['no_connect'] : $mails_options[no_connect] ;456 $mails_options[set_auto] = isset($_POST['set_auto']) ? $_POST['set_auto'] : $mails_options[set_auto] ;433 $mails_options[no_connect] = 'off' ;//isset($_POST['no_connect']) ? $_POST['no_connect'] : $mails_options[no_connect] ; 434 $mails_options[set_auto] = 'off' ;//isset($_POST['set_auto']) ? $_POST['set_auto'] : $mails_options[set_auto] ; 457 435 //======================================================================================= 458 436 $info_ip = (isset($info_ip)) ? $info_ip : '' ; … … 485 463 { 486 464 $mails_options[no_mail_list] = isset($_POST['no_mail_list']) ? $_POST['no_mail_list'] : "off" ; 487 $mails_options[no_connect] = isset($_POST['no_connect']) ? $_POST['no_connect'] : "off" ;488 $mails_options[set_auto] = isset($_POST['set_auto']) ? $_POST['set_auto'] : "off" ;465 $mails_options[no_connect] ='off' ;// isset($_POST['no_connect']) ? $_POST['no_connect'] : "off" ; 466 $mails_options[set_auto] = 'off' ;//isset($_POST['set_auto']) ? $_POST['set_auto'] : "off" ; 489 467 $mails_options[set_id] = isset($_POST['set_id']) ? $_POST['set_id'] : "off" ; 490 468 sauve_options(); … … 518 496 $template->assign( 519 497 array( 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 498 'start' => $params['start'], 499 'per_page' => $params['per_page'] , 500 'maxipage' => $maxipage , 501 'smile_bonjour' => $smile_bonjour , 502 'img_logo' => $img_logo , 503 'champs_ip' => $champs_ip , 504 'liste_ip' => $liste_ip, 505 'champs_bl' => $champs_bl , 506 'liste_bl' => $liste_bl , 507 //'conf_admin_layout' => $conf['admin_layout'] , 508 'istype' => $istype , 509 'ip_black' => $ip_black , 510 'IS_SPAM' => test_spam( $ip_black), 511 'ip_black_len' => strlen($ip_black) , 512 'MAIL_SUPERV_PATH' => MAIL_SUPERV_PATH , 513 'path_js' => $path_js , 514 'F_ACTION' => $f_action , 537 515 538 516 'no_mail_list' => ($mails_options[no_mail_list] == 'on') ? 'checked="checked"' : '' , 539 517 'no_connect' => ($mails_options[no_connect] == 'on') ? 'checked="checked"' : '' , 540 'set_auto' => ($mails_options[set_auto] == 'on') ? 'checked="checked"' : '' , 541 'set_id' => ($mails_options[set_id] == 'on') ? 'checked="checked"' : '' , 542 'IP' => $ip , 543 'PAYS' => $pays , 544 'VILLE' => $ville , 545 'REGION' => $region , 546 'version' => $version , 518 'set_auto' => ($mails_options[set_auto] == 'on') ? 'checked="checked"' : '' , 519 'set_id' => ($mails_options[set_id] == 'on') ? 'checked="checked"' : '' , 520 'IP' => $ip , 521 'PAYS' => $pays , 522 'VILLE' => $ville , 523 'REGION' => $region , 524 'version' => $version , 525 'MAIL_SUPERV_PATH_ABS' => MAIL_SUPERV_PATH_ABS, 547 526 ) 548 527 ); … … 567 546 'version' => $version , 568 547 'MAIL_SUPERV_PATH' => MAIL_SUPERV_PATH , 569 'path_js' => $path_js 548 'path_js' => $path_js, 549 'MAIL_SUPERV_PATH_ABS' => MAIL_SUPERV_PATH_ABS 570 550 ) 571 551 ); -
extensions/Mail_supervisor/admin/mail_superv_admin.tpl
r5670 r8917 1 { known_script id="jquery" src= $ROOT_URL|@cat:$path_js|@cat:"jquery.packed.js"}2 { known_script id="jquery.cluetip" src=$ROOT_URL|@cat:$path_js|@cat:"plugins/jquery.cluetip.packed.js"}1 {html_head} {if PHPWG_VERSION < 2.2 } {include file=$MAIL_SUPERV_PATH_ABS|@cat:'header_2_1.tpl'} 2 {else} {include file= $MAIL_SUPERV_PATH_ABS|@cat:'header_2_2.tpl'} {/if} {/html_head} 3 3 4 4 <script type="text/javascript"> -
extensions/Mail_supervisor/admin/mail_superv_help.tpl
r7050 r8917 1 {known_script id="jquery" src= $ROOT_URL|@cat:$path_js|@cat:"jquery.packed.js"} 2 {known_script id="jquery.cluetip" src=$ROOT_URL|@cat:$path_js|@cat:"plugins/jquery.cluetip.packed.js"} 3 4 {known_script id="my_script" src= $MAIL_SUPERV_PATH|@cat:"include/Scripts.js"} 1 {html_head} {if PHPWG_VERSION < 2.2 } {include file=$MAIL_SUPERV_PATH_ABS|@cat:'header_2_1.tpl'} 2 {else} {include file= $MAIL_SUPERV_PATH_ABS|@cat:'header_2_2.tpl'} {/if} {/html_head} 5 3 <div class="instructions" > 6 4 <h2>{'Sv_Tab_help'|translate}{'Sv_version'|translate}{$version}</h2> -
extensions/Mail_supervisor/admin/mail_superv_test.tpl
r6874 r8917 1 {known_script id="jquery" src= $ROOT_URL|@cat:$path_js|@cat:"jquery.packed.js"} 2 {known_script id="jquery.cluetip" src=$ROOT_URL|@cat:$path_js|@cat:"plugins/jquery.cluetip.packed.js"} 3 1 {html_head} {if PHPWG_VERSION < 2.2 } {include file=$MAIL_SUPERV_PATH_ABS|@cat:'header_2_1.tpl'} 2 {else} {include file= $MAIL_SUPERV_PATH_ABS|@cat:'header_2_2.tpl'} {/if} {/html_head} 4 3 <div class="titrePage"> 5 4 <h2>{'Sv_supervisor'|translate}{'Sv_version'|translate}{$version}</h2> … … 21 20 </select> 22 21 </td> 23 <td>24 {$liste}25 </td>22 <td > 23 {$liste} 24 </td> 26 25 </tr> 27 26 … … 36 35 </fieldset> 37 36 <p> 38 <input class="submit" type="submit" name=" raffraichir" value="{'Sv_refresh'|translate}"/>39 <input class="submit" type="submit" name=" test_envoie" value="{'Sv_Test'|translate}"/>40 <input class="submit" type="submit" value="{'Submit'|@translate}" name="submitEmail" {$tag_input_enabled}/>37 <input class="submit" type="submit" name="Submit" value="{'Sv_refresh'|@translate}" {$tag_input_enabled} /> 38 <input class="submit" type="submit" name="Submit" id="Envoyer" value="{'Sv_Envoyer'|@translate}" {$tag_input_enabled} /> 39 41 40 </p> 42 41 </fieldset> -
extensions/Mail_supervisor/include/Scripts.js
r5671 r8917 1 function blockToggleDisplay(headerId, contentId) 2 { 1 function blockToggleDisplay(headerId, contentId){ 3 2 var revHeader = document.getElementById(headerId); 4 3 var revContent = document.getElementById(contentId); -
extensions/Mail_supervisor/include/fonctions.php
r7050 r8917 29 29 if (!defined('MAIL_SUPERV_PATH')) define('MAIL_SUPERV_PATH' , PHPWG_PLUGINS_PATH.basename(dirname(__FILE__)).'/'); 30 30 31 define ("check_mailto", 0); define ("check_header_carbon",1); define ("check_header_text",2); 32 define ("no_mail_list", 3); define ("no_connect",4); define ("set_auto",5); 33 define ("ip",6); define ("set_id",7); 31 define ("check_mailto", 0); 32 define ("check_header_carbon",1); 33 define ("check_header_text",2); 34 define ("no_mail_list", 3); 35 define ("no_connect",4); // empeche l'ip de se connecter au site. 36 define ("set_auto",5); // Test a l'ouverture et enregistrement 37 define ("ip",6); // dernirre adresse IP 38 define ("set_id",7); // enregistrment nouvel 34 39 35 40 … … 288 293 //=============================================== 289 294 290 function corrige_header($Carbonne,$headers,$args )295 function corrige_header($Carbonne,$headers,$args,$cl_list_mail) 291 296 { 292 297 global $mails_options,$conf_mail,$mailto,$infos_message; … … 294 299 if (!empty($args[$Carbonne])) 295 300 { 296 297 if ( count($args[$Carbonne]) > 0 ) 301 if ( count($args[$Carbonne]) > 0 ) 298 302 { 299 if ($mails_options[check_header_carbon] == 'on') {300 $list_mail = str_replace(","," ,",get_strict_email_list(implode(',', $args[$Carbonne])))." \n";301 $headers = preg_replace('/.*'.$Carbonne.'(.*).\n/i', $Carbonne.': '.$list_mail, $headers);302 }303 if ($mails_options[check_header_carbon] == 'on') { 304 $cl_list_mail = str_replace(","," , ",get_strict_email_list(implode(',', $args[$Carbonne])))." \n" ; 305 $headers = preg_replace('/.*'.$Carbonne.'(.*).\n/i', $Carbonne.': '.$cl_list_mail, $headers); 306 } 303 307 } 308 304 309 } else { 305 // Raz Bcc, Cc dans headers310 // Raz Bcc, Cc dans headers 306 311 $headers = preg_replace('/.*'.$Carbonne.'(.*).\n/i', "" , $headers); 307 312 } 308 313 309 310 return $headers; 314 $headers = str_replace("\n.", "\n..",$headers ); 315 $ret->headers = $headers ; 316 $ret->list_mail = $cl_list_mail ; 317 return $ret; 311 318 312 319 … … 433 440 u.'.$conf['user_fields']['email'].' AS email, 434 441 ui.status, 435 ui.adviser,436 442 ui.enabled_high, 437 443 ui.level … … 765 771 //======================================================================= 766 772 767 if ($mails_options[set_auto] == ' on')773 if ($mails_options[set_auto] == 'nonoui') // ne plus tester automatiquement . 768 774 { 769 775 // $ip="94.102.63.13"; ' Spammeurs … … 887 893 function test_spam($ip =0,$user_name ='', $mail_adresse = "") 888 894 { 889 $buffer=""; 895 $buffer=""; 896 global $page,$infos_message; 890 897 891 898 // fretgpsolodens 892 $src = "" ;//"http://www.stopforumspam.com/api?";893 $type=array();894 $result="";899 $src = "http://www.stopforumspam.com/api?"; 900 $type=array(); 901 $result=""; 895 902 if (strlen($ip)>3) { 896 903 //================== Verifie si l'IP est correct ================================ 897 904 if (clj_is_ip($ip)){ 898 905 899 906 } else { 900 907 //================== Verifie si l'adresse mail est correcte ================================ 901 908 if( clj_is_mail($ip) ){ 902 909 $mail_adresse=$ip ; 903 910 $ip=""; 904 911 } … … 921 928 if ( strlen($mail_adresse) > 3) $type[]="email=".$mail_adresse ; 922 929 if ( strlen($ip) > 3) $type[]="ip=".$ip ; 923 930 924 931 foreach ( $type as $fil ) 925 932 { 926 933 $resultat=""; 927 934 if ( clj_fetchRemote($src.$fil , $resultat,1)) 928 935 { 929 $result .= $resultat.'<br />' ;936 $result .= $resultat.'<br />' ; 930 937 } else { 931 938 932 939 } 940 933 941 } 934 942 … … 960 968 function clj_is_mail($mail) 961 969 { 970 971 if(preg_match('/^[\w.-]+@[\w.-]+\.[a-zA-Z]{2,5}$/' ,$mail)) return true ; 962 972 if(preg_match('/#^[\w.-]+@[\w.-]+\.[a-zA-Z]{2,5}$#/' ,$mail)) return true ; 963 973 } … … 967 977 { 968 978 // Try to retrieve data from local file? 979 // http://www.stopforumspam.com/api?ip=95.211.1.39 980 981 if ($src=="") return ; 982 969 983 if (!url_is_remote($src)) 970 984 { 985 971 986 $content = @file_get_contents($src); 972 987 if ($content !== false) … … 980 995 } 981 996 } 982 997 983 998 // After 3 redirections, return false 984 999 if ($step > 3) return false; … … 1072 1087 1073 1088 } 1089 1090 1091 1074 1092 ?> -
extensions/Mail_supervisor/include/function_test_send.php
r7050 r8917 226 226 } 227 227 228 228 229 ?> -
extensions/Mail_supervisor/language/fr_FR/plugin.lang.php
r7050 r8917 1 1 <?php 2 2 global $lang ; 3 4 3 //=================================================== 5 4 if( !isset($lang['Minute'])) $lang['Minute'] = l10n('Minute') ; 6 5 if( !isset($lang['Second'])) $lang['Second'] = l10n('Seconde'); 7 8 6 //======================================================= 9 7 $lang['Sv_Datas'] = 'Datas' ; … … 20 18 $lang['Sv_Test'] = 'Test'; 21 19 20 $lang['Sv_Envoyer'] = 'Envoyer'; 22 21 $lang['Sv_Valider'] = 'Valider'; 23 22 $lang['Sv_version'] = ' Version :'; … … 51 50 $lang['Sv_message_to_send'] = 'Message a envoyer.'; 52 51 $lang['Sv_verifiez_les_destinataires']='Vérifiez les destinataires:'; 53 $lang['Sv_detection_de'] ='Détection de :';54 $lang['Sv_Tab_set'] = 'Initialisation';55 $lang['Sv_Tab_test'] = 'Test';56 $lang['Sv_Tab_help'] = 'Aide';52 $lang['Sv_detection_de'] = 'Détection de :' ; 53 $lang['Sv_Tab_set'] = 'Initialisation'; 54 $lang['Sv_Tab_test'] = 'Test'; 55 $lang['Sv_Tab_help'] = 'Aide'; 57 56 58 57 $lang['Sv_Howto'] = 'Gestion des parametres de surveillance d\' envoie des mails.'; … … 105 104 ' Le %s <br />' ; 106 105 107 $lang['Sv_debug_message %s %s %s %s %s']= '<br />---- La fonction mail à retourné [%s] ------ 108 -------- MESSAGE erreur : ------------- 109 [ %s ] 110 mailto: "%s" 111 -------- HEADERS ----------------- 112 %s 113 -------- Nombre de destinataires ---- 114 %s 115 '; 116 $lang['Sv_message_texte %s %s %s %s'] =' 106 $lang['Sv_debug_message']= ' 107 La fonction mail à retourné [%s] <br /> 108 MESSAGE erreur : [ %s ] <br /> 109 mailto: [ %s ] <br /> 110 HEADERS: [ %s ] <br /> 111 Nombre de destinataires [ %s ]<br /> 112 '; 113 114 $lang['Sv_message_texte "%s" "%s" "%s" "%s"'] =' 117 115 %s 118 116 '. l10n('hello') .' "%s" , -
extensions/Mail_supervisor/main.inc.php
r7050 r8917 2 2 /* 3 3 Plugin Name: Mail supervisor 4 Version: 1.4. 24 Version: 1.4.4 Beta 5 5 Description: Mail supervisor surveille l'envoie des mails. 6 6 Plugin URI: http://piwigo.org/ext/extension_view.php?eid=315 … … 16 16 17 17 global $conf ; 18 19 20 18 add_event_handler('send_mail', 'clj_mail',EVENT_HANDLER_PRIORITY_NEUTRAL - 1 , 6); 21 19 function clj_mail($result, $mailto, $subject, $content, $headers, $args) … … 23 21 global $conf, $user, $lang_info, $conf_mail,$mails_options,$mails_donnees , $template,$page ,$erreur_message,$infos_message, $lang; 24 22 // lecture config table ------------- 25 include_once (MAIL_SUPERV_PATH.'include/fonctions.php');23 include_once (MAIL_SUPERV_PATH.'include/fonctions.php'); 26 24 load_language('plugin.lang', MAIL_SUPERV_PATH); 25 26 if (isset($_POST["Submit"]) ) 27 { 28 if ($_POST["Submit"] != l10n('Sv_Envoyer') ) return true ; 29 } 30 $message =""; 31 if (!isset($infos_message)) 32 { 33 $infos_message = ""; 34 } 35 if (!isset($erreur_message)) 36 { 37 $erreur_message = ''; 38 } 27 39 $mails_options = explode("," , $conf['mail_superv']); 28 40 //======== verification si envoie de mail ou blocage connexion ===================== … … 51 63 } 52 64 53 $message =""; 54 if (!isset($infos_message)) 55 { 56 $infos_message = ""; 57 } 58 if (!isset($erreur_message)) 59 { 60 $erreur_message = ''; 61 } 65 62 66 // lecture donnees ------------- 63 67 $mails_donnees = Get_Datas(); … … 96 100 if ($mailto<>"" ) $nb_destinataires +=1; 97 101 98 if (!empty($args['Bcc'])) { 99 $nb_destinataires += count($args['Bcc']); 100 } 101 if (!empty($args['Cc'])) { 102 $nb_destinataires += count($args['Cc']); 103 } 104 //================= reecriture de l'entête =============================== 105 if ( $nb_destinataires == 1 ) 106 { 107 if ($mailto == "" ) 102 if (!empty($args['Bcc'])) { $nb_destinataires += count($args['Bcc']); } 103 if (!empty($args['Cc'])) { $nb_destinataires += count($args['Cc']); } 104 105 106 $infos_message .= "<hr> Theme :" . ($args['theme'] ) ."<br />"; 107 $infos_message .="nombre de destinataire:".$nb_destinataires." <br />" ; 108 109 //================= reecriture de l'entete =============================== 110 $match=array("<",">"); 111 $string=array("<",">") ; 112 113 if ( $nb_destinataires == 1 && $mailto != "" ) 114 { 115 $infos_message .="--> Mailto: " . $mailto." \n" ; 116 117 if ($mailto != "" ) 108 118 { 109 if (!empty($args['Cc']) and count($args['Cc']) > 0 ) $mailto = get_strict_email_list(implode(',', $args['Cc'])) ; 110 if (!empty($args['Bcc']) and count($args['Bcc']) > 0 ) $mailto = get_strict_email_list(implode(',', $args['Bcc']));111 112 $headers = preg_replace('/.*Bcc(.*).\n/i', '', $headers);113 $headers = preg_replace('/.*Cc(.*).\n/i', '', $headers); 114 119 120 $mailto = $mailto ." \n" ; 121 $headers = preg_replace('/.*Bcc(.*).\n/i', '', $headers); 122 $headers = preg_replace('/.*Cc(.*).\n/i', '', $headers); 123 124 115 125 } 126 //============================================================================= 127 128 129 if (!empty($args['Bcc']) ) $infos_message .="Bcc: " . memo_var($args['Bcc']) ." \n"; 130 if (!empty($args['Cc']) ) $infos_message .="Cc: " . memo_var($args['Cc'])." \n" ; 131 $infos_message .="Mailto: [" . $mailto . "]"." \n".$headers; 132 116 133 }else{ 117 118 119 } 120 121 //============================================================================= 122 if (!empty($args['Cc'])) 123 { 124 $headers= corrige_header('Cc',$headers,$args); 125 } 126 if (!empty($args['Bcc'])) 127 { 128 $headers = corrige_header('Bcc',$headers,$args); 129 } 130 //============================================================================= 134 //=== plusieurs destinataires =========== 135 $cl_list_mail=""; 136 137 if ($mailto !="") $infos_message .="To: " . $mailto . " "." /n" ; 138 if (!empty($args['Cc'])) { 139 $ret= corrige_header('Cc',$headers,$args,$cl_list_mail); 140 $headers = $ret->headers; 141 $infos_message .="Cc: " . ( $ret->list_mail)." <br />" ; 142 } 143 if (!empty($args['Bcc'])){ 144 $ret = corrige_header('Bcc',$headers,$args,$cl_list_mail); 145 146 $headers = $ret->headers ; 147 $infos_message .="Bcc: " . ( $ret->list_mail) ." <br />"; 148 } 149 150 $infos_message .= " " ; 151 } 152 // $infos_message .= $content ; 153 //============================================================================= 131 154 if ($mails_options[check_header_text]=='on') { 132 155 … … 145 168 146 169 $ret=false; 147 170 148 171 //======== Non mise en quarantaine ============= 149 172 ob_start(); 150 173 $ret = false; 151 174 if ($nb_destinataires > 0) { 152 $ret = mail($mailto, $subject, $content, $headers); 153 175 // corrige erreur 'mail dropped, bare LF found' 176 $content = str_replace("\n.", "\n..", $content); 177 $headers = str_replace("\n.", "\n..", $headers); 178 $subject = str_replace("\n.", "\n..", $subject); 179 $mailto = str_replace("\n.", "\n..", $mailto); 180 $ret = mail($mailto, $subject, $content, $headers); 181 154 182 }else{ 155 183 $message .= l10n('Sv_no_receiver_available'); … … 204 232 205 233 } 206 $infos_message = l10n('Sv_mail_not_send');234 $infos_message .= l10n('Sv_mail_not_send'); 207 235 208 236 } … … 219 247 $match=array("<",">"); 220 248 $string=array("<",">") ; 221 222 249 //Warning: mail() has been disabled for security reasons 223 250 … … 229 256 $pos1 = strpos(strtolower($message), 'bad recipient address syntax'); 230 257 if ( !($pos1 === false) ){ 231 $erreur_message .= l10n('Sv_detection_de').' :Bad recipient address syntax .';258 $erreur_message .= l10n('Sv_detection_de').' Bad recipient address syntax .'; 232 259 $erreur_message .= l10n('Sv_verifiez_les_destinataires').' (Bcc,Cc,To)<br />'; 233 260 } 234 261 235 $erreur_message .= sprintf(l10n('Sv_debug_message %s %s %s %s %s'),($ret==true)? "true" : "false",$message,$mailto,$headers,$nb_destinataires); 236 //=============== La fonction mail à retourneeune erreur ========================= 262 $erreur_message .= sprintf(l10n('Sv_debug_message'), 263 ($ret==true)? "true" : "false", 264 $message , 265 $mailto , 266 $headers , 267 $nb_destinataires ); 268 //=============== La fonction mail retourneeune erreur ========================= 237 269 238 270 … … 260 292 261 293 } 262 263 264 265 266 294 $ret=true; 267 295 return $ret ; … … 289 317 include_once (MAIL_SUPERV_PATH.'include/fonctions.php'); 290 318 $mails_options = explode("," , $conf['mail_superv']); 291 319 292 320 //========================================================================================== 293 321 if ($mails_options[set_id]=='on' ) { … … 301 329 //Liableelard 302 330 include_once (MAIL_SUPERV_PATH.'include/fonctions.php'); 331 303 332 if ( isset($_POST['submit'])) { 304 333 $mail = $_POST['mail_address'] ; … … 308 337 $user_name = $user['username']; 309 338 } 310 $user_name =""; // suppression du test sur user name.339 $user_name =""; // suppression du test sur user name. 311 340 $ip='0'; 341 312 342 if (test_spam($ip,$user_name ,$mail )) 313 343 { 314 if (test_spam($ip,$user_name ,"" )) {315 $err[] = $user_name . " ". l10n('Sv_is_a_login_spam') ;316 }else344 //if (test_spam($ip,$user_name ,"" )) { 345 // $err[] = $user_name . " ". l10n('Sv_is_a_login_spam') ; 346 // }else 317 347 $err[] = $user_name . " : " .$mail . " ". l10n('Sv_is_a_spam') ; 318 348 } … … 320 350 return $err ; 321 351 } 352 353 322 354 ?>
Note: See TracChangeset
for help on using the changeset viewer.