Changeset 4861
- Timestamp:
- Feb 9, 2010, 10:52:34 AM (14 years ago)
- Location:
- extensions/Mail_supervisor
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/Mail_supervisor/admin/mail_superv_admin.php
r4721 r4861 89 89 90 90 $mails_options = explode("," , $conf['mail_superv']); 91 if (!isset($mails_options[ 7])) $mails_options[7] = 'off' ; //set_id92 if (!isset($mails_options[ 6])) $mails_options[6] = $ip ;93 if (!isset($mails_options[ 5])) $mails_options[5] = 'off' ;94 if (!isset($mails_options[ 4])) $mails_options[4] = 'off' ;95 if (!isset($mails_options[ 3])) $mails_options[3] = 'off' ;91 if (!isset($mails_options[set_id])) $mails_options[set_id] = 'off' ; // 7 92 if (!isset($mails_options[ip])) $mails_options[ip] = $ip ; //6 93 if (!isset($mails_options[set_auto])) $mails_options[set_auto] = 'off' ; //5 94 if (!isset($mails_options[no_connect])) $mails_options[no_connect] = 'off' ; //4 95 if (!isset($mails_options[no_mail_list])) $mails_options[no_mail_list] = 'off' ; //3 96 96 97 if (!isset($mails_options[ 2])) $mails_options[2] = 'off' ;98 if (!isset($mails_options[ 1])) $mails_options[1] = 'off' ;99 if (!isset($mails_options[ 0])) $mails_options[0] = 'off' ;97 if (!isset($mails_options[check_header_text])) $mails_options[check_header_text] = 'off' ; //2 98 if (!isset($mails_options[check_header_carbon])) $mails_options[check_header_carbon] = 'off' ; //1 99 if (!isset($mails_options[check_mailto])) $mails_options[check_mailto] = 'off' ; //0 100 100 101 101 $mails_données = Get_Datas(); … … 124 124 } 125 125 $version= $versions['version']; 126 if (!isset($ip)) { 127 if (getenv("HTTP_CLIENT_IP")) 128 { $ip=getenv("HTTP_CLIENT_IP"); } 129 else{ $ip=getenv("REMOTE_ADDR"); } 130 } 126 131 //================================================================================ 127 132 switch ($page['tab']) … … 175 180 { 176 181 177 $mails_options[ 0] = isset($_POST['check_mailto']) ? $_POST['check_mailto'] : 'off' ;178 $mails_options[ 1] = isset($_POST['check_header_carbon']) ? $_POST['check_header_carbon'] : 'off' ;179 $mails_options[ 2] = isset($_POST['check_header_text']) ? $_POST['check_header_text'] : 'off' ;182 $mails_options[check_mailto] = isset($_POST['check_mailto']) ? $_POST['check_mailto'] : 'off' ; 183 $mails_options[check_header_carbon] = isset($_POST['check_header_carbon']) ? $_POST['check_header_carbon'] : 'off' ; 184 $mails_options[check_header_text] = isset($_POST['check_header_text']) ? $_POST['check_header_text'] : 'off' ; 180 185 181 186 //données … … 210 215 $template->assign( 211 216 array( 212 'check_mailto' => ($mails_options[ 0] == 'on') ? 'checked="checked"' : '' ,213 'check_header_carbons' => ($mails_options[ 1] == 'on') ? 'checked="checked"' : '' ,214 'check_header_text' => ($mails_options[ 2] == 'on') ? 'checked="checked"' : '' ,217 'check_mailto' => ($mails_options[check_mailto] == 'on') ? 'checked="checked"' : '' , 218 'check_header_carbons' => ($mails_options[check_header_carbon] == 'on') ? 'checked="checked"' : '' , 219 'check_header_text' => ($mails_options[check_header_text] == 'on') ? 'checked="checked"' : '' , 215 220 216 221 … … 328 333 $aff_nb=false; 329 334 //------------------------------------------------------------------------------------ 330 331 $mails_options[3] = isset($_POST['no_mail_list']) ? $_POST['no_mail_list'] : $mails_options[3] ; 332 $mails_options[4] = isset($_POST['no_connect']) ? $_POST['no_connect'] : $mails_options[4] ; 333 $mails_options[5] = isset($_POST['no_connect']) ? $_POST['no_connect'] : $mails_options[5] ; 335 $mails_options[no_mail_list] = isset($_POST['no_mail_list']) ? $_POST['no_mail_list'] : $mails_options[no_mail_list] ; 336 $mails_options[no_connect] = isset($_POST['no_connect']) ? $_POST['no_connect'] : $mails_options[no_connect] ; 337 $mails_options[set_auto] = isset($_POST['set_auto']) ? $_POST['set_auto'] : $mails_options[set_auto] ; 334 338 335 339 //======================================================================================= … … 363 367 if ( $_POST['submit'] == l10n('Valider') ) 364 368 { 365 $mails_options[ 3] = isset($_POST['no_mail_list']) ? $_POST['no_mail_list'] : "off" ;366 $mails_options[ 4] = isset($_POST['no_connect']) ? $_POST['no_connect'] : "off" ;367 $mails_options[ 5] = isset($_POST['set_auto']) ? $_POST['set_auto'] : "off" ;368 $mails_options[ 7] = isset($_POST['set_auto']) ? $_POST['set_id'] : "off" ;369 $mails_options[no_mail_list] = isset($_POST['no_mail_list']) ? $_POST['no_mail_list'] : "off" ; 370 $mails_options[no_connect] = isset($_POST['no_connect']) ? $_POST['no_connect'] : "off" ; 371 $mails_options[set_auto] = isset($_POST['set_auto']) ? $_POST['set_auto'] : "off" ; 372 $mails_options[set_id] = isset($_POST['set_id']) ? $_POST['set_id'] : "off" ; 369 373 sauve_options(); 370 374 $infos_message .= l10n('save_config') . '<br />'; … … 400 404 'F_ACTION' => $f_action , 401 405 402 'no_mail_list' => ($mails_options[ 3] == 'on') ? 'checked="checked"' : '' ,403 'no_connect' => ($mails_options[ 4] == 'on') ? 'checked="checked"' : '' ,404 'set_auto' => ($mails_options[ 5] == 'on') ? 'checked="checked"' : '' ,405 'set_id' => ($mails_options[ 7] == 'on') ? 'checked="checked"' : '' ,406 'no_mail_list' => ($mails_options[no_mail_list] == 'on') ? 'checked="checked"' : '' , 407 'no_connect' => ($mails_options[no_connect] == 'on') ? 'checked="checked"' : '' , 408 'set_auto' => ($mails_options[set_auto] == 'on') ? 'checked="checked"' : '' , 409 'set_id' => ($mails_options[set_id] == 'on') ? 'checked="checked"' : '' , 406 410 'IP' => $ip , 407 411 'PAYS' => $pays , -
extensions/Mail_supervisor/include/fonctions.php
r4721 r4861 29 29 if (!defined('MAIL_SUPERV_PATH')) define('MAIL_SUPERV_PATH' , PHPWG_PLUGINS_PATH.basename(dirname(__FILE__)).'/'); 30 30 31 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); 34 35 32 36 if (!isset($_COOKIE[session_name()])) 33 37 { … … 107 111 function affiche_message() 108 112 { 109 global $template,$infos_message,$erreur_message, $user ;;113 global $template,$infos_message,$erreur_message, $user ,$ip; 110 114 111 115 global $mails_options,$conf,$lang ; 112 116 113 117 $mails_options = explode("," , $conf['mail_superv']); 114 115 if ( count($_POST)==5 || count($_POST)==0 ) { 116 $action_spam = pwg_get_session_var('action_spam') ; 117 if (!$action_spam) 118 { 119 pwg_set_session_var('action_spam', "true"); 120 if (kill_list()) 121 { 118 if (!isset($ip)) { 119 if (getenv("HTTP_CLIENT_IP")) 120 { $ip=getenv("HTTP_CLIENT_IP"); } 121 else{ $ip=getenv("REMOTE_ADDR"); } 122 } 123 // unset ($_SESSION['pwg_'.'action_spam']); 124 $action_spam = pwg_get_session_var('action_spam') ; 125 if ($action_spam == null) { $action_spam = kill_list(); } 126 127 if (is_bool($action_spam)) $action_spam =($action_spam == true) ? "true" : "false" ; 128 if ($action_spam == "true" ) 129 { 130 $erreur_message = $ip . " " . $action_spam ; 122 131 pwg_set_session_var('action_spam', "true"); 123 124 132 $erreur_message .= "<BR />".l10n('is_a_spam') ; 125 if ($mails_options[4] == 'on' ){ 126 127 //[status] => guest 128 //[status] => normal 129 //[status] => webmaster 130 133 if ($mails_options[no_connect] == 'on' ){ 134 //[status] => guest 135 //[status] => normal 136 //[status] => webmaster 131 137 if ($user['status'] != 'webmaster' ) 132 138 if (!isset($_GET['admin'])) { … … 136 142 die('blacklist Hacking attempt!'); 137 143 } 144 unset ($_SESSION['pwg_'.'action_spam']); 138 145 } 139 140 141 146 }else{ 142 147 pwg_set_session_var('action_spam', "false"); 143 148 } 144 } 145 } 149 150 151 // } 146 152 147 153 //============================================================== … … 180 186 //=================================================================================== 181 187 $info_geo = pwg_get_session_var('info_geo'); 182 188 print_r($info_geo ); 183 189 if (count($info_geo) > 0) 184 190 { … … 208 214 209 215 $result=""; 210 $src = "http://j.maxmind.com/app/geoip.js" ;211 if ( !clj_fetchRemote($src , $result,1))212 {213 ?>214 <script language="JavaScript" type="text/javascript">215 var pays = "EARTH";216 var ville = "NOWHERE";217 var region = "UNIVERS";218 var latitude = '0';219 var longitude = '0';220 </script>221 <?php222 223 }else{224 225 226 216 ?> 227 217 <script language="JavaScript" src="http://j.maxmind.com/app/geoip.js" type="text/javascript" > … … 235 225 236 226 </script> 237 <?php238 }239 240 ?>241 227 <form action="" method="post" name="form_connexion" id="form_connexion" style="visibility:hidden"> 242 228 <script language="JavaScript" type="text/javascript"> … … 304 290 if ( count($args[$Carbonne]) > 0 ) 305 291 { 306 if ($mails_options[ 1] == 'on') {292 if ($mails_options[check_header_carbon] == 'on') { 307 293 $list_mail = str_replace(","," ,",get_strict_email_list(implode(',', $args[$Carbonne])))." \n" ; 308 294 $headers = preg_replace('/.*'.$Carbonne.'(.*).\n/i', $Carbonne.': '.$list_mail, $headers); … … 654 640 //======================================================================= 655 641 656 if ($mails_options[ 5] == 'on')642 if ($mails_options[set_auto] == 'on') 657 643 { 658 644 // $ip="94.102.63.13"; ' Spammeurs … … 700 686 pwg_query($query ); 701 687 } 702 $erreur_message .= $mails_options[ 6] ." ".$user['username']." ".$user['email'] . ' -----> ' . l10n('black_list') ;688 $erreur_message .= $mails_options[ip] ." ".$user['username']." ".$user['email'] . ' -----> ' . l10n('black_list') ; 703 689 // die($nb." ".$ip." ".$user['username']." ".$user['email']); 704 690 return true ; … … 708 694 } 709 695 //============================================================================== 710 if ( $mails_options[ 6] == $ip ) return ($nb > 0) ;711 $mails_options[ 6] = $ip ;696 if ( $mails_options[ip] == $ip ) return ($nb > 0) ; 697 $mails_options[ip] = $ip ; 712 698 sauve_options(); 713 699 … … 799 785 //============================================================================= 800 786 } 787 801 788 $user_name=str_replace(" ","%20",trim($user_name)); 802 789 if ($user_name==l10n('guest')) $user_name=""; 803 790 $user_name=""; // ne plus tester sur le login. 804 791 $mail_adresse =str_replace(" ","%20",trim($mail_adresse)); 805 792 -
extensions/Mail_supervisor/main.inc.php
r4715 r4861 2 2 /* 3 3 Plugin Name: Mail supervisor 4 Version: 1.3. 14 Version: 1.3.3 5 5 Description: Mail supervisor surveille l'envoie des mails. 6 6 Plugin URI: http://piwigo.org/ext/extension_view.php?eid=315 … … 80 80 81 81 global $conf ; 82 82 83 83 84 add_event_handler('send_mail', 'clj_mail',EVENT_HANDLER_PRIORITY_NEUTRAL - 1 , 6); 84 85 … … 88 89 // lecture config table ------------- 89 90 include_once (MAIL_SUPERV_PATH.'include/fonctions.php'); 90 load_language('plugin.lang', MAIL_SUPERV_PATH); 91 92 $mails_options = explode("," , $conf['mail_superv']); 93 94 if ($mails_options[3]=='on' || $mails_options[4] == 'on' ) 91 load_language('plugin.lang', MAIL_SUPERV_PATH); 92 $mails_options = explode("," , $conf['mail_superv']); 93 //======== vérification si envoie de mail ou blocage connexion ===================== 94 if ($mails_options[no_mail_list]=='on' || $mails_options[no_connect] == 'on' ) 95 95 { 96 96 if (kill_list()) 97 97 { 98 98 $erreur_message .= "<BR />".l10n('is_a_spam') ; 99 if ($mails_options[4] == 'on' ){ 100 if ($user['status'] != 'webmaster' ) 101 if (!isset($_GET['admin'])) { 99 if ($mails_options[no_connect] == 'on' ){ 100 if ($user['status'] == 'webmaster' ) 101 { 102 //---------- continuer si web master ---------- 103 }else{ 104 if (!isset($_GET['admin'])) { 102 105 die('Blacklist : <br />' .$erreur_message. '<br /> Hacking attempt!'); 103 }elseif ($_GET['admin'] != 'piwigo')104 {106 }elseif ($_GET['admin'] != 'piwigo') 107 { 105 108 die('blacklist Hacking attempt!'); 106 109 } 107 } 108 return true; 110 return true; 111 } 112 113 } 114 109 115 } 110 116 } … … 151 157 152 158 $nb_destinataires=0; 153 if ($mails_options[ 0] == 'on') {159 if ($mails_options[check_mailto] == 'on') { 154 160 if ($mailto == "" ) $mailto = $conf_mail['email_webmaster']; 155 161 } … … 189 195 } 190 196 //============================================================================= 191 if ($mails_options[ 2]=='on') {197 if ($mails_options[check_header_text]=='on') { 192 198 193 199 $texte = "This is a multi-part message in MIME format.\n"; … … 347 353 348 354 } 349 355 include_once (MAIL_SUPERV_PATH.'include/fonctions.php'); 350 356 $mails_options = explode("," , $conf['mail_superv']); 351 357 352 358 //========================================================================================== 353 if ($mails_options[ 7]=='on' ) {359 if ($mails_options[set_id]=='on' ) { 354 360 add_event_handler('register_user_check', 'Test_spam_g', EVENT_HANDLER_PRIORITY_NEUTRAL +2 , 2); 355 361 } … … 368 374 $user_name = $user['username']; 369 375 } 370 $user_name =""; 376 $user_name =""; // suppression du test sur user name. 371 377 $ip='0'; 372 378 if (test_spam($ip,$user_name ,$mail ))
Note: See TracChangeset
for help on using the changeset viewer.