[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 | } |
---|
| 28 | |
---|
| 29 | |
---|
[4020] | 30 | include_once(PHPWG_ROOT_PATH.'admin/include/functions.php'); |
---|
| 31 | |
---|
| 32 | |
---|
| 33 | global $args, $conf_mail ; |
---|
| 34 | |
---|
| 35 | $mails_options = explode("," , $conf['mail_superv']); |
---|
| 36 | $mails_données=Get_Datas(); |
---|
| 37 | |
---|
[4029] | 38 | |
---|
| 39 | |
---|
[4020] | 40 | |
---|
[4029] | 41 | $list_period=array('week','day','hour','minute','seconde'); |
---|
| 42 | $list_period_label=array(l10n('Week'),l10n('Day'),l10n('Hour'),l10n('Minute'),l10n('Seconde')); |
---|
| 43 | |
---|
[4020] | 44 | |
---|
| 45 | if ( isset($_POST['test_envoie']) ) { |
---|
| 46 | test_envoie(); |
---|
| 47 | |
---|
| 48 | } |
---|
| 49 | //============================================================= |
---|
| 50 | |
---|
| 51 | |
---|
| 52 | if ( isset($_POST['raz']) ) { |
---|
| 53 | $mails_données['date_quarantaine']=time(); |
---|
| 54 | $mails_données['nb_mails'] = 0 ; |
---|
| 55 | $mails_données['nb_spams'] = 0 ; |
---|
| 56 | $mails_données['date_mail'] = time(); |
---|
| 57 | $mails_données['date_spam'] = time(); |
---|
[4029] | 58 | |
---|
[4020] | 59 | $mails_données['reste'] = 0; |
---|
| 60 | |
---|
[4029] | 61 | $mails_données['quarantaine']=false; |
---|
[4020] | 62 | |
---|
[4029] | 63 | sauve_données(); |
---|
| 64 | |
---|
[4020] | 65 | array_push($page['infos'], l10n('save_config')); |
---|
| 66 | } |
---|
| 67 | |
---|
| 68 | if ( isset($_POST['submit']) ) |
---|
| 69 | { |
---|
| 70 | |
---|
| 71 | |
---|
| 72 | //Options |
---|
| 73 | $mails_options[0] = isset($_POST['check_mailto']) ? $_POST['check_mailto'] : '' ; |
---|
| 74 | $mails_options[1] = isset($_POST['check_header_carbon']) ? $_POST['check_header_carbon'] : '' ; |
---|
| 75 | $mails_options[2] = isset($_POST['check_header_text']) ? $_POST['check_header_text'] : '' ; |
---|
| 76 | $mails_options[3] = isset($_POST['mail_superv_admin']) ? $_POST['mail_superv_admin'] : '' ; |
---|
| 77 | $mails_options[4] = isset($_POST['superv_guest']) ? $_POST['superv_guest'] : '' ; |
---|
| 78 | |
---|
| 79 | //données |
---|
| 80 | $mails_données['nb_mails_maxi'] = isset($_POST['nb_mails_maxi']) ? $_POST['nb_mails_maxi'] : $mails_données['nb_mails_maxi'] ; |
---|
| 81 | $mails_données['nb_mails_periode'] = isset($_POST['nb_mails_periode']) ? $_POST['nb_mails_periode'] : $mails_données['nb_mails_periode'] ; |
---|
| 82 | $mails_données['nb_spams_maxi'] = isset($_POST['nb_spams_maxi']) ? $_POST['nb_spams_maxi'] : $mails_données['nb_spams_maxi'] ; |
---|
| 83 | $mails_données['nb_spams_periode'] = isset($_POST['nb_spams_periode']) ? $_POST['nb_spams_periode'] : $mails_données['nb_spams_periode'] ; |
---|
[4029] | 84 | $mails_données['quarantaine_periode'] = isset($_POST['quarantaine_periode']) ? $_POST['quarantaine_periode'] : $mails_données['quarantaine_periode'] ; |
---|
[4020] | 85 | |
---|
| 86 | $mails_données['message'] = isset($_POST['content']) ? $_POST['content'] : $mails_données['message'] ; |
---|
| 87 | $mails_données['header_text'] = isset($_POST['header_text']) ? $_POST['header_text'] : $mails_données['header_text'] ; |
---|
| 88 | //=========================================================================================================== |
---|
[4029] | 89 | sauve_options(); |
---|
[4020] | 90 | |
---|
[4029] | 91 | //============================================================================================== |
---|
| 92 | sauve_données(); |
---|
[4020] | 93 | |
---|
| 94 | //=========================================================================================================== |
---|
| 95 | |
---|
| 96 | array_push($page['infos'], l10n('save_config')); |
---|
| 97 | |
---|
| 98 | } |
---|
| 99 | |
---|
[4029] | 100 | $mails_données = Get_Datas() ; |
---|
| 101 | |
---|
| 102 | $rest_mail= $mails_données['rest_mail']; |
---|
| 103 | $rest_spam= $mails_données['rest_spam']; |
---|
| 104 | $reste= $mails_données['reste']; |
---|
| 105 | |
---|
| 106 | $quarantaine= $mails_données['quarantaine']; |
---|
| 107 | |
---|
[4020] | 108 | |
---|
| 109 | |
---|
| 110 | $template->assign( |
---|
| 111 | array( |
---|
| 112 | 'check_mailto' => $mails_options[0] == 'on' ? 'checked="checked"' : '' , |
---|
| 113 | 'check_header_carbons' => $mails_options[1] == 'on' ? 'checked="checked"' : '' , |
---|
| 114 | 'check_header_text' => $mails_options[2] == 'on' ? 'checked="checked"' : '' , |
---|
| 115 | 'free_admin' => $mails_options[3] == 'on' ? 'checked="checked"' : '' , |
---|
| 116 | 'free_guest' => $mails_options[4] == 'on' ? 'checked="checked"' : '' , |
---|
| 117 | |
---|
| 118 | 'nb_mails' => $mails_données['nb_mails'] , |
---|
[4029] | 119 | 'date_mail' => "'".date(l10n('formatdate'),$mails_données['date_mail'])."'" , |
---|
[4020] | 120 | 'nb_mails_maxi' => $mails_données['nb_mails_maxi'] , |
---|
| 121 | 'nb_mails_periode' => "'".$mails_données['nb_mails_periode']."'" , |
---|
[4029] | 122 | 'time_mails_reste' => "'".int_to_heure( $rest_mail )."'" , |
---|
[4020] | 123 | |
---|
| 124 | 'nb_spams' => $mails_données['nb_spams'] , |
---|
[4029] | 125 | 'date_spam' => "'".date(l10n('formatdate'),$mails_données['date_spam'])."'" , |
---|
[4020] | 126 | 'nb_spams_maxi' => $mails_données['nb_spams_maxi'] , |
---|
| 127 | 'nb_spams_periode' => "'".$mails_données['nb_spams_periode']."'" , |
---|
[4029] | 128 | 'time_spams_reste' => "'".int_to_heure($rest_spam)."'" , |
---|
[4020] | 129 | |
---|
[4029] | 130 | 'quarantaine' => $mails_données['quarantaine'] , |
---|
| 131 | 'date_quarantaine' => "'".date(l10n('formatdate'),$mails_données['date_quarantaine'])."'" , |
---|
| 132 | 'quarantaine_periode' => "'".$mails_données['quarantaine_periode']."'" , |
---|
| 133 | 'reste' => "'".int_to_heure($reste)."'", |
---|
[4020] | 134 | |
---|
| 135 | 'message' => $mails_données['message'] , |
---|
| 136 | 'header_text' => "'".$mails_données['header_text']."'" , |
---|
[4029] | 137 | |
---|
| 138 | 'list_period' => $list_period , |
---|
| 139 | 'list_period_label' => $list_period_label , |
---|
| 140 | |
---|
[4020] | 141 | ) |
---|
| 142 | ); |
---|
| 143 | |
---|
| 144 | $template->set_filenames(array('plugin_admin_content' => realpath(MAIL_SUPERV_PATH . 'admin/mail_superv_admin.tpl'))); |
---|
| 145 | $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content'); |
---|
| 146 | |
---|
| 147 | |
---|
| 148 | ?> |
---|