Changeset 10419
- Timestamp:
- Apr 16, 2011, 3:53:31 PM (13 years ago)
- Location:
- extensions/Mail_supervisor
- Files:
-
- 20 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/Mail_supervisor/admin/clear/theme.css
r10385 r10419 23 23 color: #999; 24 24 cursor: pointer; 25 font-size: 110%;25 /*font-size: 110%;*/ 26 26 overflow: hidden; 27 27 padding: 8px 41px; -
extensions/Mail_supervisor/admin/default/theme.css
r10385 r10419 1 .bug {1 .bug { 2 2 background-image: url('../../smilies/mouche.gif'); 3 3 background-repeat: no-repeat; -
extensions/Mail_supervisor/admin/header_2_1.tpl
r10385 r10419 1 {known_script id="jquery" src = $ROOT_URL|@cat:"themes/default/js/jquery.packed.js" now=0} 1 {known_script id="jquery" src = $ROOT_URL|@cat:"themes/default/js/jquery.packed.js" now=0} 2 2 {known_script id="jquery.cluetip" src = $ROOT_URL|@cat:"themes/default/js/plugins/jquery.cluetip.packed.js"} 3 3 {known_script id="jquery.ui" src= $ROOT_URL|@cat:"themes/default/js/ui/minified/ui.core.min.js"} … … 6 6 <link rel="stylesheet" type="text/css" href="{$MAIL_SUPERV_PATH}admin/{$theme}/theme.css" /> 7 7 {/html_head} 8 <input id="action_spam" name="action_spam" type="hidden" value="{$action_spam}" /> -
extensions/Mail_supervisor/admin/header_2_2.tpl
r10385 r10419 1 {combine_script id="jquery" path= "themes/default/js/jquery.min.js" }1 {combine_script id="jquery" path= "themes/default/js/jquery.min.js" } 2 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" } -
extensions/Mail_supervisor/admin/mail_black_liste.tpl
r10155 r10419 1 {* $Id: mail_black_liste.tpl cljosse $ *} 1 {* $Id: mail_black_liste.tpl cljosse $ *} 2 2 <script type="text/javascript"> 3 3 var is_supervisor = true; 4 var confirm_message = "{'Sv_Are_you_sure'|@translate|@escape:'javascript'}?"; 4 var confirm_message = "{'Sv_Are_you_sure'|@translate|@escape:'javascript'}?"; 5 5 </script> 6 6 7 7 <div class="titrePage"> 8 9 </div> 8 <h2>{'Sv_supervisor'|translate}{'Sv_version'|translate}{$version}</h2> 9 </div> 10 10 <div class="bug" ></div> 11 11 <form action='' method="post" name="form_black"> 12 12 <fieldset> 13 13 <legend >{'Sv_options'|translate}</legend> 14 <table> 15 <td><input type="checkbox" name="no_mail_list" value="on" {$no_mail_list} /> {'Sv_no_mail_list'|translate} 14 <table> 15 <td><input type="checkbox" name="no_mail_list" value="on" {$no_mail_list} /> {'Sv_no_mail_list'|translate} </td> 16 16 <td style="visibility:hidden" ><input type="checkbox" name="no_connect" value="off" {$no_connect} /> {'Sv_no_connect'|translate} </td> 17 17 <td style="visibility:visible" ><input type="checkbox" name="set_auto" value="off" {$set_auto} /> {'Sv_set_auto'|translate} </td> … … 25 25 <legend>{'Sv_black_liste'|translate}</legend> 26 26 <table> 27 <td><input name="ip_black" id = "ip_black_test" type="text" value="{$ip_black}" 28 <input class="cluetip" title="{'Sv_Test'|translate}|{'Sv_hlp_7_3'|translate}" type="submit" name="submit" value="{'Sv_Test'|translate}" /> 29 { if $ip_black_len > 0} 30 31 <label class="erreur">{'Sv_is_a_spam'|@translate} </label>32 33 { if $istype == 'IP'} 34 <label class="erreur">{'Sv_not_a_spam'|@translate} </label>35 36 <label class="erreur">{'Sv_no_verif'|@translate} </label>37 {/if} 38 27 <td><input name="ip_black" id = "ip_black_test" type="text" value="{$ip_black}" /> 28 <input class="cluetip" title="{'Sv_Test'|translate}|{'Sv_hlp_7_3'|translate}" type="submit" name="submit" value="{'Sv_Test'|translate}" /> 29 { if $ip_black_len > 0} 30 {if $IS_SPAM == true } 31 <label class="erreur"> {'Sv_is_a_spam'|@translate} </label> 32 { else } 33 { if $istype == 'IP'} 34 <label class="erreur"> {'Sv_not_a_spam'|@translate} </label> 35 { else } 36 <label class="erreur"> {'Sv_no_verif'|@translate} </label> 37 {/if} 38 {/if} 39 39 </td> 40 41 <input class="bp cluetip" 42 43 type="submit" 44 name="submit" 45 46 value="{'Sv_Ajout'|@translate}" 47 alt="{'Sv_Ajout'|@translate} : {$ip_black}" 48 40 <td> 41 <input class="bp cluetip" 42 title="{'Sv_Ajout'|translate}|{'Sv_hlp_7_4'|translate}" 43 type="submit" 44 name="submit" 45 rel="ajout:{$ip_black}" 46 value="{'Sv_Ajout'|@translate}" 47 alt="{'Sv_Ajout'|@translate} : {$ip_black}" 48 /> 49 49 </td> 50 50 <td> 51 <input type="image" name="submit" class='bp row1' 52 src="{$ROOT_URL}{$themeconf.admin_icon_dir}/plug_activate.png" 51 <input type="image" name="submit" class='bp row1' 52 src="{$ROOT_URL}{$themeconf.admin_icon_dir}/plug_activate.png" 53 53 rel="ajout:{$ip_black}" 54 id="btn_ajout{$ip_black}" 55 alt="{'Sv_Ajout'|@translate} : {$ip_black}" 54 id="btn_ajout{$ip_black}" 55 alt="{'Sv_Ajout'|@translate} : {$ip_black}" 56 56 title="{'Sv_Ajout'|@translate} {$ip_black}" /> 57 57 { else } 58 58 59 59 {/if} 60 60 61 61 </td> 62 63 64 65 66 62 63 64 65 <td> 66 <a href="http://www.stopforumspam.com" > <img src="{$img_logo}" width="32"/> http://www.stopforumspam.com 67 67 </a></td> 68 </tr> <tr> </tr> 69 </table> 70 71 <table class="table2" > 72 {if not empty($liste_bl)} 73 <tr class="throw"> 74 <th>{$champs_bl[1]|@translate}</th> 75 <th>{$champs_bl[7]|@translate}</th> 76 <th>{'Sv_blackliste'|@translate}</th> 77 </tr> 78 {foreach from=$liste_bl item=group name=group_loop} 79 <tr class="{if $smarty.foreach.group_loop.index is odd}row1{else}row2{/if}"> 80 <td>{$group.ip}</td> 81 82 <td>{$group.nb}</td> 83 <td style="text-align:center;"> 84 <input type="image" class="bp {if $smarty.foreach.group_loop.index is odd}row1{else}row2{/if}" 85 src="{$ROOT_URL}{$themeconf.admin_icon_dir}/delete.png" 86 rel="raz:{$group.ip}" 87 id="btn_delete{$group.ip}" 88 title="{'Sv_delete'|@translate} {$group.ip}" 89 alt="{'Sv_delete'|@translate} {$group.ip}" /> 90 </td> 91 </tr> 92 {/foreach} 93 <tr></tr> 94 <tr></tr> 95 <td> <img src="{$ROOT_URL}{$themeconf.admin_icon_dir}/delete.png" />{'Sv_unset_black_list'|@translate}</td> 96 <td> <img src="{$ROOT_URL}{$themeconf.admin_icon_dir}/plug_activate.png" />{'Sv_set_black_list'|@translate}</td> 68 </tr> <tr> </tr> 69 </table> 97 70 98 {/if} 99 </table> 100 </fieldset> 71 <table class="table2" > 72 {if not empty($liste_bl)} 73 <tr class="throw"> 74 <th>{$champs_bl[1]|@translate}</th> 75 <th>{$champs_bl[7]|@translate}</th> 76 <th>{'Sv_blackliste'|@translate}</th> 77 </tr> 78 {foreach from=$liste_bl item=group name=group_loop} 79 <tr class="{if $smarty.foreach.group_loop.index is odd}row1{else}row2{/if}"> 80 <td>{$group.ip}</td> 101 81 102 <fieldset > 82 <td>{$group.nb}</td> 83 <td style="text-align:center;"> 84 <input type="image" class="bp {if $smarty.foreach.group_loop.index is odd}row1{else}row2{/if}" 85 src="{$ROOT_URL}{$themeconf.admin_icon_dir}/delete.png" 86 rel="raz:{$group.ip}" 87 id="btn_delete{$group.ip}" 88 title="{'Sv_delete'|@translate} {$group.ip}" 89 alt="{'Sv_delete'|@translate} {$group.ip}" /> 90 </td> 91 </tr> 92 {/foreach} 93 <tr></tr> 94 <tr></tr> 95 <td> <img src="{$ROOT_URL}{$themeconf.admin_icon_dir}/delete.png" />{'Sv_unset_black_list'|@translate}</td> 96 <td> <img src="{$ROOT_URL}{$themeconf.admin_icon_dir}/plug_activate.png" />{'Sv_set_black_list'|@translate}</td> 97 98 {/if} 99 </table> 100 </fieldset> 101 102 <fieldset > 103 103 <legend>{'Sv_liste_ip'|translate}</legend> 104 105 104 <p class="Style1"> 105 {'Sv_iP_adress'|translate} : {$IP} 106 106 </p> 107 <table class="table"> 108 <td>{'Number of rows per page'|translate}</td> 109 107 <table class="table"> 108 <td>{'Number of rows per page'|translate}</td> 109 <td><input type="text" name="per_page" value="{$per_page}" size=5 /></td> 110 110 {if $start >0} 111 112 113 <td>{'page'|translate}</td> 111 <td><input class="submit" type="submit" name="prev" value= "{'previous_page'|translate}" /></td> 112 { /if} 113 <td>{'page'|translate}</td> 114 114 <td><input type="text" name="start" value="{$start}" size=5 /></td> 115 <td>/ {$maxipage} </td> 116 {if $start < $maxipage } 117 118 { /if} 119 120 </table> 115 <td>/ {$maxipage} </td> 116 {if $start < $maxipage } 117 <td><input class="submit" type="submit" name="next" value= "{'Next'|translate}" /></td> 118 { /if} 119 <td><input class="submit" type="submit" name="info" value="{'Sv_list'|translate}" /></td> 120 </table> 121 121 <table class="table2"> 122 <tr class="throw"> 122 <tr class="throw"> 123 123 <th>{$champs_ip[0]|@translate}</th> 124 124 <th>{$champs_ip[1]|@translate}</th> … … 129 129 <th>{'Sv_blackliste'|@translate}</th> 130 130 </tr> 131 {if not empty($liste_ip)} 132 {foreach from=$liste_ip item=group name=group_loop} 131 {if not empty($liste_ip)} 132 {foreach from=$liste_ip item=group name=group_loop} 133 133 <tr class="{if $smarty.foreach.group_loop.index is odd}row1{else}row2{/if}"> 134 134 <td>{$group.id}</td> … … 139 139 <td>{$group.total}</td> 140 140 <td style="text-align:center;"> 141 <input type="image" 142 class="bp {if $smarty.foreach.group_loop.index is odd}row1{else}row2{/if}" 143 src="{$ROOT_URL}{$themeconf.admin_icon_dir}/plug_activate.png" 144 rel='ajout:{$group.IP}' 145 146 147 141 <input type="image" 142 class="bp {if $smarty.foreach.group_loop.index is odd}row1{else}row2{/if}" 143 src="{$ROOT_URL}{$themeconf.admin_icon_dir}/plug_activate.png" 144 rel='ajout:{$group.IP}' 145 id="btn_permissions{$group.IP}" 146 title="{'Sv_blacklist'|@translate} {$group.IP}" 147 alt="{'Sv_blacklist'|@translate} {$group.IP}" /> 148 148 </td> 149 149 <td style="text-align:center;"></td> … … 151 151 {/foreach} 152 152 {/if} 153 <td> <img src="{$ROOT_URL}{$themeconf.admin_icon_dir}/plug_activate.png" /> {'Sv_set_black_list'|@translate}</td> 153 <td> <img src="{$ROOT_URL}{$themeconf.admin_icon_dir}/plug_activate.png" /> {'Sv_set_black_list'|@translate}</td> 154 154 </table> 155 </fieldset> 155 </fieldset> 156 156 </form> 157 <form action="" method="post" name="form_connexion" id="form_connexion" style="visibility:hidden"> 158 159 160 161 162 <input name="longitude" type="text" value = "" id = "longitude" > 157 <form action="" method="post" name="form_connexion" id="form_connexion" style="visibility:hidden"> 158 <input name="pays" type="text" value = "" id = "pays" > 159 <input name="ville" type="text" value = "" id = "ville" > 160 <input name="region" type="text" value = "" id = "region" > 161 <input name="latitude" type="text" value = "" id = "latitude" > 162 <input name="longitude" type="text" value = "" id = "longitude" > 163 163 </form > -
extensions/Mail_supervisor/admin/mail_superv_admin.php
r10385 r10419 47 47 +1 '.$lang['Hour'].'<br /> 48 48 +1 '.$lang['Minute'].'<br /> 49 +1 '.$lang['Second'].'<br />'; 50 //============================================================== 51 load_language('help/plugin.lang', MAIL_SUPERV_PATH); 52 53 54 49 +1 '.$lang['Second'].'<br />'; 50 //============================================================== 51 load_language('help/plugin.lang', MAIL_SUPERV_PATH); 52 53 if (!isset($_GET['tab'])) 54 $page['tab'] = 'mail_superv_admin'; 55 55 else 56 56 $page['tab'] = $_GET['tab']; 57 57 58 if (file_exists ( 'admin/themes/clear/icon/help.png')) 58 if (file_exists ( 'admin/themes/clear/icon/help.png')) 59 59 { 60 60 //version 2.1 61 61 62 62 $icon_path = 'themes/default/icon/help.png'; 63 $path_js= 'themes/default/js/' ; 63 $path_js= 'themes/default/js/' ; 64 64 65 65 } … … 67 67 { 68 68 // version 1.9 69 $path_js= "template-common/lib/"; 69 $path_js= "template-common/lib/"; 70 70 $icon_path = "admin/template/goto/theme/clear/icon/help.png"; 71 71 } 72 72 73 73 74 74 $tabhelp= ' <img src="'.PHPWG_ROOT_PATH. $icon_path .'" width=10px alt="(?)"> '; … … 77 77 l10n('Sv_Tab_set'), 78 78 $my_base_url.'&tab=mail_superv_admin'); 79 79 80 80 $tabsheet->add('mail_superv_test', 81 81 l10n('Sv_Tab_test'), 82 82 $my_base_url.'&tab=mail_superv_test'); 83 83 84 84 $tabsheet->add( 'mail_black_liste', 85 85 l10n('Sv_blackliste'), 86 87 88 86 $my_base_url.'&tab=mail_black_liste'); 87 88 89 89 $tabsheet->add('mail_superv_help', 90 90 $tabhelp, 91 91 $my_base_url.'&tab=mail_superv_help'); 92 92 93 93 $tabsheet->select($page['tab']); 94 94 $tabsheet->assign(); … … 97 97 $error = array(); 98 98 99 include_once (MAIL_SUPERV_PATH.'mail_super.inc.php'); 100 include_once (MAIL_SUPERV_PATH.'include/constants.php'); 101 102 if (!isset($infos_message)) 99 include_once (MAIL_SUPERV_PATH.'mail_super.inc.php'); 100 include_once (MAIL_SUPERV_PATH.'include/constants.php'); 101 102 if (!isset($infos_message)) { 103 103 $infos_message = ""; 104 104 } … … 108 108 109 109 if (isset($conf['mail_superv'])) { 110 global $pays,$region,$ville,$ip ; 111 include_once (MAIL_SUPERV_PATH.'include/fonctions.php'); 112 //================================================================================================ 110 global $pays,$region,$ville,$ip ; 111 include_once (MAIL_SUPERV_PATH.'include/fonctions.php'); 112 //================================================================================================ 113 113 114 114 $mails_donnees = mail_supervisor::Get_Datas(); … … 127 127 //========================================================= 128 128 if (!isset($ip)) { 129 if (getenv("HTTP_CLIENT_IP")){ 130 $ip=getenv("HTTP_CLIENT_IP"); 131 } else{ 132 $ip=getenv("REMOTE_ADDR"); 133 } 134 } 135 129 if (getenv("HTTP_CLIENT_IP")){ 130 $ip=getenv("HTTP_CLIENT_IP"); 131 } else{ 132 $ip=getenv("REMOTE_ADDR"); 133 } 134 } 135 136 136 //================================================================================ 137 137 switch ($page['tab']) 138 138 { 139 139 140 140 // ************************************************************************* 141 141 // initialisation | 142 142 // ************************************************************************* 143 143 case 'mail_superv_admin': 144 144 145 145 //============================================================= 146 146 if ( isset($_POST['submit']) ) { 147 148 149 150 if ($mails_donnees['nb_mails'] == 0 ) 151 $mails_donnees['date_mail'] = time(); 152 153 154 155 156 157 158 159 160 161 147 148 if ( $_POST['submit'] == l10n('Sv_refresh') ) { 149 150 if ($mails_donnees['nb_mails'] == 0 ) 151 $mails_donnees['date_mail'] = time(); 152 153 if ($mails_donnees['nb_spams'] == 0 ) 154 $mails_donnees['date_spam'] = time(); 155 156 157 if ($mails_donnees['quarantaine'] == false) 158 { $mails_donnees['reste'] = 0; 159 $mails_donnees['date_quarantaine']=time(); 160 } 161 $infos_message .= l10n('Sv_refresh') .'<br />'; 162 162 mail_supervisor::sauve_donnees(); 163 164 165 166 167 168 169 170 171 172 173 $mails_donnees['date_spam'] = time(); 174 175 $mails_donnees['quarantaine']='false'; 163 $aff_nb = false ; 164 165 166 } 167 168 if ( $_POST['submit'] == l10n('Sv_raz') ) { 169 $mails_donnees['date_quarantaine']=time(); 170 $mails_donnees['nb_mails'] = 0 ; 171 $mails_donnees['nb_spams'] = 0 ; 172 $mails_donnees['date_mail'] = time(); 173 $mails_donnees['date_spam'] = time(); 174 $mails_donnees['reste'] = 0; 175 $mails_donnees['quarantaine']='false'; 176 176 mail_supervisor::sauve_donnees(); 177 $infos_message .= l10n('Sv_raz') .'<br />'; 178 177 $infos_message .= l10n('Sv_raz') .'<br />'; 178 } 179 179 180 180 //=================================================================== 181 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' ; 185 186 //donnees 181 if ( $_POST['submit'] == l10n('Sv_Valider') ) { 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' ; 185 186 //donnees 187 187 $mails_donnees['nb_mails_maxi'] = isset($_POST['nb_mails_maxi']) ? $_POST['nb_mails_maxi'] : $mails_donnees['nb_mails_maxi'] ; 188 $mails_donnees['nb_mails_periode'] = isset($_POST['nb_mails_periode']) ? $_POST['nb_mails_periode'] : $mails_donnees['nb_mails_periode'] ; 188 $mails_donnees['nb_mails_periode'] = isset($_POST['nb_mails_periode']) ? $_POST['nb_mails_periode'] : $mails_donnees['nb_mails_periode'] ; 189 189 $mails_donnees['nb_spams_maxi'] = isset($_POST['nb_spams_maxi']) ? $_POST['nb_spams_maxi'] : $mails_donnees['nb_spams_maxi'] ; 190 190 $mails_donnees['nb_spams_periode'] = isset($_POST['nb_spams_periode']) ? $_POST['nb_spams_periode'] : $mails_donnees['nb_spams_periode'] ; 191 191 192 192 $mails_donnees['quarantaine_periode'] = isset($_POST['quarantaine_periode']) ? $_POST['quarantaine_periode'] : $mails_donnees['quarantaine_periode'] ; 193 193 194 194 $mails_donnees['message'] = isset($_POST['content']) ? $_POST['content'] : $mails_donnees['message'] ; 195 195 $mails_donnees['header_text'] = isset($_POST['header_text']) ? $_POST['header_text'] : $mails_donnees['header_text'] ; … … 203 203 $mails_donnees = mail_supervisor::Get_Datas() ; 204 204 } 205 } 206 205 } 206 $mails_donnees = mail_supervisor::Get_Datas(); 207 207 verif_mails_donnees(); 208 //=============================================================================== 209 $rest_mail= $mails_donnees['rest_mail']; 210 $rest_spam= $mails_donnees['rest_spam']; 211 $reste= $mails_donnees['reste']; 212 $quarantaine = ($mails_donnees['quarantaine'] == 'true') ? true : false ; 208 //=============================================================================== 209 $rest_mail= $mails_donnees['rest_mail']; 210 $rest_spam= $mails_donnees['rest_spam']; 211 $reste= $mails_donnees['reste']; 212 $quarantaine = ($mails_donnees['quarantaine'] == 'true') ? true : false ; 213 213 $template->assign( 214 214 array( 215 215 'check_mailto' => ($mails_options['check_mailto'] == 'on') ? 'checked="checked"' : '' , 216 216 'check_header_carbons' => ($mails_options['check_header_carbon'] == 'on') ? 'checked="checked"' : '' , 217 217 'check_header_text' => ($mails_options['check_header_text'] == 'on') ? 'checked="checked"' : '' , 218 218 219 219 220 220 'nb_mails' => $mails_donnees['nb_mails'] , 221 221 'date_mail' => "'".date(l10n('Sv_formatdate'),$mails_donnees['date_mail'])."'" , 222 'nb_mails_maxi' => $mails_donnees['nb_mails_maxi'] , 223 'nb_mails_periode' => "'". int_to_heure($mails_donnees['nb_mails_periode'])."'" , 224 'time_mails_reste' => "'".int_to_heure( $rest_mail )."'" , 225 222 'nb_mails_maxi' => $mails_donnees['nb_mails_maxi'] , 223 'nb_mails_periode' => "'". int_to_heure($mails_donnees['nb_mails_periode'])."'" , 224 'time_mails_reste' => "'".int_to_heure( $rest_mail )."'" , 225 226 226 'nb_spams' => $mails_donnees['nb_spams'] , 227 227 'date_spam' => "'".date(l10n('Sv_formatdate'),$mails_donnees['date_spam'])."'" , 228 'nb_spams_maxi' => $mails_donnees['nb_spams_maxi'] , 228 'nb_spams_maxi' => $mails_donnees['nb_spams_maxi'] , 229 229 'nb_spams_periode' => "'".int_to_heure($mails_donnees['nb_spams_periode'])."'" , 230 'time_spams_reste' => "'".int_to_heure($rest_spam)."'" , 231 230 'time_spams_reste' => "'".int_to_heure($rest_spam)."'" , 231 232 232 'quarantaine' => $quarantaine , 233 233 'date_quarantaine' => "'".date(l10n('Sv_formatdate'),time()+$reste)."'" , 234 234 'quarantaine_periode' => "'".int_to_heure($mails_donnees['quarantaine_periode'])."'" , 235 235 'reste' => "'".int_to_heure($reste)."'", 236 236 237 237 'message' => $mails_donnees['message'] , 238 238 'header_text' => "'".$mails_donnees['header_text']."'" , 239 240 'PHPWG_VERSION' => 241 'version' => 239 240 'PHPWG_VERSION' => PHPWG_VERSION , 241 'version' => $version , 242 242 'MAIL_SUPERV_PATH' => MAIL_SUPERV_PATH , 243 243 'path_js' => $path_js, 244 244 'MAIL_SUPERV_PATH_ABS' => MAIL_SUPERV_PATH_ABS, 245 246 247 ); 248 249 $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content'); 250 break; 245 246 ) 247 ); 248 $template->set_filenames(array('plugin_admin_content' => realpath(MAIL_SUPERV_PATH . 'admin/mail_superv_admin.tpl'))); 249 $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content'); 250 break; 251 251 // ************************************************************************* 252 252 // TEST | 253 253 // ************************************************************************* 254 254 255 255 case 'mail_superv_test': 256 load_language('plugin.lang', MAIL_SUPERV_PATH);257 258 259 260 261 262 263 264 265 266 267 }else {268 $group_name=""; 269 } 256 load_language('plugin.lang', MAIL_SUPERV_PATH); 257 $mails_donnees = mail_supervisor::Get_Datas() ; 258 $group_id = isset($_POST['group']) ? $_POST['group'] : '-1' ; 259 260 if ($group_id >= 0) { 261 $query = 'SELECT 262 name 263 FROM '.GROUPS_TABLE.' 264 WHERE id = '.$group_id.' 265 ;'; 266 list($group_name) = mysql_fetch_row(pwg_query($query)); 267 } else { 268 $group_name=""; 269 } 270 270 271 271 //================================================ … … 277 277 set_make_full_url(); 278 278 279 /* TODO: if $category['representative_picture_id'] 279 /* TODO: if $category['representative_picture_id'] 280 280 is empty find child representative_picture_id */ 281 281 282 282 283 284 285 286 283 if (function_exists('get_user_language_desc') ) $titre = get_user_language_desc($conf['gallery_title']); 284 else $titre=$conf['gallery_title']; 285 286 $message = empty($_POST['MAIL_CONTENT']) ? $mails_donnees['message_test'] : stripslashes($_POST['MAIL_CONTENT']); 287 287 288 288 if (function_exists('get_user_language_desc') ) $message = get_user_language_desc($message); 289 289 290 290 if ( $_POST['Submit']==l10n('Sv_Envoyer') ) { 291 292 293 294 295 296 297 298 299 300 301 302 303 304 */ 305 306 307 get_str_email_format(true),308 309 'cat_group_info', // template310 311 312 313 314 315 316 317 291 /* 292 * send en email to user's group 293 * 294 * @param: 295 * - group_id: mail are sent to group with this Id 296 * - email_format: mail format 297 * - keyargs_subject: mail subject on l10n_args format 298 * - dirname: short name of directory including template 299 * - tpl_shortname: short template name without extension 300 * - assign_vars: array used to assign_vars to mail template 301 * - language_selected: send mail only to user with this selected language 302 * 303 * @return boolean (Ok or not) 304 */ 305 pwg_mail_group( 306 $_POST['group'], 307 get_str_email_format(true), 308 get_l10n_args('[%s] ---> %s', array($titre,'Information') ), //sujet 309 'cat_group_info', // template 310 array ('CPL_CONTENT' => $message."\n\n".$user['username'] ), 311 '' ); 312 313 $mails_donnees['message_test']= str_replace('"',"'",$message) ; 314 315 unset_make_full_url(); 316 mail_supervisor::sauve_donnees(); 317 $mails_donnees = mail_supervisor::Get_Datas() ; 318 318 $query = 'SELECT 319 320 321 322 323 324 325 326 327 328 329 ); 330 331 } 332 } 319 name 320 FROM '.GROUPS_TABLE.' 321 WHERE id = '.$_POST['group'].' 322 ;'; 323 list($group_name) = mysql_fetch_row(pwg_query($query)); 324 325 array_push( 326 $page['infos'], 327 sprintf( l10n('An information email was sent to group "%s"'), 328 $group_name ) 329 ); 330 $group_id =-1 ; 331 } 332 } 333 333 334 334 //====================================================================================== 335 335 $groups[-1] = '---------'; 336 336 $query = ' SELECT id, name 337 338 339 337 FROM '.GROUPS_TABLE.' 338 ORDER BY name ASC 339 ;'; 340 340 341 341 $result = pwg_query($query); 342 //---------------------------------------------------------------- 342 //---------------------------------------------------------------- 343 343 while ($row = mysql_fetch_array($result,MYSQL_ASSOC)) 344 344 { $groups[$row['id']] = $row['name']; } 345 //--------------------------------------------------------------- 345 //--------------------------------------------------------------- 346 346 if ( isset($_POST['Submit'])) $group_id=-1; 347 347 $template->assign( 348 349 350 'selected' => $group_id 351 352 348 'Group', 349 array( 'group_options'=> $groups, 350 'selected' => $group_id 351 ) 352 ); 353 353 //================================================================= 354 354 $destinataires= implode("<br />",get_liste($group_id)); 355 355 if( $destinataires !="" ) 356 356 $infos_message .= " List :<hr>" . $destinataires . "<hr>" ; 357 357 358 358 $template->assign( 359 359 array( 360 360 'Groupe' => $groups, 361 361 'message_test' => $mails_donnees['message_test'] , 362 362 'liste' => $destinataires , 363 'version' => 363 'version' => $version , 364 364 'MAIL_CONTENT' => $mails_donnees['message_test'], 365 365 'path_js' => $path_js, 366 366 'MAIL_SUPERV_PATH_ABS' => MAIL_SUPERV_PATH_ABS, 367 367 'MAIL_SUPERV_PATH' => MAIL_SUPERV_PATH , 368 369 ); 370 368 ) 369 ); 370 371 371 $template->set_filenames(array('plugin_admin_content' => realpath(MAIL_SUPERV_PATH . 'admin/mail_superv_test.tpl'))); 372 372 $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content'); 373 //========================================================================= 374 375 376 377 378 379 380 381 382 383 373 //========================================================================= 374 $toolbar = 'Basic'; 375 $width = '750px'; 376 $height = '200px'; 377 $areas = array(); 378 $areas[]='MAIL_CONTENT'; 379 if (!empty($areas)){ 380 if (function_exists('set_fckeditor_instance')) 381 set_fckeditor_instance($areas, $toolbar, $width, $height); 382 } 383 384 384 break; 385 385 // ************************************************************************* 386 386 // BLACK LISTE | 387 // ************************************************************************* 388 case 'mail_black_liste': 387 // ************************************************************************* 388 case 'mail_black_liste': 389 389 global $user_name,$mail_adresse,$ip ; 390 390 $aff_nb=false; 391 //======================================================================================= 391 //======================================================================================= 392 392 $info_ip = (isset($info_ip)) ? $info_ip : '' ; 393 393 $info_ip = (isset($_POST['info1'])) ? $_POST['info1'] : $info_ip ; … … 398 398 $ip_black = trim($val[1]) ; 399 399 if (isset($_POST['ip_black'])) $ip_black = ($ip_black == "" ) ? $_POST['ip_black'] : $ip_black ; 400 401 402 403 404 else $istype='LOGIN'; 405 if ( $_POST['submit'] == l10n('Sv_Ajout') ) 400 $istype=""; 401 if ( isset($_POST['submit']) ){ 402 if (clj_is_ip($ip_black)) $istype='IP'; 403 else if (clj_is_mail($ip_black)) $istype='MAIL'; 404 else $istype='LOGIN'; 405 if ( $_POST['submit'] == l10n('Sv_Ajout') ) { 406 406 $info_ip = 'Ajout' ; 407 407 $ip_black = trim( $_POST['ip_black']) ; 408 $infos_message .= $info_ip . '---->'. $ip_black ; 409 } 410 if ( $_POST['submit'] == l10n('Sv_Valider') ){411 408 $infos_message .= $info_ip . '---->'. $ip_black ; 409 } 410 if ( $_POST['submit'] == l10n('Sv_Valider') ) { 411 412 412 $mails_options['no_mail_list'] = isset($_POST['no_mail_list']) ? "on" : "off" ; 413 413 $mails_options['no_connect'] = isset($_POST['no_connect']) ? "on" : "off" ; … … 415 415 $mails_options['set_id'] = isset($_POST['set_id']) ? "on" : "off" ; 416 416 mail_supervisor::sauve_options(); 417 $infos_message .= l10n('Sv_save_config') . '<br />'; 417 $infos_message .= l10n('Sv_save_config') . '<br />'; 418 418 } 419 419 } 420 420 if (!isset($params)) $params=array(); 421 421 if (!isset($params['per_page'])) $params['per_page'] = 20 ; 422 if (!isset($params['start'])) 422 if (!isset($params['start'])) $params['start'] = 0 ; 423 423 424 424 if (isset($_POST['per_page'])) $params['per_page'] =$_POST['per_page']; … … 427 427 if (isset($_POST['prev'])) $params['start'] -= 1; 428 428 $params['start']= ($params['start']>=0) ? $params['start'] : 0 ; 429 //======================================================================================= 430 include (MAIL_SUPERV_PATH.'include/save_info.php'); 431 $maxipage=(int) ( 432 433 434 435 if (!empty($liste_ip))$champs_ip=array_keys($liste_ip[0]);436 437 $smile_bonjour=MAIL_SUPERV_PATH."smilies/mouche.gif" ; 438 $img_logo=MAIL_SUPERV_PATH."smilies/logo.png" ; 429 //======================================================================================= 430 include (MAIL_SUPERV_PATH.'include/save_info.php'); 431 $maxipage=(int) ( $nbip / $params['per_page']) ; 432 $f_action = $my_base_url.'&tab=mail_black_liste' ; 433 $champs_ip=array(); 434 $champs_bl=array(); 435 if (!empty($liste_ip)) $champs_ip=array_keys($liste_ip[0]); 436 if (!empty($liste_bl)) $champs_bl=array_keys($liste_bl[0]); 437 $smile_bonjour=MAIL_SUPERV_PATH."smilies/mouche.gif" ; 438 $img_logo=MAIL_SUPERV_PATH."smilies/logo.png" ; 439 439 $template->assign( 440 440 array( 441 441 'start' => $params['start'], 442 442 'per_page' => $params['per_page'] , … … 444 444 'smile_bonjour' => $smile_bonjour , 445 445 'img_logo' => $img_logo , 446 'champs_ip' => $champs_ip , 446 'champs_ip' => $champs_ip , 447 447 'liste_ip' => $liste_ip, 448 'champs_bl' => $champs_bl ,448 'champs_bl' => $champs_bl , 449 449 'liste_bl' => $liste_bl , 450 450 //'conf_admin_layout' => $conf['admin_layout'] , … … 456 456 'path_js' => $path_js , 457 457 'F_ACTION' => $f_action , 458 458 459 459 'no_mail_list' => ($mails_options['no_mail_list'] == 'on') ? 'checked="checked"' : '' , 460 460 'no_connect' => ($mails_options['no_connect'] == 'on') ? 'checked="checked"' : '' , 461 461 'set_auto' => ($mails_options['set_auto'] == 'on') ? 'checked="checked"' : '' , 462 462 'set_id' => ($mails_options['set_id'] == 'on') ? 'checked="checked"' : '' , 463 'IP' => $ip , 463 'IP' => $ip , 464 464 'PAYS' => $pays , 465 465 'VILLE' => $ville , 466 'REGION' => $region , 467 'version' => 466 'REGION' => $region , 467 'version' => $version , 468 468 'MAIL_SUPERV_PATH_ABS' => MAIL_SUPERV_PATH_ABS, 469 470 471 ); 472 //=============================================================== 469 470 ) 471 ); 472 //=============================================================== 473 473 $template->set_filenames(array('plugin_admin_content' => realpath(MAIL_SUPERV_PATH . 'admin/mail_black_liste.tpl'))); 474 474 $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content'); 475 476 477 break; 475 476 477 break; 478 478 479 479 // ************************************************************************* 480 480 // AIDE | 481 // ************************************************************************* 481 // ************************************************************************* 482 482 case 'mail_superv_help': 483 483 484 485 486 $smile_bonjour=MAIL_SUPERV_PATH."smilies/bonjour.gif" ; 484 485 $aff_nb=false; 486 $smile_bonjour=MAIL_SUPERV_PATH."smilies/bonjour.gif" ; 487 487 $template->assign( 488 488 array( 489 489 'smile_bonjour' => $smile_bonjour , 490 'version' => 490 'version' => $version , 491 491 'MAIL_SUPERV_PATH' => MAIL_SUPERV_PATH , 492 492 'path_js' => $path_js, 493 493 'MAIL_SUPERV_PATH_ABS' => MAIL_SUPERV_PATH_ABS 494 495 ); 496 497 498 499 500 501 break; 494 ) 495 ); 496 $aff_nb = false; 497 ; 498 499 $template->set_filenames(array('plugin_admin_content' => realpath(MAIL_SUPERV_PATH . 'admin/mail_superv_help.tpl'))); 500 $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content'); 501 break; 502 502 //==================================================================== 503 503 } 504 504 //================================================================================ 505 505 506 507 508 509 510 $mails_donnees['date_quarantaine']= time() ; 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 if ( $modif == true ) { 531 532 533 534 535 536 537 538 539 540 541 542 //======================================================================== 506 507 508 if ( $mails_donnees['reste'] < 0 ) { 509 $mails_donnees['quarantaine'] =false ; 510 $mails_donnees['date_quarantaine']= time() ; 511 $mails_donnees['nb_spams'] = 0 ; 512 $modif == true ; 513 } 514 515 516 $rest_mail = $mails_donnees['rest_mail'] ; 517 if ($rest_mail <=0 || $mails_donnees['nb_mails'] ==0 ){ 518 $mails_donnees['nb_mails'] =0 ; 519 $mails_donnees['date_mail'] = time(); 520 $modif = true ; 521 } 522 523 $rest_spam = $mails_donnees['rest_spam'] ; 524 525 if ($rest_spam <=0 || $mails_donnees['nb_spams'] ==0 ){ 526 $mails_donnees['nb_spams'] =0 ; 527 $mails_donnees['date_spam'] = time(); 528 $modif = true ; 529 } 530 if ( $modif == true ) { 531 mail_supervisor::sauve_donnees(); 532 $modif = false ; 533 } 534 535 if ($aff_nb == true) { 536 $infos_message .= 'Mails : '.$mails_donnees['nb_mails']. ' \\ ' . $mails_donnees['nb_mails_maxi']; 537 $infos_message .= "\n".'Spams : '.$mails_donnees['nb_spams']. ' \\ ' . $mails_donnees['nb_spams_maxi']; 538 } 539 540 541 mail_supervisor::affiche_message(); 542 //======================================================================== 543 543 ?> -
extensions/Mail_supervisor/admin/mail_superv_admin.tpl
r10155 r10419 3 3 </script> 4 4 <div class="titrePage"> 5 5 <h2>{'Sv_supervisor'|translate}{'Sv_version'|translate}{$version}</h2> 6 6 </div> 7 7 <span>{'Sv_Howto'|translate}</span> … … 10 10 <fieldset> 11 11 <legend>{'Sv_admin_titre'|translate}</legend> 12 12 <fieldset> 13 13 <legend>{'Sv_options'|translate}</legend> 14 14 15 15 <table> 16 16 <tr><td><input type="checkbox" name="check_mailto" value="on" {$check_mailto} /> {'Sv_check_mailto'|translate}</td><td><input type="checkbox" name="check_header_carbon" value="on" {$check_header_carbons} /> {'Sv_check_header_carbon'|translate}</td> 17 { if $PHPWG_VERSION <= '2.0.4' } 17 { if $PHPWG_VERSION <= '2.0.4' } 18 18 <td><input type="checkbox" name="check_header_text" value="on" {$check_header_text} /> 19 19 {'Sv_check_header_text'|translate}</td> 20 20 <td><input type="text" name="header_text" value={$header_text} /></td> 21 21 {/if} 22 22 </tr> 23 23 </table> … … 35 35 36 36 <td><input type="text" name="nb_mails" size='10%' value={$nb_mails} readonly="true" class="row2" /></td> 37 <td>{'Sv_mails'|translate}</td> 38 <td><input type="text" name="date_mail" value={$date_mail} readonly="true" class="row2" /></td> 39 <td><input type="text" name="nb_mails_maxi" size="10%" value={$nb_mails_maxi} /></td> 40 <td><input class="cluetip" title="{'Sv_format'|translate}|{'Sv_format_d'|translate}" type="text" name="nb_mails_periode" size="30%" value={$nb_mails_periode} /></td> 41 <td><input type="text" name="time_mails_reste" size="50%" value={$time_mails_reste} readonly="true" class="row2" /></td> 42 </tr> 43 44 <tr> 45 <td><input type="text" name="nb_spams" size='10%' value={$nb_spams} readonly="true" class="row2" /></td> 46 <td>{'Sv_spams'|translate}</td> 37 <td>{'Sv_mails'|translate}</td> 38 <td><input type="text" name="date_mail" value={$date_mail} readonly="true" class="row2" /></td> 39 <td><input type="text" name="nb_mails_maxi" size="10%" value={$nb_mails_maxi} /></td> 40 <td><input class="cluetip" title="{'Sv_format'|translate}|{'Sv_format_d'|translate}" type="text" name="nb_mails_periode" size="30%" value={$nb_mails_periode} /></td> 41 <td><input type="text" name="time_mails_reste" size="50%" value={$time_mails_reste} readonly="true" class="row2" /></td> 42 </tr> 47 43 48 <td><input type="text" name="date_spam" value={$date_spam}readonly="true" class="row2" /></td> 49 <td><input type="text" name="nb_spams_maxi" size="10%" value={$nb_spams_maxi} /></td> 50 <td><input type="text" class="cluetip" name="nb_spams_periode" size="30%" value={$nb_spams_periode} title="{'Sv_format'|translate}|{'Sv_format_d'|translate}"/></td> 51 <td><input type="text" name="time_spams_reste" size="50%" value={$time_spams_reste} readonly="true" class="row2" /></td> 52 </tr> 44 <tr> 45 <td><input type="text" name="nb_spams" size='10%' value={$nb_spams} readonly="true" class="row2" /></td> 46 <td>{'Sv_spams'|translate}</td> 47 48 <td><input type="text" name="date_spam" value={$date_spam}readonly="true" class="row2" /></td> 49 <td><input type="text" name="nb_spams_maxi" size="10%" value={$nb_spams_maxi} /></td> 50 <td><input type="text" class="cluetip" name="nb_spams_periode" size="30%" value={$nb_spams_periode} title="{'Sv_format'|translate}|{'Sv_format_d'|translate}"/></td> 51 <td><input type="text" name="time_spams_reste" size="50%" value={$time_spams_reste} readonly="true" class="row2" /></td> 52 </tr> 53 53 </table> 54 54 </fieldset> 55 55 56 56 <fieldset> 57 57 <legend>{'Sv_state'|translate}</legend> 58 <table > 59 <tr> 60 61 62 63 64 <td><input type="text" name="date_quarantaine" value={$date_quarantaine} /></td><td> </td>65 66 67 <td><input type="text" name="reste" size="50%" value={$reste} /></td> 68 69 70 71 72 73 74 75 76 {/if} </tr> 77 58 <table > 59 <tr> 60 61 { if $quarantaine } 62 <td style="color:#FF0000">{'Sv_quarantaine'|translate}</td>' 63 <td> </td> 64 <td><input type="text" name="date_quarantaine" value={$date_quarantaine} /> </td><td> </td> 65 66 <td><input type="text" class="cluetip" name="quarantaine_periode" size="30%" value={$quarantaine_periode} title="{'Sv_format'|translate}|{'Sv_format_d'|translate}" /></td> 67 <td><input type="text" name="reste" size="50%" value={$reste} /></td> 68 {/if} 69 { if !$quarantaine } 70 <td> </td> 71 <td> {'Sv_Quarantaine'|translate} </td> 72 <td> </td> 73 <td> </td> 74 <td><input type="text" class="cluetip" name="quarantaine_periode" size="10%" value={$quarantaine_periode} title="{'Sv_format'|translate}|{'Sv_format_d'|translate}" /></td> 75 76 {/if} </tr> 77 78 78 </table> 79 79 </fieldset> 80 80 81 81 <fieldset> 82 82 <legend>{'Sv_admin_description'|translate}</legend> 83 84 <tr><td><textarea name="content" rows="11" cols="100">{$message}</textarea></td> </tr> 85 83 <table > 84 <tr><td><textarea name="content" rows="11" cols="100">{$message}</textarea></td> </tr> 85 86 86 </table> 87 88 89 90 87 </fieldset> 88 <p> 89 <input class="submit" type="submit" name="submit" value="{'Sv_Valider'|translate}" /> 90 <input class="submit" type="submit" name="submit" value="{'Sv_raz'|translate}" /> 91 91 <input class="submit" type="submit" name="submit" value="{'Sv_refresh'|translate}" /> 92 </p> 92 </p> 93 93 </fieldset> 94 94 </form> -
extensions/Mail_supervisor/admin/mail_superv_help.tpl
r10155 r10419 3 3 <fieldset style=" position:relative ; top:15px"> 4 4 <legend>{'Sv_admin_titre'|translate}</legend> 5 <div id="instructionFonction" class="instructionBlock" > 5 <div id="instructionFonction" class="instructionBlock" > 6 6 <div 7 7 id="fonction_header" … … 17 17 > 18 18 <p>{'Sv_oversees_management_emails'|translate}.</p> 19 <ol> 20 19 <ol> 20 <li>{'Sv_hlp_1_1'|translate}</li> 21 21 <li>{'Sv_hlp_1_2'|translate}</li> 22 22 <li>{'Sv_hlp_1_3'|translate}</li> … … 43 43 > 44 44 45 45 46 46 47 47 <ol> … … 51 51 </ul> 52 52 <li ><span class="throw">{'Sv_check_header_carbon'|translate}</span></li> 53 53 54 54 <ul> 55 55 <li>{'Sv_hlp_2_2'|translate}</li> 56 56 </ul> 57 <li><span class="throw">{'Sv_check_header_text'|translate}</span> </li> 57 <li><span class="throw">{'Sv_check_header_text'|translate}</span> </li> 58 58 <ul> 59 59 <li>{'Sv_hlp_2_3'|translate}</li> … … 84 84 85 85 <ul> 86 <ul> 87 86 <ul> 87 <li ><i><span class="throw">{'Sv_nb'|translate}</span></i> {'Sv_hlp_3_1'|translate}</li> 88 88 <li><i><span class="throw">{'Sv_depuis_le'|translate}</span></i> {'Sv_hlp_3_2'|translate}</li> 89 89 <li><i><span class="throw">{'Sv_nb_maxi'|translate}</span></i> {'Sv_hlp_3_3'|translate}</li> 90 90 <li><i><span class="throw">{'Sv_periode'|translate}</span></i> {'Sv_hlp_3_4'|translate} 91 92 91 {'Sv_hlp_3_4_0'|translate} 92 </li> 93 93 <li><i><span class="throw">{'Sv_rest'|translate}</span></i> {'Sv_hlp_3_5'|translate}</li> 94 94 95 95 </ul> 96 97 98 99 </ul> 100 </div> <!-- configuration_content --> 96 97 98 99 </ul> 100 </div> <!-- configuration_content --> 101 101 </div> <!-- instructionconfiguration --> 102 102 … … 120 120 <li><i><span class="throw">{'Sv_quarantaine'|translate}</span></i> {'Sv_hlp_4_2'|translate}</li> 121 121 122 123 </ul> 124 </div> <!-- etat_content --> 122 123 </ul> 124 </div> <!-- etat_content --> 125 125 </div> <!-- instructionetat --> 126 126 … … 147 147 <p>.</p> 148 148 149 </div> <!-- lastmessage_content --> 149 </div> <!-- lastmessage_content --> 150 150 </div> <!-- instructionlastmessage --> 151 151 <img src="{$smile_bonjour}" /> 152 152 Redaction en cours.... 153 153 </fieldset> 154 155 154 155 156 156 <fieldset > 157 157 <legend>{'Sv_Test'|translate}</legend> 158 158 <div id="testFonction" class="instructionBlock" > 159 159 160 160 <div 161 161 id="test_header" … … 170 170 style="display:none" 171 171 > 172 172 173 173 <p></p> 174 174 </div> <!-- Fonction --> … … 177 177 178 178 </fieldset> 179 179 180 180 <fieldset > 181 181 <legend>{'Sv_blackliste'|translate}</legend> 182 182 <div id="blacklisteFonction" class="instructionBlock" > 183 183 184 184 <script type="text/javascript"> 185 var is_supervisor = true; 185 var is_supervisor = true; 186 186 </script> 187 187 <div … … 198 198 > 199 199 <p>{'Sv_hlp_7_1'|translate} 200 201 202 203 204 205 200 </p> 201 <p><input type="checkbox" value="" /> {'Sv_hlp_7_1_1'|translate} </p> 202 203 <p><input type="checkbox" value="on" /> {'Sv_hlp_7_1_3'|translate} </p> 204 <p><input type="text" /> {'Sv_hlp_7_2'|translate} </p> 205 <p> <input type="button" value="{'Sv_Test'|translate}" /> {'Sv_hlp_7_3'|translate}</p> 206 206 <p><input type="button" value="{'Sv_Ajout'|translate}" /></p> 207 208 207 <p><img src="{$ROOT_URL}{$themeconf.admin_icon_dir}/plug_activate.png" /> 208 {'Sv_hlp_7_4'|translate}</p> 209 209 </div> <!-- Fonction --> 210 210 </div> <!-- Fonctions --> -
extensions/Mail_supervisor/admin/mail_superv_test.tpl
r10155 r10419 3 3 </script> 4 4 <div class="titrePage"> 5 5 <h2>{'Sv_supervisor'|translate}{'Sv_version'|translate}{$version}</h2> 6 6 </div> 7 7 <form action="" method="post" name="form"> 8 8 <fieldset> 9 9 <legend>{'Sv_Tab_test'|translate}</legend> 10 10 <fieldset> 11 11 <legend>{'Sv_message_to_send'|translate}</legend> 12 12 … … 16 16 <td> 17 17 <select name="group" onchange="this.form.submit();" > 18 {html_options options=$Group.group_options selected=$Group.selected} 18 {html_options options=$Group.group_options selected=$Group.selected} 19 19 </select> 20 20 </td> 21 22 23 21 <td > 22 {$liste} 23 </td> 24 24 </tr> 25 25 … … 31 31 </tr> 32 32 33 </table> 34 33 </table> 34 </fieldset> 35 35 <p> 36 37 38 39 </p> 36 <input class="submit" type="submit" name="Submit" value="{'Sv_refresh'|@translate}" {$tag_input_enabled} /> 37 <input class="submit" type="submit" name="Submit" id="Envoyer" value="{'Sv_Envoyer'|@translate}" {$tag_input_enabled} /> 38 39 </p> 40 40 </fieldset> 41 41 </form> -
extensions/Mail_supervisor/admin/roma/theme.css
r10385 r10419 1 .bug {1 .bug { 2 2 background-image: url('../../smilies/mouche.gif'); 3 3 background-repeat: no-repeat; … … 22 22 text-align: left; 23 23 } 24 .instructionBlockHeaderCollapsed span, .instructionBlockHeaderExpanded span{ 24 .instructionBlockHeaderCollapsed span, .instructionBlockHeaderExpanded span{ 25 25 border-bottom: none; 26 26 } -
extensions/Mail_supervisor/include/constants.php
r9702 r10419 5 5 if (!defined('MAIL_BLACK_LISTE_TABLE')) define('MAIL_BLACK_LISTE_TABLE', $prefixeTable.'mail_black_list'); 6 6 if (!defined('Sv_MAIL_TABLE')) define('Sv_MAIL_TABLE', $prefixeTable.'Sv_mail'); 7 global $superv_champs , $superv_type ,$superv_bl_champs , $superv_bl_type ;7 global $superv_champs , $superv_type ,$superv_bl_champs , $superv_bl_type ; 8 8 $superv_champs = array( 9 9 "id", 10 10 "nb_mails", 11 11 "date_mail", 12 "nb_mails_maxi", 13 "nb_mails_periode", 12 "nb_mails_maxi", 13 "nb_mails_periode", 14 14 "nb_spams", 15 "date_spam", 16 "nb_spams_maxi", 17 "nb_spams_periode", 15 "date_spam", 16 "nb_spams_maxi", 17 "nb_spams_periode", 18 18 "quarantaine", 19 19 "date_quarantaine", 20 "quarantaine_periode", 21 "message", 22 "message_test", 23 "header_text", 24 ); 25 26 27 28 29 30 "INT NOT NULL DEFAULT '2000'", 31 "TEXT" , 32 33 "INT NOT NULL DEFAULT '0'", 34 "INT NOT NULL DEFAULT '10'", 35 "TEXT" , 36 37 38 "TEXT" , 39 "TEXT" , 40 "TEXT" , 41 42 43 ); 44 45 46 47 48 49 50 "region", 51 "ville", 52 53 "fai", 54 55 56 57 58 59 60 61 62 63 64 65 66 ); 20 "quarantaine_periode", 21 "message", 22 "message_test", 23 "header_text", 24 ); 25 26 $superv_type = array( 27 " SMALLINT( 5 ) NOT NULL DEFAULT '0'" , 28 "INT NOT NULL DEFAULT '0'" , 29 "INT NOT NULL DEFAULT '0'" , 30 "INT NOT NULL DEFAULT '2000'", 31 "TEXT" , 32 "INT NOT NULL DEFAULT '0'", 33 "INT NOT NULL DEFAULT '0'", 34 "INT NOT NULL DEFAULT '10'", 35 "TEXT" , 36 "TEXT" , 37 "INT NOT NULL DEFAULT '0'", 38 "TEXT" , 39 "TEXT" , 40 "TEXT" , 41 "TEXT" , 42 43 ); 44 45 46 $superv_bl_champs = array( 47 "id", 48 "ip", 49 "pays", 50 "region", 51 "ville", 52 "adresse", 53 "fai", 54 "nb" 55 ); 56 57 $superv_bl_type = array( 58 " smallint(5) UNSIGNED NOT NULL auto_increment ", 59 "TEXT" , 60 "TEXT" , 61 "TEXT" , 62 "TEXT" , 63 "TEXT" , 64 "TEXT" , 65 " smallint(5) UNSIGNED " 66 ); 67 67 68 68 ?> -
extensions/Mail_supervisor/include/fonctions.php
r10385 r10419 26 26 27 27 28 global $superv_champs , $superv_type ,$superv_bl_champs , $superv_bl_type ;28 global $superv_champs , $superv_type ,$superv_bl_champs , $superv_bl_type ; 29 29 // if (!isset($_COOKIE[session_name()])){} 30 30 … … 32 32 global $template ; 33 33 //=============================================== 34 function corrige_header($Carbonne,$headers,$args,$cl_list_mail,$mailto="") 34 function corrige_header($Carbonne,$headers,$args,$cl_list_mail,$mailto="") { 35 35 global $mails_options,$conf_mail,$infos_message; 36 36 if (!empty($args[$Carbonne]) && count($args[$Carbonne]) > 0 ){ 37 $cl_list_mail = str_replace(","," , ",get_strict_email_list(implode(',', $args[$Carbonne])))." \n" ; 37 $cl_list_mail = str_replace(","," , ",get_strict_email_list(implode(',', $args[$Carbonne])))." \n" ; 38 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 ; 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 43 } else { 44 44 // Raz Bcc, Cc dans headers 45 45 $headers = preg_replace('/.*'.$Carbonne.'(.*).\n/i', "" , $headers); 46 $ret->list_mail = "" ; 47 } 48 $ret->headers = $headers ; 49 return $ret; 50 } 51 46 $ret->list_mail = "" ; 47 } 48 $ret->headers = $headers ; 49 return $ret; 50 } 51 52 52 function int_to_heure($int){ 53 53 global $lang,$mails_donnees ; … … 56 56 57 57 58 59 $week = (int) ($int/$delta); 60 $int= $int-($week*$delta) ; 61 62 63 $day= (int) ($int/$delta); 64 65 66 67 68 69 70 71 72 73 74 75 $day = substr ('00'. $day,-2,2); 76 $heures = substr ('00'. $heures,-2,2); 77 78 79 58 $delta=(7*24*60*60) ; 59 $week = (int) ($int/$delta); 60 $int= $int-($week*$delta) ; 61 62 $delta=(24*60*60) ; 63 $day= (int) ($int/$delta); 64 $int=$int-($day*$delta); 65 66 $delta=(60*60) ; 67 $heures=(int) ($int/$delta); 68 $int=$int-($heures*$delta); 69 70 $delta=(60) ; 71 $minutes=(int) ($int/$delta); 72 $int= $int - ($minutes*$delta); 73 74 $secondes=(int) ($int); 75 $day = substr ('00'. $day,-2,2); 76 $heures = substr ('00'. $heures,-2,2); 77 $minutes = substr ('00'.$minutes,-2,2); 78 $secondes = substr ('00'.$secondes,-2,2); 79 80 80 $retour=""; 81 81 $Week=explode(" ",l10n('Week %d')); … … 88 88 if ($secondes > 0) $retour .= "+" . $secondes." " .l10n('Second'); 89 89 $retour=str_replace("+0","+",$retour); 90 //================================================================================================ 90 //================================================================================================ 91 91 return $retour; 92 } 93 94 92 } 93 94 95 95 function verif_base(){ 96 96 global $lang,$superv_champs,$superv_type,$superv_bl_champs,$superv_bl_type; 97 97 load_language('plugin.lang', MAIL_SUPERV_PATH); 98 //============================================================================== 98 //============================================================================== 99 99 create_table(MAIL_BLACK_LISTE_TABLE,$superv_bl_champs,$superv_bl_type) ; 100 ajust_table(MAIL_BLACK_LISTE_TABLE,$superv_bl_champs,$superv_bl_type) ; 101 //============================================================================== 100 ajust_table(MAIL_BLACK_LISTE_TABLE,$superv_bl_champs,$superv_bl_type) ; 101 //============================================================================== 102 102 create_table(mail_superv_TABLE,$superv_champs,$superv_type) ; 103 103 ajust_table(mail_superv_TABLE,$superv_champs,$superv_type) ; 104 //============================================================================== 105 $valeurs= array ( 106 107 108 109 110 111 112 113 114 115 116 117 104 //============================================================================== 105 $valeurs= array ( 1, 106 0, 107 time(), 108 2000, 109 '"604800"' , 110 0, 111 time(), 112 10, 113 '"172800"', 114 '"false"', 115 time(), 116 '"172800"', 117 '"Init"', 118 118 '"'.l10n('Sv_supervisor').'"', 119 120 121 119 '"'.l10n('hello').'"', 120 ); 121 ajout_ligne(mail_superv_TABLE,$superv_champs, $valeurs,false ) ; 122 122 } 123 123 //================================================================================= … … 134 134 array_push($columns_of, $row[0]); 135 135 } 136 136 137 137 return $columns_of; 138 138 } … … 152 152 LEFT JOIN '.USER_GROUP_TABLE.' AS ug 153 153 ON u.'.$conf['user_fields']['id'].' = ug.user_id 154 WHERE ug.group_id='.$group_id.' '; 154 WHERE ug.group_id='.$group_id.' '; 155 155 $groups=array(); 156 $datas = pwg_query($query); 157 156 $datas = pwg_query($query); 157 158 158 if (!empty($datas)) { 159 while ($group = mysql_fetch_array($datas,MYSQL_ASSOC)){ 160 if (!empty($group['email'])){ 159 while ($group = mysql_fetch_array($datas,MYSQL_ASSOC)){ 160 if (!empty($group['email'])){ 161 161 array_push($groups, format_email($group['username'], $group['email'] )); 162 162 } 163 163 } 164 } 164 } 165 165 return $groups ; 166 166 167 167 } 168 168 //================================================================================= … … 170 170 function create_table($nom_table,$champs,$types) //mail_superv_TABLE 171 171 { 172 173 172 $i=0; 173 $valeurs=array(); 174 174 foreach ( $champs as $champ) { 175 175 $champ = trim($champ); … … 179 179 180 180 181 182 181 182 if ( count($valeurs) == 0) return ; 183 183 184 184 $valeurs=implode(", ",$valeurs) ; 185 186 $query = "CREATE TABLE IF NOT EXISTS `" . $nom_table . "` (". $valeurs . " , PRIMARY KEY (`id` ) ) ENGINE=MyISAM ;"; 187 if ( pwg_query($query) ) return ; 188 die("ERREUR CREATION ".$query); 189 190 185 //=============================================================================== 186 $query = "CREATE TABLE IF NOT EXISTS `" . $nom_table . "` (". $valeurs . " , PRIMARY KEY (`id` ) ) ENGINE=MyISAM ;"; 187 if ( pwg_query($query) ) return ; 188 die("ERREUR CREATION ".$query); 189 190 191 191 } 192 192 function ajust_table($nom_table,$champs,$types) //mail_superv_TABLE … … 194 194 global $infos_message ; 195 195 $colonnes = Get_colonnes_de($nom_table); 196 $data =$types ;197 198 196 $data = $types ; 197 $i=0; 198 $valeurs=array(); 199 199 foreach ( $champs as $champ) 200 200 { 201 201 $champ = trim($champ); 202 202 if (!in_array( $champ,$colonnes)) { 203 203 array_push($valeurs , " ADD `".$champ."`" . ' ' . $data[ $i] ) ; 204 205 206 207 } 208 //============================================================================= 209 210 204 } 205 $i +=1; 206 207 } 208 //============================================================================= 209 if ( count($valeurs) == 0) return ; 210 211 211 $infos_message .= "AJUSTE TABLE : ". $nom_table . "<br />" . "NB (col) : ". count($colonnes) . mail_supervisor::Memo_Var($valeurs) . "<br />" ; 212 212 213 213 $valeurs=implode(", ",$valeurs) ; 214 215 216 if ( pwg_query($query)) return ; 217 218 } 219 //============================================================================== 214 //=============================================================================== 215 $query = "ALTER TABLE `" . $nom_table . "` ". $valeurs ; 216 if ( pwg_query($query)) return ; 217 die($query); 218 } 219 //============================================================================== 220 220 function ajout_ligne($nom_table,$champs,$valeurs,$force) 221 221 { 222 222 if (!$force) { 223 223 $query = " 224 SELECT `id` , COUNT(`id`) as total225 226 ;";227 228 229 224 SELECT `id` , COUNT(`id`) as total 225 FROM `".$nom_table."` GROUP by `id` 226 ;"; 227 list($count) = mysql_fetch_row(pwg_query($query)); 228 229 230 230 }else{ 231 231 232 233 } 234 232 $count = 0 ; 233 } 234 235 235 if ($count == 0) 236 236 { 237 237 $n_champs=implode(",",$champs); 238 238 $n_valeurs=implode(",",$valeurs); 239 240 INSERT INTO `".$nom_table."` (". $n_champs.")241 VALUES ( ". 242 243 244 245 239 $query = " 240 INSERT INTO `".$nom_table."` (". $n_champs.") 241 VALUES ( ". $n_valeurs .")"; 242 243 if (pwg_query($query)) return ; 244 die($query); 245 246 246 } 247 247 } … … 260 260 if (!is_numeric($mails_donnees['quarantaine_periode'])){ 261 261 $periode=Str_To_Time( $mails_donnees['quarantaine_periode'],0); 262 $mails_donnees['quarantaine_periode']= ($periode > 0) ? $periode : '172800' ; 262 $mails_donnees['quarantaine_periode']= ($periode > 0) ? $periode : '172800' ; 263 263 } 264 264 if ($infos_message != "") { 265 265 array_push($page['infos'], $infos_message); 266 266 $infos_message=""; 267 } 267 } 268 268 if ($erreur_message != "") { 269 269 array_push($page['errors'], $erreur_message); 270 270 $erreur_message =""; 271 } 272 271 } 272 273 273 } 274 274 //======================================================================= … … 295 295 $lang['Sv_'. $lang['Sv_second']] = 'second'; 296 296 297 } 298 //--- traduction --> anglais --- 297 } 298 //--- traduction --> anglais --- 299 299 300 300 //========= suppression numeric et symbole ========== 301 $new_valeur =( preg_replace("/[0-9+\-.*\/()%]/"," ",$a_ajouter)); 301 $new_valeur =( preg_replace("/[0-9+\-.*\/()%]/"," ",$a_ajouter)); 302 302 $nv = trim( sup_double_espace($new_valeur)) ; 303 304 305 306 307 308 309 310 303 304 305 306 $conv['week']= (7*24*60*60); 307 $conv['day']= (24*60*60); 308 $conv['hour']= (60*60) ; 309 $conv['minute']= 60 ; 310 $conv['second']= 1; 311 311 312 312 $nv = explode(" ", $nv ); 313 313 314 314 foreach($nv as $nv1){ 315 315 if (!isset($lang['Sv_'. $nv1]) ) { 316 //==== au cas pluriel === 317 $nv0 = substr($nv1, 0,-1) ; 316 //==== au cas pluriel === 317 $nv0 = substr($nv1, 0,-1) ; 318 318 $a_ajouter= str_replace( $nv1,$nv0, $a_ajouter); 319 $nv1 = $nv0 ; 320 } 319 $nv1 = $nv0 ; 320 } 321 321 if (!isset($lang['Sv_'. $nv1]) ) { 322 $erreur_message .= $nv1. " ".l10n('not_found')."<br />"; 323 // die($erreur_message); 322 $erreur_message .= $nv1. " ".l10n('not_found')."<br />"; 323 // die($erreur_message); 324 324 }else { 325 ob_start(); 325 ob_start(); 326 326 $match = $conv[strtolower($lang['Sv_'. $nv1])] ; 327 327 $a_ajouter = str_replace($nv1," ". $match ." ",$a_ajouter) ; 328 328 $erreur_message .= ob_get_contents(); 329 329 ob_end_clean(); 330 } 330 } 331 331 } 332 332 … … 338 338 $new_valeur = str_replace($v1,$v2,$a_ajouter) ; 339 339 $new_valeur = str_replace('++','+',$new_valeur ) ; 340 340 341 341 return $new_valeur; 342 342 } … … 347 347 global $erreur_message,$infos_message,$user; 348 348 global $lang; 349 349 350 350 $ajout=ucwords ($ajout); 351 352 351 352 353 353 if (is_numeric($ajout)) 354 354 $valeur= $ajout ; … … 356 356 { 357 357 $valeur= Date_to_numeric( $ajout) ; 358 358 359 359 } 360 360 361 361 $new_valeur = explode( "|", $valeur ); 362 362 … … 365 365 $erreur = false; 366 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 367 //$new_valeur = $a_ajouter + $init_date ; 368 foreach($new_valeur as $nv) 369 { 370 $return = matheval($nv) ; 371 if (strpos("error",$return)===false) { 372 $p += $return ; 373 }else { 374 $erreur_message .= "[" . $ajout . "] --> " . l10n('Sv_syntax_error') . " : " . $nv ."<br />"; 375 $erreur = true; 376 } 377 378 379 } 380 if ($erreur) $p = -1000 ; 381 381 return intval($p) ; 382 382 383 383 } 384 384 //===================================================================================== 385 function matheval($equation) 386 { 385 function matheval($equation) 386 { 387 387 388 388 $return="error"; 389 389 390 391 $equation = preg_replace("/[^0-9+\-.*\/()%]/","",$equation); 392 $equation = preg_replace("/([+-])([0-9]{1})(%)/","*(1\$1.0\$2)",$equation); 393 $equation = preg_replace("/([+-])([0-9]+)(%)/","*(1\$1.\$2)",$equation); 394 $equation = preg_replace("/([0-9]+)(%)/",".\$1",$equation); 395 396 if ( $equation == "" ) 397 { 398 $return = 0; 399 } else { 400 @eval("\$return=" . $equation . ";" ); 401 } 402 return $return; 403 404 } 390 391 $equation = preg_replace("/[^0-9+\-.*\/()%]/","",$equation); 392 $equation = preg_replace("/([+-])([0-9]{1})(%)/","*(1\$1.0\$2)",$equation); 393 $equation = preg_replace("/([+-])([0-9]+)(%)/","*(1\$1.\$2)",$equation); 394 $equation = preg_replace("/([0-9]+)(%)/",".\$1",$equation); 395 396 if ( $equation == "" ) 397 { 398 $return = 0; 399 } else { 400 @eval("\$return=" . $equation . ";" ); 401 } 402 return $return; 403 404 } 405 405 406 406 //====================================================================================== 407 407 function sup_double_espace($chaine){ 408 408 global $erreur_message; 409 410 411 409 $str_temp = $chaine." "; 410 $sep=" "; 411 $chaine = trim($chaine); 412 412 if ($chaine=="") return ; 413 414 415 $str_temp = str_replace($sep.$sep, $sep, $chaine );416 417 // 418 419 420 421 422 } 423 //==================== TEST black_liste ============================================ 413 $existe = (strpos($sep.$sep,$chaine )===false) ; 414 while ($existe ){ 415 $str_temp = str_replace($sep.$sep, $sep, $chaine ); 416 if($str_temp == $chaine ) return $chaine ; 417 // $erreur_message .= mail_supervisor::Memo_Var($str_temp) ; 418 $chaine = $str_temp; 419 $existe = (strpos($sep.$sep,$chaine )===false) ; 420 } 421 return $chaine; 422 } 423 //==================== TEST black_liste ============================================ 424 424 function kill_list() { 425 425 global $pays,$region,$ville,$ip ; 426 global $erreur_message,$infos_message,$conf; 426 global $erreur_message,$infos_message,$conf; 427 427 global $conf, $user, $page; 428 428 global $mails_options ; 429 global $superv_bl_champs,$superv_bl_type ; 430 global $nb ; 429 global $superv_bl_champs,$superv_bl_type ; 430 global $nb ; 431 431 if (!isset($ip)) { 432 432 if (getenv("HTTP_CLIENT_IP")) { … … 437 437 } 438 438 $champs=implode(',',$superv_bl_champs); 439 $query = "SELECT ".$champs.",COUNT(`ip`) as total 440 FROM `".MAIL_BLACK_LISTE_TABLE."` 441 WHERE '".$ip."' LIKE `ip` 442 GROUP by `ip` 443 ;"; 444 445 446 447 448 449 450 $nb = $datas['total']|0;451 //======================================================================= 452 if ($mails_options['set_auto'] == 'on') { 439 $query = "SELECT ".$champs.",COUNT(`ip`) as total 440 FROM `".MAIL_BLACK_LISTE_TABLE."` 441 WHERE '".$ip."' LIKE `ip` 442 GROUP by `ip` 443 ;"; 444 $result = @pwg_query($query); 445 if (!$result) { 446 verif_base(); 447 $result = @pwg_query($query); 448 } 449 $datas = mysql_fetch_array($result,MYSQL_ASSOC); 450 $nb = $datas['total']|0; 451 //======================================================================= 452 if ($mails_options['set_auto'] == 'on') { 453 453 global $user_name,$mail_adresse; 454 454 455 455 if (isset($nb) && $nb>0) { 456 //if (test_spam($ip,$user['username'] ,$user['email'])) // ne plus tester automatiquement . 456 //if (test_spam($ip,$user['username'] ,$user['email'])) // ne plus tester automatiquement . 457 457 if ($nb==0) { 458 459 460 461 "'".$region."'", 462 463 464 "'".$user['username']."'", 465 466 467 ajout_ligne(MAIL_BLACK_LISTE_TABLE,$superv_bl_champs, $valeurs,$nb==0) ;468 }else{ 469 mail_supervisor::Get_geo(); 470 $nb +=1; 471 472 if (isset($_POST['pays'])) 473 474 475 `ville` = '" . $ville . "', 476 "; 477 $query .= "`adresse` = '".$user['email']."', 478 `fai` = '".$user['username']."', 479 480 WHERE '".$ip."' like `ip` "; 481 pwg_query($query ); 482 483 484 // die($nb." ".$ip." ".$user['username']." ".$user['email']); 485 486 return true ; 487 } 458 $valeurs=array( 'NULL', 459 "'".$ip."'", 460 "'".$pays."'", 461 "'".$region."'", 462 "'".$ville."'", 463 "'".$user['email']."'", 464 "'".$user['username']."'", 465 $nb+1 466 ); 467 ajout_ligne(MAIL_BLACK_LISTE_TABLE,$superv_bl_champs, $valeurs,$nb==0) ; 468 }else{ 469 mail_supervisor::Get_geo(); 470 $nb +=1; 471 $query ="UPDATE " . MAIL_BLACK_LISTE_TABLE . " SET "; 472 if (isset($_POST['pays'])) 473 $query .= "`pays` = '". $pays ."', 474 `region` = '" . $region ."', 475 `ville` = '" . $ville . "', 476 "; 477 $query .= "`adresse` = '".$user['email']."', 478 `fai` = '".$user['username']."', 479 `nb` = " . $nb . " 480 WHERE '".$ip."' like `ip` "; 481 pwg_query($query ); 482 } 483 $erreur_message .= $pays . $ip ." <br />User Name :".$user['username']."<br />User Mail :".$user['email'] . ' -----> ' . l10n('Sv_black_liste') ; 484 // die($nb." ".$ip." ".$user['username']." ".$user['email']); 485 486 return true ; 487 } 488 488 } 489 489 //============================================================================== 490 490 491 if ( $mails_options['ip'] == $ip ) return ($nb > 0) ; 491 if ( $mails_options['ip'] == $ip ) return ($nb > 0) ; 492 492 $ip0= $mails_options['ip'] ; 493 $mails_options['ip'] = $ip ; 494 mail_supervisor::sauve_options(); 495 496 497 498 SELECT ".$champs.",COUNT(`id`) as total499 FROM `".MAIL_BLACK_LISTE_TABLE."`500 WHERE '".$ip."' = `ip` 501 GROUP by `ip` 502 ;";503 504 505 506 507 508 509 510 $nb = $datas['total']; 511 512 513 514 $erreur_message .= $ip0 . ' | ' .$ip . ' | ' . $pays . ' | ' . $region . ' | ' . $ville . ' ' . $nb . ' ==> '; 515 516 517 518 519 520 521 "'".$region."'", 522 523 "'".$user['email']."'", 524 "'".$user['username']."'", 525 526 527 ajout_ligne(MAIL_BLACK_LISTE_TABLE,$superv_bl_champs, $valeurs,true) ; 528 529 530 531 532 UPDATE " . MAIL_BLACK_LISTE_TABLE . " 533 534 if (isset($_POST['pays'])) 535 $query .= " 536 537 538 539 540 $query .= " 541 542 `fai` = '".$user['username']."', 543 544 WHERE '".$ip."' = `ip` 545 546 547 pwg_query($query ); 548 549 493 $mails_options['ip'] = $ip ; 494 mail_supervisor::sauve_options(); 495 if ( $nb > 0 ) 496 { 497 $query = " 498 SELECT ".$champs.",COUNT(`id`) as total 499 FROM `".MAIL_BLACK_LISTE_TABLE."` 500 WHERE '".$ip."' = `ip` 501 GROUP by `ip` 502 ;"; 503 $result = @pwg_query($query); 504 505 if (!$result) { 506 verif_base(); 507 $result = @pwg_query($query); 508 } 509 $datas = mysql_fetch_array($result,MYSQL_ASSOC); 510 $nb = $datas['total']; 511 512 $row = mysql_fetch_row(pwg_query($query)); 513 $nb = ($row[7]); 514 $erreur_message .= $ip0 . ' | ' .$ip . ' | ' . $pays . ' | ' . $region . ' | ' . $ville . ' ' . $nb . ' ==> '; 515 516 if ($nb == 0) 517 { 518 $valeurs=array( 'NULL', 519 "'".$ip."'", 520 "'".$pays."'", 521 "'".$region."'", 522 "'".$ville."'", 523 "'".$user['email']."'", 524 "'".$user['username']."'", 525 1 526 ); 527 ajout_ligne(MAIL_BLACK_LISTE_TABLE,$superv_bl_champs, $valeurs,true) ; 528 529 } else { 530 $nb += 1; 531 $query =" 532 UPDATE " . MAIL_BLACK_LISTE_TABLE . " 533 SET "; 534 if (isset($_POST['pays'])) 535 $query .= " 536 `pays` = '". $pays ."', 537 `region` = '" . $region ."', 538 `ville` = '" . $ville . "', 539 "; 540 $query .= " 541 `adresse` = '".$user['email']."', 542 `fai` = '".$user['username']."', 543 `nb` = " . $nb . " 544 WHERE '".$ip."' = `ip` 545 "; 546 547 pwg_query($query ); 548 } 549 } 550 550 return ($nb > 0) ; 551 551 } … … 558 558 $result=""; 559 559 $ip= sup_double_espace($ip); 560 if (strlen($ip)>3) { 560 if (strlen($ip)>3) { 561 561 //================== Verifie si l'IP est correct ================================ 562 if (clj_is_ip($ip)){ 563 564 } else { 565 //================== Verifie si l'adresse mail est correcte ================================ 566 if( clj_is_mail($ip) ){ 567 568 569 570 571 572 //================== Login ================ 573 574 575 576 } 562 if (clj_is_ip($ip)){ 563 564 } else { 565 //================== Verifie si l'adresse mail est correcte ================================ 566 if( clj_is_mail($ip) ){ 567 $mail_adresse=$ip ; 568 $ip=""; 569 } 570 else 571 { 572 //================== Login ================ 573 $user_name=$ip; 574 $ip=""; 575 } 576 } 577 577 //============================================================================= 578 578 } … … 582 582 $user_name=""; // ne plus tester sur le login. 583 583 $mail_adresse =str_replace(" ","%20",trim($mail_adresse)); 584 if ( strlen($user_name) > 3) 584 if ( strlen($user_name) > 3) $type[]="username=$user_name" ; 585 585 if ( strlen($mail_adresse) > 3) $type[]="email=".$mail_adresse ; 586 if ( strlen($ip) > 3) $type[]="ip=".$ip ; 587 foreach ( $type as $fil ) { 586 if ( strlen($ip) > 3) $type[]="ip=".$ip ; 587 foreach ( $type as $fil ) { 588 588 $resultat=""; 589 589 if ( clj_fetchRemote($src.$fil , $resultat,1)) 590 $result .= $resultat.'<br />' ; 590 $result .= $resultat.'<br />' ; 591 591 } 592 592 593 593 return !(strpos( $result ,'yes' ) === false) ; 594 594 595 595 } 596 596 //================================================================== 597 597 function lire_fichier_distant($fichier){ 598 598 $buffer=""; 599 $handle = @fopen($fichier,"r"); 599 $handle = @fopen($fichier,"r"); 600 600 if ($handle) { 601 while (!feof($handle)) { 601 while (!feof($handle)) { 602 602 $buffer .= fgets($handle, 4096); 603 } 604 605 606 603 } 604 fclose($handle); 605 } 606 607 607 return $buffer ; 608 608 … … 611 611 function clj_is_ip($ip){ 612 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 ; 613 613 614 614 } 615 615 616 616 function clj_is_mail($mail) 617 { 618 619 if(preg_match('/^[\w.-]+@[\w.-]+\.[a-zA-Z]{2,5}$/' ,$mail)) return true ; 620 if(preg_match('/#^[\w.-]+@[\w.-]+\.[a-zA-Z]{2,5}$#/' ,$mail)) return true ; 621 } 622 623 617 { 618 619 if(preg_match('/^[\w.-]+@[\w.-]+\.[a-zA-Z]{2,5}$/' ,$mail)) return true ; 620 if(preg_match('/#^[\w.-]+@[\w.-]+\.[a-zA-Z]{2,5}$#/' ,$mail)) return true ; 621 } 622 623 624 624 function clj_fetchRemote($src, &$dest, $timeout=1, $user_agent='Piwigo', $step=0) 625 625 { … … 628 628 629 629 if ($src=="") return ; 630 630 631 631 if (!url_is_remote($src)) 632 632 { 633 633 634 634 $content = @file_get_contents($src); 635 635 if ($content !== false) … … 643 643 } 644 644 } 645 645 646 646 // After 3 redirections, return false 647 647 if ($step > 3) return false; -
extensions/Mail_supervisor/include/function_test_send.php
r9702 r10419 23 23 24 24 if ( !defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); 25 function test_envoie($message,$group_name,$group_id){ 25 function test_envoie($message,$group_name,$group_id){ 26 26 global $infos_message,$erreur_message ,$conf,$user,$conf_mail,$mail_donnees,$args,$lang ; 27 $mailto=""; 27 $mailto=""; 28 28 load_language('plugin.lang', MAIL_SUPERV_PATH); 29 29 30 30 //================================================================================== 31 31 if (!isset($infos_message)) 32 33 34 32 { 33 $infos_message = ""; 34 } 35 35 if (!isset($erreur_message)) 36 37 38 36 { 37 $erreur_message = ''; 38 } 39 39 if (!isset($mails_donnees)) 40 41 42 } 40 { 41 $mails_donnees = mail_supervisor::Get_Datas(); 42 } 43 43 if (!isset($conf_mail)) 44 44 { 45 45 $conf_mail = get_mail_configuration(); 46 46 } 47 48 { 47 if (isset($args)) 48 { 49 49 $infos_message=mail_supervisor::Memo_Var($args); 50 50 }else{ 51 52 51 $args = array(); 52 } 53 53 //===================================================================================================== 54 54 55 55 56 56 57 57 $groups=get_liste($group_id); … … 62 62 $args['Bcc']=$groups; 63 63 } else { 64 $mailto = $conf_mail['formated_email_webmaster']; 65 } 66 64 $mailto = $conf_mail['formated_email_webmaster']; 65 } 66 67 67 $args['from'] =(function_exists('get_user_language_desc')) ? get_user_language_desc($conf_mail['formated_email_webmaster']):$conf_mail['formated_email_webmaster']; 68 68 $message_html =$message; 69 69 if (function_exists('get_user_language_desc') and isset($message) and $message <> '') 70 70 $message = get_user_language_desc($message)."\n\n"; 71 72 73 71 72 //================================================================== 73 $message_texte=sprintf( 74 74 l10n('Sv_message_texte %s %s %s %s'), 75 75 format_date( date("Y-m-d H:i:s")), 76 77 78 79 ); 80 81 76 $group_name, 77 $message, 78 $args['from'] 79 ); 80 //================================================================== 81 $message_html .= "</br>" . $message . "</br>" . $message_texte; 82 82 //========================================================================== 83 83 84 85 86 87 88 $ret= pwg_mail($mailto , $args); 89 90 { 91 92 93 94 95 96 97 98 99 100 84 $args['subject']="Plugin Piwigo TEST"; 85 $args['content']=$message_html; 86 $infos_message .="To :" . $mailto; 87 88 $ret= pwg_mail($mailto , $args); 89 if ( $group_name <> '' or $mailto <> '' ) 90 { 91 if ($group_name<>'') { 92 $infos_message .= '<br />'. sprintf( l10n('An information email was sent to group "%s"'), $group_name ).'<br />'; 93 } 94 if ($mailto <> '') { 95 $infos_message .= '<br />'. sprintf( l10n('Sv_mail_sent_to'), $mailto ).'<br />'; 96 } 97 98 }else{ 99 $infos_message .='<br />'.l10n('Sv_no_receiver_available') ; 100 } 101 101 } 102 102 //=============================================================================================================== … … 105 105 106 106 $mails_donnees = mail_supervisor::Get_Datas(); 107 107 if (!isset($conf_mail)) 108 108 { 109 109 $conf_mail = get_mail_configuration(); … … 112 112 load_language('plugin.lang', MAIL_SUPERV_PATH); 113 113 114 $nom ='piwigo_logo_sombre_214x100.png';115 116 117 118 $fd = fopen( $fichier, "r" ); 119 $contenu = fread( $fd, filesize( $fichier ) );120 fclose( $fd );121 $piecejointe = chunk_split(base64_encode($contenu));122 123 124 114 $nom ='piwigo_logo_sombre_214x100.png'; 115 $fichier=PHPWG_ROOT_PATH.'admin/template/goto/theme/roma/images/piwigo_logo_sombre_214x100.png' ; 116 $typemime='image/jpeg'; 117 118 $fd = fopen( $fichier, "r" ); 119 $contenu = fread( $fd, filesize( $fichier ) ); 120 fclose( $fd ); 121 $piecejointe = chunk_split(base64_encode($contenu)); 122 123 124 $from=$args['from']; 125 125 $to=""; 126 126 … … 128 128 l10n('Sv_message_texte %s %s %s'), 129 129 format_date( date("Y-m-d H:i:s")), 130 131 132 ); 133 134 135 $message_html = 136 ob_start(); 137 130 $to, 131 $from 132 ); 133 134 135 $message_html = '<img src="'.PHPWG_ROOT_PATH.'admin/template/goto/theme/roma/images/piwigo_logo_sombre_214x100.png" />'; 136 ob_start(); 137 138 138 echo str_replace("\n","<br />",$message_texte); 139 139 140 140 $message_html .= ob_get_contents()."\n"; 141 141 //ob_flush(); 142 142 ob_end_clean(); 143 143 144 $limite=$conf_mail['boundary_key']; 145 $headers = date("Y-m-d H:i:s") ."\n"; 144 $limite=$conf_mail['boundary_key']; 145 $headers = date("Y-m-d H:i:s") ."\n"; 146 146 147 147 //======================================================================================= … … 149 149 $headers.= "Reply-To: ".$args['from']."\n"; 150 150 $nb_destinataires=0; 151 $destinataire = $conf_mail['email_webmaster']; 151 $destinataire = $conf_mail['email_webmaster']; 152 152 if (!empty($args['Cc'])){ 153 153 $nb_destinataires += count($args['Cc']); 154 154 $to= explode(',', $args['Cc']); 155 $headers .= get_strict_email_list($to) ;156 157 if (!empty($args['Bcc'])){ 158 $nb_destinataires += count($args['Bcc']); 155 $headers .= get_strict_email_list($to) ; 156 } 157 if (!empty($args['Bcc'])){ 158 $nb_destinataires += count($args['Bcc']); 159 159 $to = implode(',', $args['Bcc']); 160 $headers .= 'Bcc :'.get_strict_email_list($to)."\n" ;160 $headers .= 'Bcc :'.get_strict_email_list($to)."\n" ; 161 161 } 162 162 … … 166 166 $headers.= 'MIME-Version: 1.0'."\n"; 167 167 $headers.= 'X-Mailer: Piwigo Mailer'."\n"; 168 //Le message en texte simple pour les navigateurs qui n'acceptent pas le HTML 169 $texte = "This is a multi-part message in MIME format.\n"; 170 $texte .= "-----=".$limite."\n"; 171 $texte .= "Ceci est un message est au format MIME.\n"; 172 $texte .= 'Content-Type: text/plain; charset="UTF-8"'."\n"; 173 $texte .= 'Content-Transfer-Encoding: 8bit'."\n\n"; 174 $texte .= $message_texte ; 175 $texte .= "\n\n"; 176 $texte .= "-----=".$limite."\n"; 177 $texte .= 'Content-Type: text/html; charset="UTF-8"'."\n"; 178 $texte .= 'Content-Transfer-Encoding: 8bit'."\n\n"; 179 $texte .= $message_html; 180 $texte .= "\n\n"; 181 $attachement = "-----=".$limite."\n"; 182 $attachement .= "Content-Type: ".$typemime."; name=\"".$nom."\"\n"; 183 $attachement .= "Content-Transfer-Encoding: base64\n"; 184 $attachement .= "Content-Disposition: attachment; filename=\"".$nom."\"\n\n"; 185 $attachement .= $piecejointe; 186 $attachement .= "\n\n\n-----=".$limite."\n"; 168 //Le message en texte simple pour les navigateurs qui n'acceptent pas le HTML 169 $texte = "This is a multi-part message in MIME format.\n"; 170 $texte .= "-----=".$limite."\n"; 171 $texte .= "Ceci est un message est au format MIME.\n"; 172 $texte .= 'Content-Type: text/plain; charset="UTF-8"'."\n"; 173 $texte .= 'Content-Transfer-Encoding: 8bit'."\n\n"; 174 $texte .= $message_texte ; 175 $texte .= "\n\n"; 176 $texte .= "-----=".$limite."\n"; 177 $texte .= 'Content-Type: text/html; charset="UTF-8"'."\n"; 178 $texte .= 'Content-Transfer-Encoding: 8bit'."\n\n"; 179 $texte .= $message_html; 180 $texte .= "\n\n"; 181 $attachement = "-----=".$limite."\n"; 182 $attachement .= "Content-Type: ".$typemime."; name=\"".$nom."\"\n"; 183 $attachement .= "Content-Transfer-Encoding: base64\n"; 184 $attachement .= "Content-Disposition: attachment; filename=\"".$nom."\"\n\n"; 185 $attachement .= $piecejointe; 186 $attachement .= "\n\n\n-----=".$limite."\n"; 187 187 $ret=false; 188 188 ob_start(); 189 $ret= mail( $destinataire, $args['subject'], $texte.$attachement, $headers); 189 $ret= mail( $destinataire, $args['subject'], $texte.$attachement, $headers); 190 190 $message = ob_get_contents() ; 191 191 //ob_flush(); … … 195 195 $infos_message = "-------------------"; 196 196 } 197 return $ret; 197 return $ret; 198 198 } 199 199 ?> -
extensions/Mail_supervisor/include/save_info.php
r9702 r10419 4 4 switch (strtolower($info_ip)) 5 5 { 6 case 'ajout' : 6 case 'ajout' : 7 7 $ip_black=str_replace("*","%",$ip_black); 8 8 if (!($ip_black == '')) { 9 9 $query = " 10 SELECT `ip`11 FROM `".MAIL_BLACK_LISTE_TABLE."`12 WHERE '".$ip_black."' LIKE ip 13 ;";14 //============================================================================== 10 SELECT `ip` 11 FROM `".MAIL_BLACK_LISTE_TABLE."` 12 WHERE '".$ip_black."' LIKE ip 13 ;"; 14 //============================================================================== 15 15 list($count) = mysql_fetch_row(pwg_query($query)); 16 //============================================================================== 16 //============================================================================== 17 17 $valeurs=array( 'NULL', 18 19 20 "'".$region."'", 21 22 23 24 25 26 ajout_ligne(MAIL_BLACK_LISTE_TABLE,$superv_bl_champs, $valeurs,($count==0)) ;18 "'".$ip_black."'", 19 "'".$pays."'", 20 "'".$region."'", 21 "'".$ville."'", 22 '"adresse"', 23 '"fai" ', 24 $count + 1 25 ); 26 ajout_ligne(MAIL_BLACK_LISTE_TABLE,$superv_bl_champs, $valeurs,($count==0)) ; 27 27 } 28 28 29 29 break; 30 30 //================================================================================================ 31 31 case 'raz': 32 32 $ip_black=str_replace('*',"%",$ip_black); 33 34 35 33 $query = "DELETE FROM `".MAIL_BLACK_LISTE_TABLE."` WHERE `ip` like '%".$ip_black."%' "; 34 pwg_query($query); 35 36 36 unset ($_SESSION['pwg_'.'action_spam']); 37 37 break; 38 39 default: 38 39 default: 40 40 break; 41 42 } 41 42 } 43 43 //================ Liste Black liste ================= 44 44 $query = " 45 SELECT *, COUNT(`ip`) as total , `ip` as blacklist, `ip` as U_DELETE45 SELECT *, COUNT(`ip`) as total , `ip` as blacklist, `ip` as U_DELETE 46 46 FROM ".MAIL_BLACK_LISTE_TABLE." 47 GROUP by ip 47 GROUP by ip 48 48 ;"; 49 49 $liste_bl = array(); 50 50 $result = pwg_query($query); 51 while ($row = mysql_fetch_array($result,MYSQL_ASSOC)){52 53 }54 //================ Liste IP ============== 55 $req = mysql_query('SELECT count(distinct(`IP`)) FROM '.HISTORY_TABLE.' '); 51 while ($row = mysql_fetch_array($result,MYSQL_ASSOC)) { 52 array_push($liste_bl,$row); 53 } 54 //================ Liste IP ============== 55 $req = mysql_query('SELECT count(distinct(`IP`)) FROM '.HISTORY_TABLE.' '); 56 56 $nbip = array_pop(mysql_fetch_row($req)) ; 57 57 58 $query = 'SELECT DISTINCTH.`id`,58 $query = 'SELECT DISTINCT H.`id`, 59 59 H.`date`, 60 60 H.`time`, 61 61 H.`user_id`, 62 H.`IP`, 63 COUNT(H.`IP`) as total 64 FROM '.HISTORY_TABLE.' AS H 65 WHERE "'.$ip.'"not LIKE H.`IP` 66 67 $query .= 'AND H.`IP` not IN ( SELECT `ip`62 H.`IP`, 63 COUNT(H.`IP`) as total 64 FROM '.HISTORY_TABLE.' AS H 65 WHERE "'.$ip.'"not LIKE H.`IP` ';// 66 if (count($liste_bl)>0){ 67 $query .= ' AND H.`IP` not IN ( SELECT `ip` 68 68 FROM '.MAIL_BLACK_LISTE_TABLE.' ) '; 69 } 70 71 $query .= ' 72 GROUP by H.`IP` 73 ORDER by `id` DESC 74 LIMIT '.(int)($params['per_page']*$params['start']).','.(int)$params['per_page'].' 75 ' ; 69 } 76 70 77 $result = pwg_query($query); 78 $liste_ip=array(); 79 while ($row = mysql_fetch_array($result,MYSQL_ASSOC)) { 71 $query .= ' 72 GROUP by H.`IP` 73 ORDER by `id` DESC 74 LIMIT '.(int)($params['per_page']*$params['start']).','.(int)$params['per_page'].' 75 ' ; 80 76 81 array_push($liste_ip, $row); 82 } 77 $result = pwg_query($query); 78 $liste_ip=array(); 79 while ($row = mysql_fetch_array($result,MYSQL_ASSOC)) { 80 81 array_push($liste_ip, $row); 82 } 83 83 84 84 ?> -
extensions/Mail_supervisor/language/en_UK/plugin.lang.php
r9208 r10419 6 6 //======================================================= 7 7 $lang['Sv_Datas'] = 'Datas' ; 8 $lang['Sv_Group'] = $lang['Group']; 8 $lang['Sv_Group'] = $lang['Group']; 9 9 $lang['Sv_mail_content'] = ''; 10 10 $lang['Sv_options'] = 'Options' ; … … 13 13 $lang['Sv_config'] = 'Configuration' ; 14 14 15 $lang['Sv_rest'] = 'Remain'; 15 $lang['Sv_rest'] = 'Remain'; 16 16 $lang['Sv_iP_list'] = 'IP\'s list'; 17 17 $lang['Sv_iP_adress'] = 'IP address'; … … 84 84 $lang['Sv_To_day_is'] = 'Today is:'.date('d-M-Y H:i:s') ; 85 85 86 $lang['Sv_formatdate'] = 'd-M-Y H:i:s'; 87 $lang['Sv_format'] = 'Accepted values:'; 86 $lang['Sv_formatdate'] = 'd-M-Y H:i:s'; 87 $lang['Sv_format'] = 'Accepted values:'; 88 88 89 89 … … 91 91 ON QUARANTINE!<br />'. 92 92 'Number of %s sent: %s <br />'. 93 'From : %s <br />'. 93 'From : %s <br />'. 94 94 'You still have %s before unblocking<br />'. 95 95 ' The %s <br />' ; … … 99 99 'You overpassed the number of mails within the acceptable period. <br />'. 100 100 'Number of %s sent: %s <br />'. 101 'From : %s <br />'. 101 'From : %s <br />'. 102 102 'You still have %s before unblocking<br />'. 103 103 ' The %s <br />' ; … … 113 113 $lang['Sv_message_texte "%s" "%s" "%s" "%s"'] =' 114 114 %s 115 115 '. l10n('hello') .' "%s" , 116 116 %s 117 118 '; 117 '. l10n('See you soon.') .' %s 118 '; 119 119 ?> -
extensions/Mail_supervisor/language/fr_FR/help/plugin.lang.php
r10385 r10419 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[]'; … … 46 46 $lang['Sv_hlp_4_1']='Date limite de la mise en quarantaine.'; 47 47 $lang['Sv_hlp_4_2']='Duree restante avant l\' anulation de la mise en quarantaine.'; 48 48 49 49 $lang['Sv_last_message']='Dernier message renvoye.'; 50 50 $lang['Sv_hlp_5_1']='Dernier message renvoye par la fonction mail() en cas d\'erreur.'; 51 51 52 52 53 //====================================================================== 53 //====================================================================== 54 54 $lang['Sv_hlp_7_1']='Ce module permet de creer une liste noire contenant les adresses IP indesirables.<br /> 55 ' ; 55 ' ; 56 56 $lang['Sv_hlp_7_1_1']='Option 1 Bloque l\' emission de mail si l\' adresse IP est dans la liste noire. <br /> 57 ' ; 57 ' ; 58 58 $lang['Sv_hlp_7_1_2']='Option 2 Rejet de l\' adresse IP .<br /> 59 ' ; 59 ' ; 60 60 $lang['Sv_hlp_7_1_3']='Option 2 A chaque nouvelle connexion, le module teste l\'adresses IP et la compare à la liste noire si le test est positif.<br /> 61 62 63 64 ' ; 61 Un compteur dans cette liste indique le nombre de tentative de connexion.<br /> 62 Des informations sur le pays et la ville du FAI sont egalement stockees.<br /> 63 64 ' ; 65 65 $lang['Sv_hlp_7_2']= 'Ajout manuel des adresses indesirables.<br /> 66 67 68 69 70 71 72 73 ' ; 74 $lang['Sv_hlp_7_3']= ' Cliquez ici pour verifier si l\'adresse IP ou le nom de l\'utilisateur ou l\'adresse courriel introduit dans le champs texte est dans la base de donnee de stopforumspam.Les jockers ne sont pas admis. Pour plus de renseignements voir http://www.stopforumspam.com' ; 66 67 Les jockers (*) pour remplacer un groupe d\'adresse sont autorises.<br /> 68 Exemple : 94.102.63.* : 69 Exclusion de toutes les adresses IP de 94.102.63.0 à 94.102.63.255 <br /> 70 Exemple : 94.102.*.13 : 71 Exclusion de toutes les adresses IP de 94.102.0.13 à 94.102.255.13 <br /> 72 73 ' ; 74 $lang['Sv_hlp_7_3']= ' Cliquez ici pour verifier si l\'adresse IP ou le nom de l\'utilisateur ou l\'adresse courriel introduit dans le champs texte est dans la base de donnee de stopforumspam.Les jockers ne sont pas admis. Pour plus de renseignements voir http://www.stopforumspam.com' ; 75 75 76 76 $lang['Sv_hlp_7_4']= ' Si vous decidez de bloquer cette adresse cliquez ici où sur l\'icône \'ajout\' pour mettre à jour la liste noire .<BR /> 77 78 ' ; 77 78 ' ; 79 79 ?> -
extensions/Mail_supervisor/language/fr_FR/plugin.lang.php
r9702 r10419 6 6 //======================================================= 7 7 8 $lang['Sv_Are_you_sure'] = 'Etes-vous sûr' ; 9 $lang['Sv_no_verif'] = 'IP Non vérifié.' ; 10 $lang['Sv_delete'] = 'Supprimer' ; 11 $lang['Sv_Datas'] = 'Datas' ; 12 $lang['Sv_Group'] = $lang['Group']; 8 $lang['Sv_Are_you_sure'] = 'Etes-vous sûr' ; 9 $lang['Sv_no_verif'] = 'IP Non vérifié.' ; 10 $lang['Sv_delete'] = 'Supprimer' ; 11 $lang['Sv_Datas'] = 'Datas' ; 12 $lang['Sv_Group'] = $lang['Group']; 13 13 $lang['Sv_mail_content'] = ''; 14 14 $lang['Sv_options'] = 'Options' ; 15 $lang['Sv_raz'] = 'raz' ; 16 $lang['Sv_Quarantaine'] = 'Quarantaine' ; 17 $lang['Sv_config'] = 'Configuration' ; 18 19 $lang['Sv_rest'] = 'Reste'; 20 $lang['Sv_iP_list'] = 'Liste des IP'; 15 $lang['Sv_raz'] = 'raz' ; 16 $lang['Sv_Quarantaine'] = 'Quarantaine' ; 17 $lang['Sv_config'] = 'Configuration' ; 18 19 $lang['Sv_rest'] = 'Reste'; 20 $lang['Sv_iP_list'] = 'Liste des IP'; 21 21 $lang['Sv_iP_adress'] = 'IP adresse'; 22 22 $lang['Sv_Test'] = 'Test'; … … 86 86 $lang['Sv_supervisor'] = 'Superviseur de MAILS'; 87 87 //======================================================================== 88 $lang['Sv_To_day_is'] = 'Nous sommes le:'.date('d-M-Y H:i:s') ; 88 $lang['Sv_To_day_is'] = 'Nous sommes le:'.date('d-M-Y H:i:s') ; 89 89 90 $lang['Sv_formatdate'] = 'd-M-Y H:i:s'; 91 $lang['Sv_format'] = 'Valeurs acceptées:'; 90 $lang['Sv_formatdate'] = 'd-M-Y H:i:s'; 91 $lang['Sv_format'] = 'Valeurs acceptées:'; 92 92 93 93 94 94 $lang['Sv_mise_en_quarantaine %s %s %s %s %s'] = ' 95 96 97 'Depuis le : %s <br />'. 98 99 100 95 MISE EN QUARANTAINE !<br />'. 96 'Nombre de %s envoyés : %s <br />'. 97 'Depuis le : %s <br />'. 98 'Il vous reste encore %s avant le déblocage<br />'. 99 ' Le %s <br />' ; 100 101 101 102 102 $lang['Sv_alerte_mail %s %s %s %s %s'] = ' 103 104 105 106 'Depuis le : %s <br />'. 107 108 109 110 $lang['Sv_debug_message']= 103 ALERTE !!! DANGER DE MISE EN QUARANTAINE PAR VOTRE FAI <br />'. 104 'Vous avez dépassé le nombre de mails admissibles par période. <br />'. 105 'Nombre de %s envoyés : %s <br />'. 106 'Depuis le : %s <br />'. 107 'Il vous reste encore %s avant le déblocage<br />'. 108 ' Le %s <br />' ; 109 110 $lang['Sv_debug_message']= ' 111 111 La fonction mail à retourné [%s] <br /> 112 112 MESSAGE erreur : [ %s ] <br /> … … 118 118 $lang['Sv_message_texte "%s" "%s" "%s" "%s"'] =' 119 119 %s 120 120 '. l10n('hello') .' "%s" , 121 121 %s 122 123 '; 122 '. l10n('See you soon.') .' %s 123 '; 124 124 ?> -
extensions/Mail_supervisor/mail_super.inc.php
r10385 r10419 39 39 */ 40 40 static public function init() { 41 global $template,$version,$icon_path; 41 global $template,$version,$icon_path; 42 42 $action_spam = pwg_get_session_var('action_spam') ; 43 43 $theme="default"; … … 48 48 if (PHPWG_VERSION < 2.2 ) { 49 49 $file =MAIL_SUPERV_PATH_ABS.'admin/header_2_1.tpl' ; 50 50 51 51 } else { 52 52 $file = MAIL_SUPERV_PATH_ABS.'admin/header_2_2.tpl' ; 53 53 54 54 } 55 55 if(isset($_GET['action_spam']) and $_GET['action_spam']=="no"){ … … 62 62 $profile=array('theme' => $theme, 63 63 'PHPWG_VERSION' => PHPWG_VERSION , 64 'MAIL_SUPERV_PATH' => $MAIL_SUPERV_PATH , 65 'MAIL_SUPERV_PATH_ABS' => MAIL_SUPERV_PATH_ABS 64 'MAIL_SUPERV_PATH' => $MAIL_SUPERV_PATH , 65 'MAIL_SUPERV_PATH_ABS' => MAIL_SUPERV_PATH_ABS 66 66 ); 67 67 … … 86 86 $ip=getenv("REMOTE_ADDR"); 87 87 } 88 } 88 } 89 89 // unset ($_SESSION['pwg_'.'action_spam']); 90 90 $action_spam = pwg_get_session_var('action_spam') ; 91 91 92 92 if ($action_spam == null or $action_spam == 'false') { 93 93 $action_spam = kill_list(); 94 94 } 95 95 96 if (is_bool($action_spam)) $action_spam =($action_spam == true) ? "true" : "false" ; 96 if (is_bool($action_spam)) $action_spam =($action_spam == true) ? "true" : "false" ; 97 97 if ($action_spam == "true" ) { 98 98 $erreur_message .= $ip . " " . $action_spam ; … … 122 122 else $page['infos']=Array($infos_message); 123 123 $infos_message=""; 124 } 124 } 125 125 if (isset($erreur_message)) 126 126 if ($erreur_message != "") { … … 130 130 else $page['errors']=Array($erreur_message); 131 131 $erreur_message =""; 132 } 132 } 133 133 return $action_spam; 134 134 } //fin Affiche_message … … 140 140 static public function Get_geo() { 141 141 global $info_geo,$ip,$pays,$region,$ville, $latitude ,$longitude,$mails_options; 142 //=================================================================================== 143 $info_geo = pwg_get_session_var('info_geo'); 142 //=================================================================================== 143 $info_geo = pwg_get_session_var('info_geo'); 144 144 if (count($info_geo) > 0){ 145 145 $pays = $info_geo[0]; … … 177 177 if(count($variables)>1){ 178 178 foreach($variables as $key => $line){ 179 echo $key . " => " . $line ; 179 echo $key . " => " . $line ; 180 180 echo "<br />"; 181 } 181 } 182 182 }else{ 183 183 echo "<i>".$variables."</i><br />"; … … 233 233 global $conf,$mails_options ; 234 234 $mails_options= $conf[$str_index]; 235 235 236 236 if(isset($mails_options)) 237 237 if ( preg_match("|s:(.*)|", $mails_options, $val) ) … … 239 239 else{ 240 240 $parametres=explode(",",$mails_options); 241 241 242 242 $def_para->check_mailto="on"; 243 243 $def_para->check_header_carbon="on"; 244 244 $def_para->check_header_text="on"; 245 245 $def_para->no_mail_list="on"; 246 $def_para->no_connect="on"; 247 $def_para->set_auto="on"; // Test a l'ouverture et enregistrement248 $def_para->ip="127.0.0.1"; 249 $def_para->set_id="on"; // enregistrment nouvel246 $def_para->no_connect="on"; // empeche l'ip de se connecter au site. 247 $def_para->set_auto="on"; // Test a l'ouverture et enregistrement 248 $def_para->ip="127.0.0.1"; // dernièrre adresse IP 249 $def_para->set_id="on"; // enregistrment nouvel 250 250 $i=0; 251 251 foreach ($def_para as $key => $value) { 252 252 $value=$parametres[$i]; 253 253 unset( $parametres[$i]) ; 254 $parametres[$key]= $value ; 254 $parametres[$key]= $value ; 255 255 $i++; 256 256 } 257 257 } 258 258 return mail_supervisor::Set_Options($parametres,$str_index); 259 } 259 } 260 260 //========================================================== 261 function Set_Options($parametres,$str_index){ 261 function Set_Options($parametres,$str_index){ 262 262 global $infos_message,$conf; 263 foreach ($parametres as $key => $value) { 263 foreach ($parametres as $key => $value) { 264 264 $parametres[$key]=(isset($_POST[$key]))? "on" : $value ; 265 265 } 266 $parametres['no_connect']= 'off' ; 266 $parametres['no_connect']= 'off' ; 267 267 return $parametres ; 268 268 } … … 274 274 275 275 if ( isset($mails_parametres) ) 276 {$query = '277 278 279 280 281 282 283 276 { $query = ' 277 UPDATE '.CONFIG_TABLE.' 278 SET value="'.addslashes(serialize($mails_parametres)).'" 279 WHERE param = "mail_superv" 280 LIMIT 1'; 281 pwg_query($query); 282 } 283 284 284 } 285 285 … … 287 287 function sauve_donnees(){ 288 288 global $mails_donnees,$superv_champs,$superv_type,$erreur_message ; 289 //===================================================================== 289 //===================================================================== 290 290 $clefs = $superv_champs ; 291 291 $valeurs = array(); 292 292 foreach ( $clefs as $champ){ 293 $champ = trim($champ); 294 295 293 $champ = trim($champ); 294 if ( isset($mails_donnees[ $champ ]) ) { 295 $sep= (is_string($mails_donnees[ $champ ])) ? '"' : '' ; 296 296 array_push($valeurs , "`".$champ."`" . ' = ' . $sep . $mails_donnees[ $champ ] . $sep) ; 297 }else{ 298 299 } 297 }else{ 298 array_push($valeurs , "`".$champ."`" . ' = ' . "0" ) ; 299 } 300 300 } 301 301 $valeurs = implode(", ",$valeurs) ; … … 304 304 UPDATE '.mail_superv_TABLE.' 305 305 SET '. $valeurs .' 306 307 306 WHERE `id` = 1 LIMIT 1 '; 307 ; 308 308 ob_start(); 309 309 $ret= pwg_query($query) ; … … 316 316 global $superv_champs ; 317 317 $champs = implode(",",$superv_champs ); 318 $query = "SELECT ".$champs." 318 $query = "SELECT ".$champs." 319 319 FROM ".mail_superv_TABLE." 320 320 ;"; 321 $result = @pwg_query($query); 321 $result = @pwg_query($query); 322 322 if (!$result) { 323 324 325 } 323 verif_base(); 324 $result = @pwg_query($query); 325 } 326 326 $data = mysql_fetch_array($result,MYSQL_ASSOC); 327 327 //==================================================================================== 328 $next_day = Str_To_Time( $data['nb_mails_periode'], $data['date_mail'] ); 329 $next_day = ($next_day >0) ? $next_day : (604800 + time()) ; 328 $next_day = Str_To_Time( $data['nb_mails_periode'], $data['date_mail'] ); 329 $next_day = ($next_day >0) ? $next_day : (604800 + time()) ; 330 330 $data['rest_mail'] = $next_day - time() ; 331 331 $next_day = Str_To_Time( $data['nb_spams_periode'],$data['date_spam']); 332 332 $next_day = ($next_day >0) ? $next_day : (172800 + time()) ; 333 333 $data['rest_spam'] = $next_day - time() ; 334 $next_day = Str_To_Time($data['quarantaine_periode'] ,$data['date_quarantaine']); 334 $next_day = Str_To_Time($data['quarantaine_periode'] ,$data['date_quarantaine']); 335 335 $next_day = ($next_day >0) ? $next_day : (172800 + time()) ; 336 336 337 337 if ($data['quarantaine'] == 'true' ) { 338 338 $data['reste'] = ( $next_day )-time() ; 339 339 }else{ 340 341 } 342 343 340 $data['reste'] = 0; 341 } 342 343 return $data; 344 344 } 345 345 } -
extensions/Mail_supervisor/main.inc.php
r10388 r10419 16 16 17 17 global $conf,$mails_options ; 18 include_once (MAIL_SUPERV_PATH.'include/constants.php'); 18 include_once (MAIL_SUPERV_PATH.'include/constants.php'); 19 19 include_once(MAIL_SUPERV_PATH.'mail_super.inc.php'); 20 20 … … 23 23 24 24 $mails_options = mail_supervisor::Get_Options($mails_options,"mail_superv"); 25 /* EVENT_HANDLER_PRIORITY_NEUTRAL */ 25 /* EVENT_HANDLER_PRIORITY_NEUTRAL */ 26 26 // 27 27 // 28 28 include_once (PHPWG_ROOT_PATH.'include/functions_mail.inc.php' ); 29 include_once (MAIL_SUPERV_PATH.'include/fonctions.php'); 29 include_once (MAIL_SUPERV_PATH.'include/fonctions.php'); 30 30 //===============loc_begin_index==============loc_after_page_header============================================================= 31 31 add_event_handler('loc_begin_page_header', array(&$mail_supervisor,'init') ); … … 35 35 add_event_handler('send_mail', 'clj_mail',EVENT_HANDLER_PRIORITY_NEUTRAL - 10, 6); 36 36 function clj_mail($result, $mailto, $subject, $content, $headers, $args) { 37 global $conf, $user, $lang_info; 37 global $conf, $user, $lang_info; 38 38 global $conf_mail,$mails_options,$mails_donnees ; 39 global $template,$page ,$erreur_message,$infos_message, $lang; 39 global $template,$page ,$erreur_message,$infos_message, $lang; 40 40 global $errors; 41 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 = ''; } 51 42 include_once (MAIL_SUPERV_PATH.'include/fonctions.php'); 43 load_language('plugin.lang', MAIL_SUPERV_PATH); 44 trigger_event('cl_begin_send_mail'); 45 46 // remove_event_handler('send_mail', 'pwg_send_mail'); 47 $message =""; 48 if (!isset($infos_message)) { $infos_message = ""; } 49 if (!isset($erreur_message)) { $erreur_message = ''; } 50 52 51 // $mails_options = explode("," , $conf['mail_superv']); 53 52 $envoie_ok=true ; 54 53 //======== verification si envoie de mail ou blocage connexion ===================== 55 54 56 if ($mails_options['no_mail_list']=='on' || $mails_options['no_connect'] == 'on' ) {57 55 if ($mails_options['no_mail_list']=='on' || $mails_options['no_connect'] == 'on' ) { 56 if (kill_list()) { 58 57 $nb_destinataires=0; ; 59 58 $envoie_ok= false ; 60 59 $erreur_message .= "<BR />".l10n('Sv_is_a_spam') ; 61 $infos_message = l10n('Sv_mail_not_send')."<BR />"; 60 $infos_message = l10n('Sv_mail_not_send')."<BR />"; 62 61 if ($mails_options['no_connect'] == 'on' ){ 63 if ($user['status'] == 'webmaster'){ 64 65 66 67 68 69 70 71 } 72 } 62 if ($user['status'] == 'webmaster'){ 63 //---------- continuer si web master ---------- 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 } 73 72 } 74 return true; 75 } 76 } 73 trigger_event('cl_kill_send_mail', $ip); 74 return true; 75 } 76 } 77 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'] ; 83 84 85 86 } 87 88 89 90 91 } 92 $alerte = ( $mails_donnees['reste'] >0 ) ? true : false ; 93 94 95 96 if ( ( !$alerte && !$alerte_spam && !$alerte_mail ) ) { 97 $nb_destinataires=0; 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'] ; 83 if ($rest_mail <=0 || $mails_donnees['nb_mails'] ==0 ){ 84 $mails_donnees['nb_mails'] =0 ; 85 $mails_donnees['date_mail'] = time(); 86 } 87 $rest_spam = $mails_donnees['rest_spam'] ; 88 if ($rest_spam <=0 || $mails_donnees['nb_spams'] ==0 ){ 89 $mails_donnees['nb_spams'] =0 ; 90 $mails_donnees['date_spam'] = time(); 91 } 92 $alerte = ( $mails_donnees['reste'] >0 ) ? true : false ; 93 $alerte_mail = ( $mails_donnees['nb_mails'] > $mails_donnees['nb_mails_maxi']-1 ) ? true : false ; 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 98 //==================================================== 99 $match_email = $conf_mail['email_webmaster']; 99 $match_email = $conf_mail['email_webmaster']; 100 100 101 $new_args=array(); 101 102 if( isset($args['Bcc'])) 102 foreach($args['Bcc'] as $key => $val){ 103 if (!preg_match('/'. $match_email.'/', $val)){ 103 foreach($args['Bcc'] as $key => $val){ 104 if (!preg_match('/'. $match_email.'/', $val)){ 104 105 array_push($new_args, $val); 105 106 }else{ 106 107 $mailto = $match_email; 107 108 } 108 109 } … … 110 111 //======================================================================= 111 112 $nb_destinataires=0; 112 if ($mailto<>"" ) $nb_destinataires +=1; 113 if (!empty($args['Cc'])) { 114 $nb_destinataires += count($args['Cc']); 115 116 } 117 if (!empty($args['Bcc'])) { 118 $nb_destinataires += count($args['Bcc']); 119 } 120 if ($mailto == "" && $nb_destinataires==0 ) 113 if ($mailto<>"" ) $nb_destinataires +=1; 114 if (!empty($args['Cc'])) { 115 $nb_destinataires += count($args['Cc']); 116 117 } 118 if (!empty($args['Bcc'])) { 119 $nb_destinataires += count($args['Bcc']); 120 } 121 if ($mailto == "" && $nb_destinataires==0 ) { 121 122 $mailto = $conf_mail['email_webmaster']; 122 123 $nb_destinataires ++; 123 124 } 124 125 125 126 if ($mailto == "" && $nb_destinataires > 1 )$mailto = $conf_mail['email_webmaster'];127 } 128 129 $infos_message .= "nb_destinataires : $nb_destinataires Theme :" . ($args['theme'] )."<br />";126 if ($mails_options['check_mailto'] == 'on') { 127 if ($mailto == "" && $nb_destinataires > 1 ) $mailto = $conf_mail['email_webmaster']; 128 } 129 130 $infos_message .= "nb_destinataires : $nb_destinataires Theme :" . ($args['theme'] ) ."{". $lang_info['language_name'] ."}"."<br />"; 130 131 //================= réecriture de l'entete =============================== 131 132 $match=array("<",">"); 132 $string=array("<",">") ; 133 if ( $nb_destinataires == 1 ) { 134 if ($mailto == "" ) { 135 if (!empty($args['Bcc'])){ 133 $string=array("<",">") ; 134 if ( $nb_destinataires == 1 ) { 135 if ($mailto == "" ) { 136 if (!empty($args['Bcc'])){ 136 137 $mailto = get_strict_email_list(implode(',', $args['Bcc'])); 137 138 $args['Bcc']=array(); 138 }else{ 139 }else{ 139 140 if (!empty($args['Cc']) ){ $mailto=get_strict_email_list(implode(',', $args['Cc'])); 140 141 $args['Cc']=array(); … … 148 149 $infos_message .="Destinataire:" .$mailto ; 149 150 //============================================================================= 150 151 151 152 }else{ 152 153 //=== plusieurs destinataires =========== 153 154 $cl_list_mail=""; 154 if ($mailto !="") $infos_message .="To: " . $mailto . " "."<br />" ; 155 if ($mailto !="") $infos_message .="To: " . $mailto . " "."<br />" ; 155 156 if (!empty($args['Cc'])) { 156 157 $ret= corrige_header('Cc',$headers,$args,$cl_list_mail,$mailto); 157 158 $headers = $ret->headers; 158 159 if($ret->list_mail!="") $infos_message .="Cc: " . ( $ret->list_mail)." <br />" ; 159 160 160 161 } 161 if (!empty($args['Bcc'])){ 162 $ret = corrige_header('Bcc',$headers,$args,$cl_list_mail,$mailto);162 if (!empty($args['Bcc'])){ 163 $ret = corrige_header('Bcc',$headers,$args,$cl_list_mail,$mailto); 163 164 $headers = $ret->headers ; 164 165 if($ret->list_mail!="") $infos_message .="Bcc: " . ( $ret->list_mail) ." <br />"; 165 166 } 167 168 } 169 170 166 167 } 168 $infos_message .= " " ; 169 } 170 171 171 172 //============================================================================= 172 173 if ($mails_options['check_header_text']=='on') { 173 $texte = "This is a multi-part message in MIME format.\n"; 174 $texte .= "-----=".$conf_mail['boundary_key']."\n"; 175 $texte .= "Ceci est un message est au format MIME.\n"; 176 $texte .= 'Content-Type: text/plain; charset="UTF-8"'."\n"; 177 $texte .= 'Content-Transfer-Encoding: 8bit'."\n\n"; 178 $texte .= $mails_donnees['header_text']; // A voir texte brut... 179 $texte .= "\n\n"; 174 $texte = "This is a multi-part message in MIME format.\n"; 175 $texte .= "-----=".$conf_mail['boundary_key']."\n"; 176 $texte .= "Ceci est un message est au format MIME.\n"; 177 $texte .= 'Content-Type: text/plain; charset="UTF-8"'."\n"; 178 $texte .= 'Content-Transfer-Encoding: 8bit'."\n\n"; 179 $texte .= $mails_donnees['header_text']; // A voir texte brut... 180 $texte .= "\n\n"; 180 181 $content =$texte .$content ; 181 } 182 } 182 183 // corrige erreur 'mail dropped, bare LF found' 183 /* if ( preg_match('/\n\./',$content)){ 184 /* if ( preg_match('/\n\./',$content)){ 184 185 $content=preg_replace('/\n\./', '/\n\.\./', $content); 185 186 … … 187 188 } 188 189 $content = str_replace("\n.", "\n/./.", $content); 189 $headers = str_replace("\n.", "\n..", $headers); 190 $headers = str_replace("\n.", "\n..", $headers); 190 191 $subject = str_replace("\n.", "\n..", $subject); 191 192 $mailto = str_replace("\n.", "\n..", $mailto); 192 193 */ 193 194 $ret=false; 195 //======== Non mise en quarantaine =============196 197 198 199 if ($nb_destinataires > 0) { 200 201 if( $envoie_ok) $ret = mail($mailto, $subject,$content, $headers); 202 194 195 $ret=false; 196 //======== Non mise en quarantaine ============= 197 198 199 ob_start(); 200 if ($nb_destinataires > 0) { 201 202 if( $envoie_ok) $ret = mail($mailto, $subject,$content, $headers); 203 203 204 }else{ 204 205 $message .= l10n('Sv_no_receiver_available'); … … 206 207 $message .= ob_get_contents(); 207 208 ob_end_clean(); 208 $mails_donnees['message']=$message; 209 $mails_donnees['message']=$message; 209 210 Gestion_erreurs($message,$ret,$nb_destinataires,$headers,$mailto); 210 211 } else { 211 //================== Est en quarantaine ======================= 212 $erreur_message .=l10n('Sv_To_day_is')."<br />";213 if ($alerte_spam ) { 214 $type="Spams"; 215 216 217 218 219 }220 221 $type="Mails"; 212 //================== Est en quarantaine ======================= 213 $erreur_message .= l10n('Sv_To_day_is')."<br />"; 214 if ($alerte_spam ) { 215 $type="Spams"; 216 $d1=$mails_donnees['nb_spams'] . ' \\ ' . $mails_donnees['nb_spams_maxi']; 217 $d2=$mails_donnees['nb_spams']; 218 $d3= $mails_donnees['rest_spam']; 219 $d4=time()+$d3 ; 220 } 221 if ($alerte_mail) { 222 $type="Mails"; 222 223 $d1=$mails_donnees['nb_mails']. ' \\ ' . $mails_donnees['nb_mails_maxi'];; 223 224 $d2=$mails_donnees['date_mail']; 224 225 $d3= $mails_donnees['rest_mail']; 225 226 $d4=time()+$d3 ; 226 227 228 229 230 231 232 233 }227 } 228 if ($alerte) { 229 $type="Spams(Quarantaine)"; 230 $d1=$mails_donnees['nb_spams'] . ' \\ ' . $mails_donnees['nb_spams_maxi']; 231 $d2=$mails_donnees['date_quarantaine']; 232 $d3= $mails_donnees['reste']; 233 $d4=time()+$d3 ; 234 } 234 235 $d2=date(l10n('Sv_formatdate'),$d2); 235 236 $d3=int_to_heure($d3) ; 236 237 $d4=date(l10n('Sv_formatdate'),$d4); 237 238 if ($alerte_mail) { 238 239 $erreur_message .='<br />'.sprintf(l10n('Sv_alerte_mail %s %s %s %s %s'),$type,$d1,$d2,$d3,$d4).'<br />'; 239 240 }else{ 240 241 } 242 $infos_message .= l10n('Sv_mail_not_send'); 243 } 244 $infos_message .= "<hr>"; 241 $erreur_message .='<br />'.sprintf(l10n('Sv_mise_en_quarantaine %s %s %s %s %s'),$type,$d1,$d2,$d3,$d4).'<br />'; 242 } 243 $infos_message .= l10n('Sv_mail_not_send'); 244 } 245 $infos_message .= "<hr>"; 245 246 mail_supervisor::sauve_donnees(); 246 247 mail_supervisor::affiche_message(); 247 248 return true ; 248 249 } 249 //=========================================================================================== 250 function Gestion_erreurs($message,$ret,$nb_destinataires,$headers,$mailto){ 251 global $conf, $user, $conf_mail,$mails_options,$mails_donnees , $template,$page ,$infos_message,$erreur_message,$args,$lang, $lang_info; 250 //=========================================================================================== 251 function Gestion_erreurs($message,$ret,$nb_destinataires,$headers,$mailto){ 252 global $conf, $user, $conf_mail,$mails_options,$mails_donnees , $template,$page ,$infos_message,$erreur_message,$args,$lang, $lang_info; 252 253 $match=array("<",">"); 253 $string=array("<",">") ; 254 //Warning: mail() has been disabled for security reasons 255 256 257 $headers=str_replace( $match,$string, $headers); 258 259 260 ; // Bad recipient address syntax 261 262 263 264 265 }266 267 268 269 270 271 272 273 //=============== La fonction mail retourne une erreur ========================= 274 } 275 276 if ($est_un_spam == false)277 278 if ($mails_donnees['nb_mails']==0) { $mails_donnees['date_mail'] = time(); }279 280 281 282 283 $mails_donnees['nb_spams'] += $nb_destinataires; 284 285 if ($mails_donnees['nb_spams']==0) {$mails_donnees['date_spam'] = time();}286 287 288 289 290 291 $mails_donnees['date_quarantaine']= time() ; 292 $mails_donnees['quarantaine']= true ; 293 294 295 254 $string=array("<",">") ; 255 //Warning: mail() has been disabled for security reasons 256 257 $est_un_spam =!(strpos(strtolower($message), 'spam') === false); 258 $headers=str_replace( $match,$string, $headers); 259 260 if ( ($ret==false) || ($est_un_spam==true) || ($nb_destinataires == 0) ) { 261 ; // Bad recipient address syntax 262 $pos1 = strpos(strtolower($message), 'bad recipient address syntax'); 263 if ( !($pos1 === false) ){ 264 $erreur_message .= l10n('Sv_detection_de').' Bad recipient address syntax .'; 265 $erreur_message .= l10n('Sv_verifiez_les_destinataires').' (Bcc,Cc,To)<br />'; 266 } 267 268 $erreur_message .= sprintf(l10n('Sv_debug_message'), 269 ($ret==true)? "true" : "false", 270 $message , 271 $mailto , 272 $headers , 273 $nb_destinataires ); 274 //=============== La fonction mail retourne une erreur ========================= 275 } 276 277 if ($est_un_spam == false) 278 { 279 if ($mails_donnees['nb_mails']==0) { $mails_donnees['date_mail'] = time(); } 280 $mails_donnees['nb_mails'] += $nb_destinataires; 281 } 282 else 283 { 284 $mails_donnees['nb_spams'] += $nb_destinataires; 285 //--- Detection de spam ------------------ 286 if ($mails_donnees['nb_spams']==0) {$mails_donnees['date_spam'] = time(); } 287 288 $trop_de_spam =!(strpos(strtolower($message), 'trop de spam') === false); 289 if ( $trop_de_spam ) { 290 $mails_donnees['nb_spams_maxi']=$mails_donnees['nb_spams']; 291 292 $mails_donnees['date_quarantaine']= time() ; 293 $mails_donnees['quarantaine']= true ; 294 $infos_message .= mail_supervisor::Memo_Var($mails_donnees); 295 } 296 } 296 297 $ret=true; 297 return $ret ; 298 return $ret ; 298 299 } 299 300 ?> -
extensions/Mail_supervisor/maintain.inc.php
r9702 r10419 24 24 if (!defined('MAIL_SUPERV_PATH')) define('MAIL_SUPERV_PATH' , PHPWG_PLUGINS_PATH.basename(dirname(__FILE__)).'/'); 25 25 include_once (MAIL_SUPERV_PATH.'include/constants.php'); 26 26 27 27 function plugin_install(){ 28 28 global $conf ; … … 33 33 $my_para['check_header_text']="on"; 34 34 $my_para['no_mail_list']="on"; 35 $my_para['no_connect']="off"; 36 $my_para['set_auto']="on"; // Test a l'ouverture et enregistrement37 $my_para['ip']="127.0.0.1"; 38 $my_para['set_id']="on"; // enregistrment nouvel35 $my_para['no_connect']="off"; // empeche l'ip de se connecter au site. 36 $my_para['set_auto']="on"; // Test a l'ouverture et enregistrement 37 $my_para['ip']="127.0.0.1"; // dernièrre adresse IP 38 $my_para['set_id']="on"; // enregistrment nouvel 39 39 $mails_values= addslashes(serialize($my_para)); 40 40 $query = 'INSERT INTO '.CONFIG_TABLE.' (param, value, comment) 41 41 VALUES ("mail_superv", "'.$mails_values.'" ,"Parametres du plugin Mail superviseur");'; 42 42 pwg_query($query); 43 } 43 } 44 44 } 45 45 function plugin_uninstall(){ … … 50 50 pwg_query($query); 51 51 $query = 'DROP TABLE IF EXISTS '.MAIL_BLACK_LISTE_TABLE.';'; 52 pwg_query( $query ); 52 pwg_query( $query ); 53 53 $query = 'DROP TABLE IF EXISTS '.mail_superv_TABLE.';'; 54 pwg_query( $query); 54 pwg_query( $query); 55 55 } 56 56 57 57 function plugin_activate(){ 58 include_once (MAIL_SUPERV_PATH.'include/fonctions.php'); 58 include_once (MAIL_SUPERV_PATH.'include/fonctions.php'); 59 59 verif_base() ; 60 60 }
Note: See TracChangeset
for help on using the changeset viewer.