[4020] | 1 | <?php |
---|
[4029] | 2 | // +-----------------------------------------------------------------------+ |
---|
| 3 | // | Piwigo - a PHP based picture gallery | |
---|
| 4 | // +-----------------------------------------------------------------------+ |
---|
| 5 | // | Copyright(C) 2008-2009 Piwigo Team http://piwigo.org | |
---|
| 6 | // | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net | |
---|
| 7 | // | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick | |
---|
| 8 | // +-----------------------------------------------------------------------+ |
---|
| 9 | // | This program is free software; you can redistribute it and/or modify | |
---|
| 10 | // | it under the terms of the GNU General Public License as published by | |
---|
| 11 | // | the Free Software Foundation | |
---|
| 12 | // | | |
---|
| 13 | // | This program is distributed in the hope that it will be useful, but | |
---|
| 14 | // | WITHOUT ANY WARRANTY; without even the implied warranty of | |
---|
| 15 | // | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
---|
| 16 | // | General Public License for more details. | |
---|
| 17 | // | | |
---|
| 18 | // | You should have received a copy of the GNU General Public License | |
---|
| 19 | // | along with this program; if not, write to the Free Software | |
---|
| 20 | // | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, | |
---|
| 21 | // | USA. | |
---|
| 22 | // +-----------------------------------------------------------------------+ |
---|
| 23 | |
---|
| 24 | if ( !defined('PHPWG_ROOT_PATH')) |
---|
| 25 | { |
---|
| 26 | die('Hacking attempt!'); |
---|
| 27 | } |
---|
[4132] | 28 | |
---|
[4041] | 29 | if (!defined('MAIL_SUPERV_PATH')) define('MAIL_SUPERV_PATH' , PHPWG_PLUGINS_PATH.basename(dirname(__FILE__)).'/'); |
---|
| 30 | |
---|
| 31 | |
---|
[4040] | 32 | // +-----------------------------------------------------------------------+ |
---|
| 33 | // | Check Access and exit when user status is not ok | |
---|
| 34 | // +-----------------------------------------------------------------------+ |
---|
[4132] | 35 | //check_status(ACCESS_ADMINISTRATOR); |
---|
[4020] | 36 | include_once(PHPWG_ROOT_PATH.'admin/include/functions.php'); |
---|
[4220] | 37 | include_once (PHPWG_ROOT_PATH.'admin/include/tabsheet.class.php'); |
---|
[4020] | 38 | |
---|
[4041] | 39 | |
---|
[4040] | 40 | $my_base_url = get_admin_plugin_menu_link(__FILE__); |
---|
[4054] | 41 | load_language('plugin.lang', MAIL_SUPERV_PATH); |
---|
[4065] | 42 | |
---|
[4132] | 43 | |
---|
[4040] | 44 | if (!isset($_GET['tab'])) |
---|
| 45 | $page['tab'] = 'mail_superv_admin'; |
---|
| 46 | else |
---|
| 47 | $page['tab'] = $_GET['tab']; |
---|
[4029] | 48 | |
---|
[4059] | 49 | $icon_path = 'template/yoga/icon/help.png'; |
---|
| 50 | |
---|
| 51 | $tabhelp= ' <img src="'.PHPWG_ROOT_PATH. $icon_path .'" class="button" alt="(?)"> '; |
---|
| 52 | |
---|
| 53 | |
---|
| 54 | |
---|
[4040] | 55 | $tabsheet = new tabsheet(); |
---|
| 56 | $tabsheet->add('mail_superv_admin', |
---|
| 57 | l10n('Tab_set'), |
---|
| 58 | $my_base_url.'&tab=mail_superv_admin'); |
---|
[4132] | 59 | |
---|
[4040] | 60 | $tabsheet->add('mail_superv_test', |
---|
| 61 | l10n('Tab_test'), |
---|
| 62 | $my_base_url.'&tab=mail_superv_test'); |
---|
[4132] | 63 | |
---|
| 64 | $tabsheet->add( 'mail_black_liste', |
---|
| 65 | l10n('blackliste'), |
---|
| 66 | $my_base_url.'&tab=mail_black_liste'); |
---|
| 67 | |
---|
| 68 | |
---|
[4059] | 69 | $tabsheet->add('mail_superv_help',$tabhelp |
---|
| 70 | , |
---|
[4040] | 71 | $my_base_url.'&tab=mail_superv_help'); |
---|
[4132] | 72 | |
---|
| 73 | |
---|
[4040] | 74 | $tabsheet->select($page['tab']); |
---|
| 75 | $tabsheet->assign(); |
---|
[4020] | 76 | |
---|
[4040] | 77 | $page['global'] = array(); |
---|
| 78 | $error = array(); |
---|
| 79 | |
---|
[4220] | 80 | global $user, $lang, $conf, $errors,$mails_données; |
---|
| 81 | global $args, $conf_mail,$infos_message,$erreur_message,$mails_options ; |
---|
| 82 | include_once (MAIL_SUPERV_PATH.'include/constants.php'); |
---|
[4206] | 83 | |
---|
[4220] | 84 | if (isset($conf['mail_superv'])) { |
---|
| 85 | |
---|
| 86 | include_once (MAIL_SUPERV_PATH.'include/fonctions.php'); |
---|
[4206] | 87 | $mails_options = explode("," , $conf['mail_superv']); |
---|
[4224] | 88 | if (!isset($mails_options[6])) $mails_options[6] = $_SERVER['REMOTE_ADDR'] ; |
---|
| 89 | if (!isset($mails_options[5])) $mails_options[5] = 'off' ; |
---|
| 90 | if (!isset($mails_options[4])) $mails_options[5] = 'off' ; |
---|
| 91 | if (!isset($mails_options[3])) $mails_options[5] = 'off' ; |
---|
| 92 | if (!isset($mails_options[2])) $mails_options[5] = 'off' ; |
---|
| 93 | if (!isset($mails_options[1])) $mails_options[5] = 'off' ; |
---|
| 94 | if (!isset($mails_options[0])) $mails_options[5] = 'off' ; |
---|
| 95 | |
---|
| 96 | $mails_données = Get_Datas(); |
---|
[4040] | 97 | |
---|
[4220] | 98 | |
---|
| 99 | }else { |
---|
| 100 | die ("mail"); |
---|
| 101 | } |
---|
| 102 | |
---|
| 103 | |
---|
[4052] | 104 | $aff_nb=true; |
---|
[4051] | 105 | |
---|
| 106 | |
---|
[4040] | 107 | // ************************************************************************* |
---|
| 108 | // | Sélection de l'onglet | |
---|
| 109 | // ************************************************************************* |
---|
| 110 | |
---|
| 111 | $modif=false ; |
---|
[4132] | 112 | |
---|
| 113 | |
---|
[4040] | 114 | //================================================================================ |
---|
| 115 | switch ($page['tab']) |
---|
| 116 | { |
---|
[4132] | 117 | |
---|
[4040] | 118 | // ************************************************************************* |
---|
| 119 | // initialisation | |
---|
| 120 | // ************************************************************************* |
---|
| 121 | case 'mail_superv_admin': |
---|
[4220] | 122 | |
---|
| 123 | //============================================================= |
---|
| 124 | if ( isset($_POST['submit']) ) { |
---|
| 125 | if ( $_POST['submit'] == l10n('refresh') ) { |
---|
[4040] | 126 | |
---|
[4059] | 127 | |
---|
| 128 | if ($mails_données['nb_mails'] == 0 ) |
---|
| 129 | $mails_données['date_mail'] = time(); |
---|
| 130 | |
---|
| 131 | if ($mails_données['nb_spams'] == 0 ) |
---|
| 132 | $mails_données['date_spam'] = time(); |
---|
| 133 | |
---|
| 134 | |
---|
| 135 | if ($mails_données['quarantaine'] == false) |
---|
| 136 | { $mails_données['reste'] = 0; |
---|
| 137 | $mails_données['date_quarantaine']=time(); |
---|
| 138 | } |
---|
[4220] | 139 | $infos_message .= l10n('refresh') .'<br />'; |
---|
[4059] | 140 | sauve_données(); |
---|
[4156] | 141 | $aff_nb = false ; |
---|
[4059] | 142 | |
---|
[4220] | 143 | |
---|
[4040] | 144 | } |
---|
[4020] | 145 | |
---|
[4220] | 146 | if ( $_POST['submit'] == l10n('raz') ) { |
---|
| 147 | |
---|
[4020] | 148 | $mails_données['date_quarantaine']=time(); |
---|
| 149 | $mails_données['nb_mails'] = 0 ; |
---|
| 150 | $mails_données['nb_spams'] = 0 ; |
---|
| 151 | $mails_données['date_mail'] = time(); |
---|
| 152 | $mails_données['date_spam'] = time(); |
---|
[4029] | 153 | |
---|
[4020] | 154 | $mails_données['reste'] = 0; |
---|
[4132] | 155 | $mails_données['quarantaine']='false'; |
---|
[4020] | 156 | |
---|
[4029] | 157 | sauve_données(); |
---|
[4220] | 158 | $infos_message .= l10n('raz') .'<br />'; ; |
---|
| 159 | |
---|
[4020] | 160 | } |
---|
[4206] | 161 | |
---|
[4220] | 162 | if ( $_POST['submit'] == l10n('Valider') ) |
---|
[4020] | 163 | { |
---|
[4156] | 164 | |
---|
[4206] | 165 | $mails_options[0] = isset($_POST['check_mailto']) ? $_POST['check_mailto'] : 'off' ; |
---|
| 166 | $mails_options[1] = isset($_POST['check_header_carbon']) ? $_POST['check_header_carbon'] : 'off' ; |
---|
| 167 | $mails_options[2] = isset($_POST['check_header_text']) ? $_POST['check_header_text'] : 'off' ; |
---|
[4020] | 168 | |
---|
| 169 | //données |
---|
| 170 | $mails_données['nb_mails_maxi'] = isset($_POST['nb_mails_maxi']) ? $_POST['nb_mails_maxi'] : $mails_données['nb_mails_maxi'] ; |
---|
| 171 | $mails_données['nb_mails_periode'] = isset($_POST['nb_mails_periode']) ? $_POST['nb_mails_periode'] : $mails_données['nb_mails_periode'] ; |
---|
| 172 | $mails_données['nb_spams_maxi'] = isset($_POST['nb_spams_maxi']) ? $_POST['nb_spams_maxi'] : $mails_données['nb_spams_maxi'] ; |
---|
| 173 | $mails_données['nb_spams_periode'] = isset($_POST['nb_spams_periode']) ? $_POST['nb_spams_periode'] : $mails_données['nb_spams_periode'] ; |
---|
[4029] | 174 | $mails_données['quarantaine_periode'] = isset($_POST['quarantaine_periode']) ? $_POST['quarantaine_periode'] : $mails_données['quarantaine_periode'] ; |
---|
[4020] | 175 | |
---|
| 176 | $mails_données['message'] = isset($_POST['content']) ? $_POST['content'] : $mails_données['message'] ; |
---|
| 177 | $mails_données['header_text'] = isset($_POST['header_text']) ? $_POST['header_text'] : $mails_données['header_text'] ; |
---|
[4180] | 178 | //======================================================================================================= |
---|
[4029] | 179 | sauve_options(); |
---|
| 180 | sauve_données(); |
---|
[4180] | 181 | //======================================================================================================= |
---|
[4220] | 182 | $infos_message .= l10n('save_config') . " : " . l10n('Datas') . "<br />" ; |
---|
[4020] | 183 | } |
---|
[4220] | 184 | } |
---|
[4206] | 185 | |
---|
[4156] | 186 | $mails_données = Get_Datas(); |
---|
[4029] | 187 | |
---|
| 188 | $rest_mail= $mails_données['rest_mail']; |
---|
| 189 | $rest_spam= $mails_données['rest_spam']; |
---|
| 190 | $reste= $mails_données['reste']; |
---|
| 191 | |
---|
[4132] | 192 | $quarantaine = ($mails_données['quarantaine'] == 'true') ? true : false ;; |
---|
| 193 | |
---|
| 194 | |
---|
| 195 | |
---|
[4059] | 196 | $PHPWG_VERSION=PHPWG_VERSION; |
---|
[4029] | 197 | |
---|
[4020] | 198 | $template->assign( |
---|
| 199 | array( |
---|
[4206] | 200 | 'check_mailto' => ($mails_options[0] == 'on') ? 'checked="checked"' : '' , |
---|
| 201 | 'check_header_carbons' => ($mails_options[1] == 'on') ? 'checked="checked"' : '' , |
---|
| 202 | 'check_header_text' => ($mails_options[2] == 'on') ? 'checked="checked"' : '' , |
---|
[4156] | 203 | |
---|
[4020] | 204 | |
---|
| 205 | 'nb_mails' => $mails_données['nb_mails'] , |
---|
[4029] | 206 | 'date_mail' => "'".date(l10n('formatdate'),$mails_données['date_mail'])."'" , |
---|
[4020] | 207 | 'nb_mails_maxi' => $mails_données['nb_mails_maxi'] , |
---|
| 208 | 'nb_mails_periode' => "'".$mails_données['nb_mails_periode']."'" , |
---|
[4029] | 209 | 'time_mails_reste' => "'".int_to_heure( $rest_mail )."'" , |
---|
[4020] | 210 | |
---|
| 211 | 'nb_spams' => $mails_données['nb_spams'] , |
---|
[4029] | 212 | 'date_spam' => "'".date(l10n('formatdate'),$mails_données['date_spam'])."'" , |
---|
[4020] | 213 | 'nb_spams_maxi' => $mails_données['nb_spams_maxi'] , |
---|
| 214 | 'nb_spams_periode' => "'".$mails_données['nb_spams_periode']."'" , |
---|
[4029] | 215 | 'time_spams_reste' => "'".int_to_heure($rest_spam)."'" , |
---|
[4020] | 216 | |
---|
[4132] | 217 | 'quarantaine' => $quarantaine , |
---|
[4059] | 218 | 'date_quarantaine' => "'".date(l10n('formatdate'),time()+$reste)."'" , |
---|
[4029] | 219 | 'quarantaine_periode' => "'".$mails_données['quarantaine_periode']."'" , |
---|
| 220 | 'reste' => "'".int_to_heure($reste)."'", |
---|
[4020] | 221 | |
---|
| 222 | 'message' => $mails_données['message'] , |
---|
| 223 | 'header_text' => "'".$mails_données['header_text']."'" , |
---|
[4029] | 224 | |
---|
[4059] | 225 | 'PHPWG_VERSION' => PHPWG_VERSION , |
---|
| 226 | |
---|
[4029] | 227 | |
---|
[4020] | 228 | ) |
---|
| 229 | ); |
---|
| 230 | |
---|
[4040] | 231 | $template->set_filenames(array('plugin_admin_content' => realpath(MAIL_SUPERV_PATH . 'admin/mail_superv_admin.tpl'))); |
---|
| 232 | $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content'); |
---|
| 233 | |
---|
| 234 | break; |
---|
| 235 | |
---|
| 236 | |
---|
| 237 | // ************************************************************************* |
---|
| 238 | // TEST | |
---|
| 239 | // ************************************************************************* |
---|
| 240 | |
---|
| 241 | case 'mail_superv_test': |
---|
| 242 | |
---|
| 243 | $mails_données = Get_Datas() ; |
---|
| 244 | |
---|
| 245 | $group_id = isset($_POST['group']) ? $_POST['group'] : '-1' ; |
---|
| 246 | if ($group_id >= 0) { |
---|
| 247 | $query = ' |
---|
| 248 | SELECT |
---|
| 249 | name |
---|
| 250 | FROM '.GROUPS_TABLE.' |
---|
| 251 | WHERE id = '.$group_id.' |
---|
| 252 | ;'; |
---|
| 253 | list($group_name) = mysql_fetch_row(pwg_query($query)); |
---|
[4054] | 254 | } else { |
---|
| 255 | $group_name=""; |
---|
[4040] | 256 | } |
---|
| 257 | //================================================ |
---|
[4020] | 258 | |
---|
| 259 | |
---|
[4040] | 260 | |
---|
| 261 | if ( isset($_POST['test_envoie']) ) { |
---|
[4054] | 262 | |
---|
[4040] | 263 | $mails_données['message_test'] = isset($_POST['content']) ? $_POST['content'] : $mails_données['message_test'] ; |
---|
| 264 | $message=$mails_données['message_test']; |
---|
| 265 | sauve_données(); |
---|
| 266 | test_envoie($message,$group_name,$group_id); |
---|
| 267 | $mails_données = Get_Datas() ; |
---|
[4054] | 268 | |
---|
[4040] | 269 | } |
---|
| 270 | |
---|
| 271 | $groups[-1] = '---------'; |
---|
| 272 | |
---|
| 273 | $query = ' |
---|
| 274 | SELECT id, name |
---|
| 275 | FROM '.GROUPS_TABLE.' |
---|
| 276 | ORDER BY name ASC |
---|
| 277 | ;'; |
---|
| 278 | |
---|
| 279 | $result = pwg_query($query); |
---|
| 280 | //---------------------------------------------------------------- |
---|
[4132] | 281 | while ($row = mysql_fetch_array($result,MYSQL_ASSOC)) |
---|
[4040] | 282 | { |
---|
| 283 | $groups[$row['id']] = $row['name']; |
---|
| 284 | } |
---|
| 285 | //--------------------------------------------------------------- |
---|
| 286 | |
---|
| 287 | $template->assign( |
---|
| 288 | 'Group', |
---|
| 289 | array( |
---|
| 290 | 'group_options'=> $groups, |
---|
| 291 | 'selected' => $group_id |
---|
| 292 | ) |
---|
| 293 | ); |
---|
| 294 | //================================================================= |
---|
| 295 | $destinataires= implode("<br />",get_liste($group_id)); |
---|
| 296 | $template->assign( |
---|
| 297 | array( |
---|
| 298 | 'Groupe' => $groups, |
---|
| 299 | 'message_test' => $mails_données['message_test'] , |
---|
| 300 | 'liste' => $destinataires , |
---|
| 301 | |
---|
| 302 | ) |
---|
| 303 | ); |
---|
| 304 | |
---|
| 305 | $template->set_filenames(array('plugin_admin_content' => realpath(MAIL_SUPERV_PATH . 'admin/mail_superv_test.tpl'))); |
---|
| 306 | $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content'); |
---|
| 307 | break; |
---|
| 308 | // ************************************************************************* |
---|
[4132] | 309 | // BLACK LISTE | |
---|
| 310 | // ************************************************************************* |
---|
| 311 | case 'mail_black_liste': |
---|
[4156] | 312 | load_language('help/plugin.lang', MAIL_SUPERV_PATH); |
---|
[4220] | 313 | global $pays,$region,$ville ; |
---|
[4337] | 314 | global $user_name,$mail_adresse,$ip ; |
---|
| 315 | |
---|
[4220] | 316 | $aff_nb=false; |
---|
| 317 | //------------------------------------------------------------------------------------ |
---|
| 318 | $pays = (isset($_POST['pays'])) ? $_POST['pays'] : $pays ; |
---|
| 319 | $ville = (isset($_POST['ville'])) ? $_POST['ville']: $ville ; |
---|
| 320 | $region = isset($_POST['region']) ? $_POST['region'] : $region ; |
---|
[4224] | 321 | |
---|
| 322 | |
---|
| 323 | |
---|
[4220] | 324 | $ip = ($mails_options[6] == '') ? $_SERVER['REMOTE_ADDR'] : $mails_options[6] ; |
---|
[4180] | 325 | |
---|
[4220] | 326 | $mails_options[3] = isset($_POST['no_mail_list']) ? $_POST['no_mail_list'] : $mails_options[3] ; |
---|
| 327 | $mails_options[4] = isset($_POST['no_connect']) ? $_POST['no_connect'] : $mails_options[4] ; |
---|
| 328 | $mails_options[5] = isset($_POST['no_connect']) ? $_POST['no_connect'] : $mails_options[5] ; |
---|
[4132] | 329 | |
---|
[4220] | 330 | //======================================================================================= |
---|
| 331 | $info_ip = (isset($info_ip)) ? $info_ip : '' ; |
---|
| 332 | $info_ip = (isset($_POST['info1'])) ? $_POST['info1'] : $info_ip ; |
---|
| 333 | $info_ip = (isset($_POST['info'])) ? $_POST['info'] : $info_ip ; |
---|
| 334 | $info_ip .= ":"; |
---|
| 335 | |
---|
| 336 | $val=explode(":",$info_ip); |
---|
| 337 | $info_ip = trim($val[0]) ; |
---|
| 338 | $ip_black = trim($val[1]) ; |
---|
| 339 | |
---|
| 340 | if (isset($_POST['ip_black'])) $ip_black = ($ip_black == "" ) ? $_POST['ip_black'] : $ip_black ; |
---|
| 341 | |
---|
[4337] | 342 | $istype=""; |
---|
[4220] | 343 | |
---|
| 344 | if ( isset($_POST['submit']) ) |
---|
[4156] | 345 | { |
---|
[4337] | 346 | |
---|
| 347 | if (clj_is_ip($ip_black)) $istype='IP'; |
---|
| 348 | |
---|
| 349 | elseif (clj_is_mail($ip_black)) $istype='MAIL'; |
---|
| 350 | |
---|
| 351 | else $istype='LOGIN'; |
---|
| 352 | |
---|
[4220] | 353 | if ( $_POST['submit'] == l10n('Ajout') ) |
---|
| 354 | { |
---|
[4224] | 355 | $info_ip = 'Ajout' ; |
---|
[4220] | 356 | $ip_black = trim( $_POST['ip_black']) ; |
---|
[4224] | 357 | $infos_message .= $info_ip . '---->'. $ip_black ; |
---|
[4220] | 358 | } |
---|
[4180] | 359 | if ( $_POST['submit'] == l10n('Valider') ) |
---|
| 360 | { |
---|
[4220] | 361 | $mails_options[3] = isset($_POST['no_mail_list']) ? $_POST['no_mail_list'] : "off" ; |
---|
| 362 | $mails_options[4] = isset($_POST['no_connect']) ? $_POST['no_connect'] : "off" ; |
---|
| 363 | $mails_options[5] = isset($_POST['set_auto']) ? $_POST['set_auto'] : "off" ; |
---|
[4190] | 364 | sauve_options(); |
---|
[4220] | 365 | $infos_message .= l10n('save_config') . '<br />'; |
---|
| 366 | |
---|
[4180] | 367 | } |
---|
[4220] | 368 | } |
---|
[4180] | 369 | |
---|
[4220] | 370 | include (MAIL_SUPERV_PATH.'include/save_info.php'); |
---|
[4156] | 371 | |
---|
[4220] | 372 | //======================================================================================= |
---|
[4156] | 373 | $f_action = $my_base_url.'&tab=mail_black_liste' ; |
---|
[4132] | 374 | $champs_ip=array(); |
---|
| 375 | $champs_bl=array(); |
---|
[4156] | 376 | if (!empty($liste_ip)) $champs_ip=array_keys($liste_ip[0]); |
---|
| 377 | if (!empty($liste_bl)) $champs_bl=array_keys($liste_bl[0]); |
---|
| 378 | $smile_bonjour=MAIL_SUPERV_PATH."smilies/mouche.gif" ; |
---|
[4337] | 379 | $img_logo=MAIL_SUPERV_PATH."smilies/logo.png" ; |
---|
[4156] | 380 | $template->assign( |
---|
[4132] | 381 | array( |
---|
[4156] | 382 | 'smile_bonjour' => $smile_bonjour , |
---|
[4337] | 383 | 'img_logo' => $img_logo , |
---|
[4132] | 384 | 'champs_ip' => $champs_ip , |
---|
| 385 | 'liste_ip' => $liste_ip, |
---|
| 386 | 'champs_bl' => $champs_bl , |
---|
| 387 | 'liste_bl' => $liste_bl , |
---|
| 388 | 'conf_admin_layout' => $conf['admin_layout'] , |
---|
[4337] | 389 | 'istype' => $istype , |
---|
[4132] | 390 | 'ip_black' => $ip_black , |
---|
[4220] | 391 | 'IS_SPAM' => test_spam( $ip_black), |
---|
| 392 | 'ip_black_len' => strlen($ip_black) , |
---|
[4132] | 393 | 'MAIL_SUPERV_PATH' => MAIL_SUPERV_PATH , |
---|
[4156] | 394 | |
---|
[4132] | 395 | 'F_ACTION' => $f_action , |
---|
[4180] | 396 | |
---|
[4220] | 397 | 'no_mail_list' => ($mails_options[3] == 'on') ? 'checked="checked"' : '' , |
---|
| 398 | 'no_connect' => ($mails_options[4] == 'on') ? 'checked="checked"' : '' , |
---|
| 399 | 'set_auto' => ($mails_options[5] == 'on') ? 'checked="checked"' : '' , |
---|
| 400 | |
---|
| 401 | 'IP' => $ip , |
---|
[4180] | 402 | 'PAYS' => $pays , |
---|
| 403 | 'VILLE' => $ville , |
---|
| 404 | 'REGION' => $region , |
---|
| 405 | |
---|
[4132] | 406 | ) |
---|
| 407 | ); |
---|
[4156] | 408 | //=============================================================== |
---|
[4220] | 409 | |
---|
| 410 | |
---|
[4132] | 411 | $template->set_filenames(array('plugin_admin_content' => realpath(MAIL_SUPERV_PATH . 'admin/mail_black_liste.tpl'))); |
---|
| 412 | $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content'); |
---|
| 413 | break; |
---|
| 414 | |
---|
| 415 | // ************************************************************************* |
---|
[4040] | 416 | // AIDE | |
---|
| 417 | // ************************************************************************* |
---|
| 418 | case 'mail_superv_help': |
---|
[4052] | 419 | |
---|
[4065] | 420 | load_language('help/plugin.lang', MAIL_SUPERV_PATH); |
---|
| 421 | |
---|
[4052] | 422 | $aff_nb=false; |
---|
| 423 | $smile_bonjour=MAIL_SUPERV_PATH."smilies/bonjour.gif" ; |
---|
| 424 | $template->assign( |
---|
| 425 | array( |
---|
| 426 | 'smile_bonjour' => $smile_bonjour , |
---|
| 427 | ) |
---|
| 428 | ); |
---|
[4059] | 429 | $aff_nb = false; |
---|
[4065] | 430 | ; |
---|
[4040] | 431 | |
---|
| 432 | $template->set_filenames(array('plugin_admin_content' => realpath(MAIL_SUPERV_PATH . 'admin/mail_superv_help.tpl'))); |
---|
| 433 | $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content'); |
---|
| 434 | break; |
---|
| 435 | //==================================================================== |
---|
[4132] | 436 | } |
---|
[4040] | 437 | //================================================================================ |
---|
[4059] | 438 | |
---|
| 439 | |
---|
[4045] | 440 | if ( $mails_données['reste'] < 0 ) { |
---|
| 441 | $mails_données['quarantaine'] =false ; |
---|
| 442 | $mails_données['date_quarantaine']= time() ; |
---|
| 443 | $mails_données['nb_spams'] = 0 ; |
---|
| 444 | $modif == true ; |
---|
| 445 | } |
---|
| 446 | |
---|
| 447 | |
---|
[4040] | 448 | $rest_mail = $mails_données['rest_mail'] ; |
---|
| 449 | if ($rest_mail <=0 || $mails_données['nb_mails'] ==0 ){ |
---|
| 450 | $mails_données['nb_mails'] =0 ; |
---|
| 451 | $mails_données['date_mail'] = time(); |
---|
| 452 | $modif = true ; |
---|
| 453 | } |
---|
| 454 | |
---|
| 455 | $rest_spam = $mails_données['rest_spam'] ; |
---|
| 456 | |
---|
| 457 | if ($rest_spam <=0 || $mails_données['nb_spams'] ==0 ){ |
---|
| 458 | $mails_données['nb_spams'] =0 ; |
---|
| 459 | $mails_données['date_spam'] = time(); |
---|
| 460 | $modif = true ; |
---|
| 461 | } |
---|
| 462 | if ( $modif == true ) { |
---|
| 463 | sauve_données(); |
---|
| 464 | $modif = false ; |
---|
| 465 | } |
---|
| 466 | if (!isset($infos_message)){ |
---|
[4052] | 467 | $infos_message = ""; |
---|
[4040] | 468 | } |
---|
[4052] | 469 | if ($aff_nb == true) { |
---|
[4040] | 470 | $infos_message .= 'Mails : '.$mails_données['nb_mails']. ' \\ ' . $mails_données['nb_mails_maxi']; |
---|
| 471 | $infos_message .= "\n".'Spams : '.$mails_données['nb_spams']. ' \\ ' . $mails_données['nb_spams_maxi']; |
---|
[4052] | 472 | } |
---|
[4059] | 473 | |
---|
[4132] | 474 | |
---|
[4059] | 475 | |
---|
[4156] | 476 | if ($infos_message != "") { |
---|
[4180] | 477 | array_push($page['infos'], $infos_message); |
---|
[4156] | 478 | $infos_message=""; |
---|
| 479 | } |
---|
[4052] | 480 | if (!isset($erreur_message)){ |
---|
| 481 | $erreur_message = ""; |
---|
| 482 | } |
---|
[4156] | 483 | if ($erreur_message != "") { |
---|
| 484 | |
---|
| 485 | array_push($page['errors'], $erreur_message); |
---|
| 486 | $erreur_message=""; |
---|
| 487 | |
---|
[4052] | 488 | |
---|
[4156] | 489 | } |
---|
| 490 | |
---|
[4040] | 491 | //======================================================================== |
---|
[4156] | 492 | |
---|
[4040] | 493 | |
---|
[4020] | 494 | ?> |
---|