Changeset 4888 for extensions
- Timestamp:
- Feb 15, 2010, 3:51:00 PM (15 years ago)
- Location:
- extensions/Mail_supervisor
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/Mail_supervisor/admin/mail_superv_admin.php
r4879 r4888 29 29 if (!defined('MAIL_SUPERV_PATH')) define('MAIL_SUPERV_PATH' , PHPWG_PLUGINS_PATH.basename(dirname(__FILE__)).'/'); 30 30 31 31 global $user, $lang, $conf, $errors,$mails_données; 32 global $args, $conf_mail,$infos_message,$erreur_message,$mails_options ; 32 33 // +-----------------------------------------------------------------------+ 33 34 // | Check Access and exit when user status is not ok | … … 39 40 40 41 $my_base_url = get_admin_plugin_menu_link(__FILE__); 42 41 43 load_language('plugin.lang', MAIL_SUPERV_PATH); 42 43 44 //========================================================= 45 $sv_Week=explode(" ",l10n('Week %d')); 46 if( !isset($lang['Week'])) $lang['Week'] = $sv_Week[0]; 47 48 49 $lang['Sv_format_d'] = '+1 '.$lang['Week'].'<br /> 50 +1 '.$lang['Day'].'<br /> 51 +1 '.$lang['Hour'].'<br /> 52 +1 '.$lang['Minute'].'<br /> 53 +1 '.$lang['Second'].'<br />'; 54 //============================================================== 55 load_language('help/plugin.lang', MAIL_SUPERV_PATH); 56 44 57 if (!isset($_GET['tab'])) 45 58 $page['tab'] = 'mail_superv_admin'; … … 78 91 $error = array(); 79 92 80 global $user, $lang, $conf, $errors,$mails_données; 81 global $args, $conf_mail,$infos_message,$erreur_message,$mails_options ; 93 82 94 include_once (MAIL_SUPERV_PATH.'include/constants.php'); 95 96 if (!isset($infos_message)) 97 { 98 $infos_message = ""; 99 } 100 if (!isset($erreur_message)) 101 { 102 $erreur_message = ""; 103 } 83 104 84 105 if (isset($conf['mail_superv'])) { … … 98 119 if (!isset($mails_options[check_header_carbon])) $mails_options[check_header_carbon] = 'off' ; //1 99 120 if (!isset($mails_options[check_mailto])) $mails_options[check_mailto] = 'off' ; //0 100 121 //================================================================================================ 101 122 $mails_données = Get_Datas(); 102 123 … … 110 131 111 132 133 112 134 // ************************************************************************* 113 135 // | Sélection de l'onglet | … … 115 137 116 138 $modif=false ; 139 /* 117 140 $sql="SELECT * 118 141 FROM `".$prefixeTable."plugins` … … 123 146 $versions = mysql_fetch_array($result,MYSQL_ASSOC); 124 147 } 125 $version= $versions['version']; 148 $version = $versions['version']; 149 */ 150 $plugin = Get_Version_plugins( MAIL_SUPERV_PATH); 151 $version = $plugin['version'] ; 152 //========================================================= 153 126 154 if (!isset($ip)) { 127 155 if (getenv("HTTP_CLIENT_IP")) … … 140 168 //============================================================= 141 169 if ( isset($_POST['submit']) ) { 142 if ( $_POST['submit'] == l10n('Sv_refresh') ) { 143 170 171 if ( $_POST['submit'] == l10n('Sv_refresh') ) { 144 172 145 173 if ($mails_données['nb_mails'] == 0 ) … … 156 184 $infos_message .= l10n('Sv_refresh') .'<br />'; 157 185 sauve_données(); 158 $aff_nb = false ;159 160 161 } 162 163 if ( $_POST['submit'] == l10n('Sv_raz') ) {186 $aff_nb = false ; 187 188 189 } 190 191 if ( $_POST['submit'] == l10n('Sv_raz') ) { 164 192 165 193 $mails_données['date_quarantaine']=time(); … … 178 206 179 207 180 if ( $_POST['submit'] == l10n('Sv_Valider') ) 181 { 182 183 $mails_options[check_mailto] = isset($_POST['check_mailto']) ? $_POST['check_mailto'] : 'off' ; 184 $mails_options[check_header_carbon] = isset($_POST['check_header_carbon']) ? $_POST['check_header_carbon'] : 'off' ; 185 $mails_options[check_header_text] = isset($_POST['check_header_text']) ? $_POST['check_header_text'] : 'off' ; 208 if ( $_POST['submit'] == l10n('Sv_Valider') ) 209 { 210 $mails_options[check_mailto] = isset($_POST['check_mailto']) ? $_POST['check_mailto'] : 'off' ; 211 $mails_options[check_header_carbon] = isset($_POST['check_header_carbon']) ? $_POST['check_header_carbon'] : 'off' ; 212 $mails_options[check_header_text] = isset($_POST['check_header_text']) ? $_POST['check_header_text'] : 'off' ; 186 213 187 //données 188 $mails_données['nb_mails_maxi'] = isset($_POST['nb_mails_maxi']) ? $_POST['nb_mails_maxi'] : $mails_données['nb_mails_maxi'] ; 189 $mails_données['nb_mails_periode'] = isset($_POST['nb_mails_periode']) ? $_POST['nb_mails_periode'] : $mails_données['nb_mails_periode'] ; 190 $mails_données['nb_spams_maxi'] = isset($_POST['nb_spams_maxi']) ? $_POST['nb_spams_maxi'] : $mails_données['nb_spams_maxi'] ; 191 $mails_données['nb_spams_periode'] = isset($_POST['nb_spams_periode']) ? $_POST['nb_spams_periode'] : $mails_données['nb_spams_periode'] ; 192 $mails_données['quarantaine_periode'] = isset($_POST['quarantaine_periode']) ? $_POST['quarantaine_periode'] : $mails_données['quarantaine_periode'] ; 193 194 $mails_données['message'] = isset($_POST['content']) ? $_POST['content'] : $mails_données['message'] ; 195 $mails_données['header_text'] = isset($_POST['header_text']) ? $_POST['header_text'] : $mails_données['header_text'] ; 196 //======================================================================================================= 197 sauve_options(); 198 sauve_données(); 214 //données 215 $mails_données['nb_mails_maxi'] = isset($_POST['nb_mails_maxi']) ? $_POST['nb_mails_maxi'] : $mails_données['nb_mails_maxi'] ; 216 $mails_données['nb_mails_periode'] = isset($_POST['nb_mails_periode']) ? $_POST['nb_mails_periode'] : $mails_données['nb_mails_periode'] ; 217 $mails_données['nb_spams_maxi'] = isset($_POST['nb_spams_maxi']) ? $_POST['nb_spams_maxi'] : $mails_données['nb_spams_maxi'] ; 218 $mails_données['nb_spams_periode'] = isset($_POST['nb_spams_periode']) ? $_POST['nb_spams_periode'] : $mails_données['nb_spams_periode'] ; 219 220 $mails_données['quarantaine_periode'] = isset($_POST['quarantaine_periode']) ? $_POST['quarantaine_periode'] : $mails_données['quarantaine_periode'] ; 221 222 $mails_données['message'] = isset($_POST['content']) ? $_POST['content'] : $mails_données['message'] ; 223 $mails_données['header_text'] = isset($_POST['header_text']) ? $_POST['header_text'] : $mails_données['header_text'] ; 224 //======================================================================================================= 225 vérif_mails_données(); 226 sauve_options(); 227 sauve_données(); 199 228 //======================================================================================================= 200 $infos_message = l10n('Sv_save_config') . " : " . l10n('Sv_Datas') . "<br />" ; 201 $mails_données = Get_Datas() ; 202 $erreur_message=""; 203 204 } 205 } 229 $infos_message = l10n('Sv_save_config') . " : " . l10n('Sv_Datas') . "<br />" ; 230 $erreur_message = ""; 231 $mails_données = Get_Datas() ; 232 } 233 } 206 234 207 235 $mails_données = Get_Datas(); 208 236 vérif_mails_données(); 237 //=============================================================================== 238 209 239 $rest_mail= $mails_données['rest_mail']; 210 240 $rest_spam= $mails_données['rest_spam']; 211 241 $reste= $mails_données['reste']; 212 242 213 $quarantaine = ($mails_données['quarantaine'] == 'true') ? true : false ;; 214 215 216 217 $PHPWG_VERSION=PHPWG_VERSION; 243 $quarantaine = ($mails_données['quarantaine'] == 'true') ? true : false ; 218 244 219 245 $template->assign( … … 227 253 'date_mail' => "'".date(l10n('Sv_formatdate'),$mails_données['date_mail'])."'" , 228 254 'nb_mails_maxi' => $mails_données['nb_mails_maxi'] , 229 'nb_mails_periode' => "'". $mails_données['nb_mails_periode']."'" ,255 'nb_mails_periode' => "'". int_to_heure($mails_données['nb_mails_periode'])."'" , 230 256 'time_mails_reste' => "'".int_to_heure( $rest_mail )."'" , 231 257 … … 233 259 'date_spam' => "'".date(l10n('Sv_formatdate'),$mails_données['date_spam'])."'" , 234 260 'nb_spams_maxi' => $mails_données['nb_spams_maxi'] , 235 'nb_spams_periode' => "'". $mails_données['nb_spams_periode']."'" ,261 'nb_spams_periode' => "'".int_to_heure($mails_données['nb_spams_periode'])."'" , 236 262 'time_spams_reste' => "'".int_to_heure($rest_spam)."'" , 237 263 238 264 'quarantaine' => $quarantaine , 239 265 'date_quarantaine' => "'".date(l10n('Sv_formatdate'),time()+$reste)."'" , 240 'quarantaine_periode' => "'". $mails_données['quarantaine_periode']."'" ,266 'quarantaine_periode' => "'".int_to_heure($mails_données['quarantaine_periode'])."'" , 241 267 'reste' => "'".int_to_heure($reste)."'", 242 268 … … 331 357 // ************************************************************************* 332 358 case 'mail_black_liste': 333 load_language('help/plugin.lang', MAIL_SUPERV_PATH);334 335 359 global $user_name,$mail_adresse,$ip ; 336 337 360 $aff_nb=false; 338 361 //------------------------------------------------------------------------------------ … … 340 363 $mails_options[no_connect] = isset($_POST['no_connect']) ? $_POST['no_connect'] : $mails_options[no_connect] ; 341 364 $mails_options[set_auto] = isset($_POST['set_auto']) ? $_POST['set_auto'] : $mails_options[set_auto] ; 342 343 365 //======================================================================================= 344 366 $info_ip = (isset($info_ip)) ? $info_ip : '' ; … … 346 368 $info_ip = (isset($_POST['info'])) ? $_POST['info'] : $info_ip ; 347 369 $info_ip .= ":"; 348 349 370 $val=explode(":",$info_ip); 350 371 $info_ip = trim($val[0]) ; … … 431 452 case 'mail_superv_help': 432 453 433 load_language('help/plugin.lang', MAIL_SUPERV_PATH);434 454 435 455 $aff_nb=false; … … 478 498 $modif = false ; 479 499 } 480 if (!isset($infos_message)){ 481 $infos_message = ""; 482 } 500 483 501 if ($aff_nb == true) { 484 502 $infos_message .= 'Mails : '.$mails_données['nb_mails']. ' \\ ' . $mails_données['nb_mails_maxi']; … … 490 508 if ($infos_message != "") { 491 509 array_push($page['infos'], $infos_message); 492 $infos_message="";510 $infos_message=""; 493 511 } 494 if (!isset($erreur_message)){ 495 $erreur_message = ""; 496 } 512 497 513 if ($erreur_message != "") { 498 514 … … 502 518 503 519 } 504 505 520 //======================================================================== 506 507 508 521 ?> -
extensions/Mail_supervisor/admin/mail_superv_admin.tpl
r4879 r4888 1 {* $Id: mail_black_liste.tpl 3723 2009-08-07 04:53:38Z rvelices $ *} 2 {known_script id="jquery" src=$ROOT_URL|@cat:"template-common/lib/jquery.packed.js"} 3 {known_script id="jquery.cluetip" src=$ROOT_URL|@cat:"template-common/lib/plugins/jquery.cluetip.packed.js"} 4 5 <script type="text/javascript"> 6 jQuery().ready(function(){ldelim} 7 jQuery('.cluetip').cluetip({ldelim} 8 width: 300, 9 splitTitle: '|' 10 }); 11 }); 12 </script> 13 1 14 <div class="titrePage"> 2 15 <h2>{'Sv_supervisor'|translate}{'Sv_version'|translate}{$version}</h2> … … 35 48 <td><input type="text" name="date_mail" value={$date_mail} readonly="true" class="row2" /></td> 36 49 <td><input type="text" name="nb_mails_maxi" size="10%" value={$nb_mails_maxi} /></td> 37 <td><input type="text" name="nb_mails_periode" size="30%" value={$nb_mails_periode} /></td>50 <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> 38 51 <td><input type="text" name="time_mails_reste" size="50%" value={$time_mails_reste} readonly="true" class="row2" /></td> 39 52 </tr> … … 45 58 <td><input type="text" name="date_spam" value={$date_spam}readonly="true" class="row2" /></td> 46 59 <td><input type="text" name="nb_spams_maxi" size="10%" value={$nb_spams_maxi} /></td> 47 <td><input type="text" name="nb_spams_periode" size="30%" value={$nb_spams_periode}/></td>60 <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> 48 61 <td><input type="text" name="time_spams_reste" size="50%" value={$time_spams_reste} readonly="true" class="row2" /></td> 49 62 </tr> … … 61 74 <td><input type="text" name="date_quarantaine" value={$date_quarantaine} /> </td><td> </td> 62 75 63 <td><input type="text" name="quarantaine_periode" size="30%" value={$quarantaine_periode}/></td>76 <td><input type="text" class="cluetip" name="quarantaine_periode" size="30%" value={$quarantaine_periode} title="{'Sv_format'|translate}|{'Sv_format_d'|translate}" /></td> 64 77 <td><input type="text" name="reste" size="50%" value={$reste} /></td> 65 78 {/if} … … 69 82 <td> </td> 70 83 <td> </td> 71 <td><input type="text" name="quarantaine_periode" size="10%" value={$quarantaine_periode}/></td>84 <td><input type="text" class="cluetip" name="quarantaine_periode" size="10%" value={$quarantaine_periode} title="{'Sv_format'|translate}|{'Sv_format_d'|translate}" /></td> 72 85 73 86 {/if} </tr> … … 83 96 </table> 84 97 </fieldset> 85 <p><input class="submit" type="submit" name="submit" value="{'Sv_Valider'|translate}" /> 98 <p> 99 <input class="submit" type="submit" name="submit" value="{'Sv_Valider'|translate}" /> 86 100 <input class="submit" type="submit" name="submit" value="{'Sv_raz'|translate}" /> 87 101 <input class="submit" type="submit" name="submit" value="{'Sv_refresh'|translate}" /> -
extensions/Mail_supervisor/admin/mail_superv_help.tpl
r4879 r4888 1 2 1 <div class="instructions" > 3 4 2 <h2>{'Sv_Tab_help'|translate}{'Sv_version'|translate}{$version}</h2> 5 3 <fieldset style=" position:relative ; top:15px"> … … 208 206 </div> <!-- Fonction --> 209 207 </div> <!-- Fonctions --> 210 211 208 </fieldset></div> -
extensions/Mail_supervisor/include/constants.php
r4879 r4888 8 8 9 9 10 global $superv_champs , $superv_type ,$superv_bl_champs , $superv_bl_type ; 11 12 13 $superv_champs = array( 14 "id", 15 "nb_mails", 16 "date_mail", 17 "nb_mails_maxi", 18 "nb_mails_periode", 19 "nb_spams", 20 "date_spam", 21 "nb_spams_maxi", 22 "nb_spams_periode", 23 "quarantaine", 24 "date_quarantaine", 25 "quarantaine_periode", 26 "message", 27 "message_test", 28 "header_text", 29 30 ); 31 32 $superv_type = array( 33 " SMALLINT( 5 ) NOT NULL DEFAULT '0'" , 34 "INT NOT NULL DEFAULT '0'" , 35 "INT NOT NULL DEFAULT '0'" , 36 "INT NOT NULL DEFAULT '2000'", 37 "TEXT" , 38 "INT NOT NULL DEFAULT '0'", 39 "INT NOT NULL DEFAULT '0'", 40 "INT NOT NULL DEFAULT '10'", 41 "TEXT" , 42 "TEXT" , 43 "INT NOT NULL DEFAULT '0'", 44 "TEXT" , 45 "TEXT" , 46 "TEXT" , 47 "TEXT" , 48 49 ); 50 51 52 $superv_bl_champs = array( 53 "id", 54 "ip", 55 "pays", 56 "region", 57 "ville", 58 "adresse", 59 "fai", 60 "nb" 61 ); 62 63 $superv_bl_type = array( 64 " smallint(5) UNSIGNED NOT NULL auto_increment ", 65 "TEXT" , 66 "TEXT" , 67 "TEXT" , 68 "TEXT" , 69 "TEXT" , 70 "TEXT" , 71 " smallint(5) UNSIGNED " 72 ); 73 10 74 ?> -
extensions/Mail_supervisor/include/fonctions.php
r4880 r4888 157 157 if ($erreur_message <> "") 158 158 { 159 $erreur_message =str_replace("\n",'<br />',$erreur_message) ;159 $erreur_message = str_replace("\n",'<br />',$erreur_message) ; 160 160 $template->assign('errors',$erreur_message); 161 $erreur_message ="";161 $erreur_message = ""; 162 162 } 163 163 } … … 169 169 if ($infos_message <> "") 170 170 { 171 $infos_message =str_replace("\n",'<br />',$infos_message) ;171 $infos_message = str_replace("\n",'<br />',$infos_message) ; 172 172 $template->assign('infos',$infos_message); 173 $infos_message ="";173 $infos_message = ""; 174 174 } 175 175 } … … 262 262 $data = mysql_fetch_array($result,MYSQL_ASSOC); 263 263 //==================================================================================== 264 265 $next_day = Str_To_Time( $data['nb_mails_periode'], $data['date_mail'] );; 266 $data['rest_mail']= $next_day - time() ; 264 265 $next_day = Str_To_Time( $data['nb_mails_periode'], $data['date_mail'] ); 266 $next_day = ($next_day >0) ? $next_day : (604800 + time()) ; 267 $data['rest_mail'] = $next_day - time() ; 267 268 268 269 $next_day = Str_To_Time( $data['nb_spams_periode'],$data['date_spam']); 269 $data['rest_spam']= $next_day - time() ; 270 $next_day = ($next_day >0) ? $next_day : (172800 + time()) ; 271 $data['rest_spam'] = $next_day - time() ; 270 272 271 273 272 274 $next_day = Str_To_Time($data['quarantaine_periode'] ,$data['date_quarantaine']); 275 $next_day = ($next_day >0) ? $next_day : (172800 + time()) ; 273 276 274 277 if ($data['quarantaine'] == 'true' ) { … … 309 312 function int_to_heure($int) 310 313 { 314 global $lang,$mails_données ; 315 316 $v0=Date_to_numeric(l10n('Day') ); 317 318 311 319 312 320 $delta=(7*24*60*60) ; … … 331 339 $minutes = substr ('00'.$minutes,-2,2); 332 340 $secondes = substr ('00'.$secondes,-2,2); 333 334 335 if ($week > 0 ) 336 { 337 return $week. " " .l10n('Sv_Week'). " " . $day . " " .l10n('Sv_Day'). "s ". $heures . " ". l10n('Sv_Hour'). "s " . $minutes. " " .l10n('Sv_Minute'). "s ". $secondes." " .l10n('Sv_Seconde')."s"; 338 } 339 return $day . " " .l10n('Sv_Day'). "s ". $heures . " ". l10n('Sv_Hour'). "s " . $minutes. " " .l10n('Sv_Minute'). "s ". $secondes." " .l10n('Sv_Seconde')."s"; 341 342 $retour=""; 343 $Week=explode(" ",l10n('Week %d')); 344 $Week= ($Week[0]); 345 346 if ($week > 0 ) $retour .= "+" . $week ." " . $Week ; 347 if ($day > 0) $retour .= "+" . $day ." " .l10n('Day'); 348 if ($heures > 0) $retour .= "+" . $heures." " .l10n('Hour'); 349 if ($minutes > 0) $retour .= "+" . $minutes." " .l10n('Minute'); 350 if ($secondes > 0) $retour .= "+" . $secondes." " .l10n('Second'); 351 $retour=str_replace("+0","+",$retour); 352 //================================================================================================ 353 354 355 return $retour; 340 356 341 357 } … … 372 388 time(), 373 389 2000, 374 '" 1 '.l10n('Sv_Week').'"' ,390 '"604800"' , 375 391 0, 376 392 time(), 377 393 10, 378 '" 2 '.l10n('Sv_Day').'"',394 '"172800"', 379 395 '"false"', 380 396 time(), 381 '"2 '.l10n('Sv_Day').'"', 382 383 '"Init"', 397 '"172800"', 398 '"Init"', 384 399 '"'.l10n('Sv_supervisor').'"', 385 '"'.l10n(' Sv_hello').'"',400 '"'.l10n('hello').'"', 386 401 ) 387 402 ; … … 528 543 } 529 544 //===================================================================== 530 531 function Str_To_Time( $ajout,$init_date) 532 { 533 //======================================================== 534 global $erreur_message,$infos_message; 535 536 537 $a_ajouter = strtolower($ajout) ; 538 if (strlen($a_ajouter) <4) $a_ajouter=$a_ajouter." " ; 539 $period_search=array("s ","j ","h ","m ","s "); 540 array_push($period_search,"w ","d ","h ","m ","s "); 541 array_push($period_search,l10n('Sv_Week').'s',l10n('Sv_Day').'s',l10n('Sv_Hour').'s',l10n('Sv_Minute').'s',l10n('Sv_Seconde').'s'); 542 array_push($period_search,l10n('Sv_Week'),l10n('Sv_Day'),l10n('Sv_Hour'),l10n('Sv_Minute'),l10n('Sv_Seconde')); 543 544 $period_match = array(' week ',' day ',' hour ',' minute ',' seconde '); 545 array_push($period_match,' week ',' day ',' hour ',' minute ',' seconde '); 546 array_push($period_match,' week ',' day ',' hour ',' minute ',' seconde '); 547 array_push($period_match,' week ',' day ',' hour ',' minute ',' seconde '); 548 549 550 551 $a_ajouter = "+ " . str_replace($period_search, $period_match, $a_ajouter) ; 545 function vérif_mails_données() 546 { 547 global $mails_données,$infos_message,$erreur_message,$page; 548 549 if (!is_numeric($mails_données['nb_mails_periode'])) 550 { 551 $periode = Str_To_Time( $mails_données['nb_mails_periode'],0); 552 $mails_données['nb_mails_periode']= ($periode > 0) ? $periode : '604800' ; 553 } 554 555 if (!is_numeric($mails_données['nb_spams_periode'])) 556 { 557 558 $periode=Str_To_Time( $mails_données['nb_spams_periode'],0); 559 $mails_données['nb_spams_periode']= ($periode > 0) ? $periode : '172800' ; ; 560 } 561 if (!is_numeric($mails_données['quarantaine_periode'])) 562 { 563 $periode=Str_To_Time( $mails_données['quarantaine_periode'],0); 564 $mails_données['quarantaine_periode']= ($periode > 0) ? $periode : '172800' ; 565 } 566 567 if ($infos_message != "") { 568 array_push($page['infos'], $infos_message); 569 $infos_message=""; 570 } 571 572 if ($erreur_message != "") { 573 array_push($page['errors'], $erreur_message); 574 $erreur_message =""; 575 } 576 577 } 578 //======================================================================= 579 function Date_to_numeric( $Valeurs ) 580 { 581 global $lang,$erreur_message,$infos_message; 582 583 $a_ajouter = $Valeurs ; 584 585 586 if (!isset($lang['Sv_second'])) { 587 $Week=explode(" ",l10n('Week %d')); 588 $Week= ($Week[0]); 589 590 $lang['Sv_week'] = $Week; 591 $lang['Sv_day'] = l10n('Day') ; 592 $lang['Sv_hour'] = l10n('Hour') ; 593 $lang['Sv_minute'] = l10n('Minute') ; 594 $lang['Sv_second'] = l10n('Second'); 595 596 $lang['Sv_'. $lang['Sv_week']] = 'week'; 597 $lang['Sv_'. $lang['Sv_day']] = 'day'; 598 $lang['Sv_'. $lang['Sv_hour']] = 'hour'; 599 $lang['Sv_'. $lang['Sv_minute']] = 'minute'; 600 $lang['Sv_'. $lang['Sv_second']] = 'second'; 601 602 } 603 //--- traduction --> anglais --- 604 605 //========= suppression numéric et symbole ========== 606 $new_valeur =( preg_replace("/[0-9+\-.*\/()%]/"," ",$a_ajouter)); 607 $nv = trim( sup_double_espace($new_valeur)) ; 608 609 610 611 $conv['week']= (7*24*60*60); 612 $conv['day']= (24*60*60); 613 $conv['hour']= (60*60) ; 614 $conv['minute']= 60 ; 615 $conv['second']= 1; 616 617 $nv = explode(" ", $nv ); 618 619 foreach($nv as $nv1) 620 { 621 if (!isset($lang['Sv_'. $nv1]) ) { 622 //==== au cas pluriel === 623 624 $nv0 = substr($nv1, 0,-1) ; 625 $a_ajouter= str_replace( $nv1,$nv0, $a_ajouter); 626 $nv1 = $nv0 ; 627 628 } 629 630 if (!isset($lang['Sv_'. $nv1]) ) { 631 $erreur_message .= $nv1. " ".l10n('not_found')."<br />"; 632 // die($erreur_message); 633 634 }else { 635 ob_start(); 636 $match = $conv[strtolower($lang['Sv_'. $nv1])] ; 637 $a_ajouter = str_replace($nv1," ". $match ." ",$a_ajouter) ; 638 $erreur_message .= ob_get_contents(); 639 ob_end_clean(); 640 } 641 642 } 643 644 $a_ajouter = "+ " . $a_ajouter ; 552 645 $a_ajouter=sup_double_espace($a_ajouter); 553 554 $v1 = array('- ','+ ','week','day','hour','minute','seconde',' -',' +',' '); 555 $v2 = array('-','+', (7*24*60*60) , (24*60*60), (60*60), 60,1,'|-','|+',"*" ); 556 646 $v1 = array('- ','+ ',' -', ' +', ' '); 647 $v2 = array('-' ,'+' ,'|-', '|+', "*"); 557 648 558 649 $new_valeur = str_replace($v1,$v2,$a_ajouter) ; 559 650 $new_valeur = str_replace('++','+',$new_valeur ) ; 560 561 $new_valeur = explode( "|",$new_valeur ); 651 652 return $new_valeur; 653 } 654 //===================================================================== 655 function Str_To_Time( $ajout,$init_date) 656 { 657 //======================================================== 658 global $erreur_message,$infos_message,$user; 659 global $lang; 660 661 $ajout=ucwords ($ajout); 662 663 664 if (is_numeric($ajout)) 665 $valeur= $ajout ; 666 else 667 { 668 $valeur= Date_to_numeric( $ajout) ; 669 670 } 671 672 $new_valeur = explode( "|", $valeur ); 673 562 674 $p = $init_date ; 563 675 $n0=0; 676 $erreur = false; 677 564 678 //$new_valeur = $a_ajouter + $init_date ; 565 679 foreach($new_valeur as $nv) … … 570 684 }else { 571 685 $erreur_message .= "[" . $ajout . "] --> " . l10n('Sv_syntax_error') . " : " . $nv ."<br />"; 686 $erreur = true; 572 687 } 573 688 574 689 575 690 } 576 577 return $p;691 if ($erreur) $p = -1000 ; 692 return intval($p) ; 578 693 579 694 } … … 908 1023 } 909 1024 910 1025 function Get_Version_plugins($dir) 1026 { 1027 $path = $dir; 1028 $plg_data = implode( '', file($path.'main.inc.php') ); 1029 if ( preg_match("|Plugin Name: (.*)|", $plg_data, $val) ) 1030 { 1031 $plugin['name'] = trim( $val[1] ); 1032 } 1033 if (preg_match("|Version: (.*)|", $plg_data, $val)) 1034 { 1035 $plugin['version'] = trim($val[1]); 1036 } 1037 if ( preg_match("|Plugin URI: (.*)|", $plg_data, $val) ) 1038 { 1039 $plugin['uri'] = trim($val[1]); 1040 } 1041 if ($desc = load_language('description.txt', $path.'/', array('return' => true))) 1042 { 1043 $plugin['description'] = trim($desc); 1044 } 1045 elseif ( preg_match("|Description: (.*)|", $plg_data, $val) ) 1046 { 1047 $plugin['description'] = trim($val[1]); 1048 } 1049 if ( preg_match("|Author: (.*)|", $plg_data, $val) ) 1050 { 1051 $plugin['author'] = trim($val[1]); 1052 } 1053 if ( preg_match("|Author URI: (.*)|", $plg_data, $val) ) 1054 { 1055 $plugin['author uri'] = trim($val[1]); 1056 } 1057 if (!empty($plugin['uri']) and strpos($plugin['uri'] , 'extension_view.php?eid=')) 1058 { 1059 list( , $extension) = explode('extension_view.php?eid=', $plugin['uri']); 1060 if (is_numeric($extension)) $plugin['extension'] = $extension; 1061 } 1062 // IMPORTANT SECURITY ! 1063 $plugin = array_map('htmlspecialchars', $plugin); 1064 1065 return $plugin ; 1066 1067 } 911 1068 ?> -
extensions/Mail_supervisor/include/function_test_send.php
r4879 r4888 102 102 { 103 103 if ($group_name<>'') { 104 $infos_message .= '<br />'. sprintf( l10n(' Sv_An information email was sent to group "%s"'), $group_name ).'<br />';104 $infos_message .= '<br />'. sprintf( l10n('An information email was sent to group "%s"'), $group_name ).'<br />'; 105 105 } 106 106 if ($mailto <> '') { -
extensions/Mail_supervisor/include/save_info.php
r4229 r4888 1 1 <?php 2 3 4 2 //======================================================================================= 5 6 7 3 if (!defined('MAIL_SUPERV_PATH')) define('MAIL_SUPERV_PATH' , PHPWG_PLUGINS_PATH.basename(dirname(__FILE__)).'/'); 8 9 10 11 12 4 13 5 switch (strtolower($info_ip)) -
extensions/Mail_supervisor/language/fr_FR/help/plugin.lang.php
r4879 r4888 1 1 <?php 2 2 global $lang ; 3 if( !isset($lang['Minute'])) $lang['Minute'] = l10n('Minute') ; 4 if( !isset($lang['Second'])) $lang['Second'] = l10n('Seconde'); 5 $sv_Week=explode(" ",l10n('Week %d')); 6 if( !isset($lang['Week'])) $lang['Week'] = $sv_Week[0]; 7 3 8 //======================================================================================================== 4 9 $lang['Sv_Fonctionality']='Fonctionnalités'; … … 26 31 $lang['Sv_hlp_3_4']='Durée pendant laquelle l\'envoie des mails est possible'; 27 32 28 $lang['Sv_hlp_3_4_0']='<br /> Format possible: <br />29 n '.$lang['Sv_Week'].'<br />30 n '.$lang['Sv_Day'].'<br />31 n '.$lang['Sv_Hour'].'<br />32 n '.$lang['Sv_Minute'].'<br />33 n '.$lang['Sv_Seconde'].'<br />33 $lang['Sv_hlp_3_4_0']='<br />Valeurs acceptées: <br /> 34 + n '.l10n('Week').'<br /> 35 + n '.l10n('Day').'<br /> 36 + n '.l10n('Hour').'<br /> 37 + n '.l10n('Minute').'<br /> 38 + n '.l10n('Second').'<br /> 34 39 n étant le nombre de (semaine,jour,heure,minute,seconde) ' 35 40 ; -
extensions/Mail_supervisor/language/fr_FR/plugin.lang.php
r4879 r4888 1 1 <?php 2 2 global $lang ; 3 3 4 //=================================================== 4 $lang['Sv_Week'] = 'semaine'; 5 $lang['Sv_Day'] = 'jour'; 6 $lang['Sv_Hour'] = 'heure'; 7 $lang['Sv_Minute'] = 'minute'; 8 $lang['Sv_Seconde'] = 'seconde'; 5 if( !isset($lang['Minute'])) $lang['Minute'] = l10n('Minute') ; 6 if( !isset($lang['Second'])) $lang['Second'] = l10n('Seconde'); 9 7 10 11 $lang['Sv_n_'.l10n('Sv_Week')]= (7*24*60*60); 12 $lang['Sv_n_'.l10n('Sv_Day')]= (24*60*60); 13 $lang['Sv_n_'.l10n('Sv_Hour')]= (60*60) ; 14 $lang['Sv_n_'.l10n('Sv_Minute')]= 60 ; 15 $lang['Sv_n_'.l10n('Sv_Seconde')]= 1; 16 17 $lang['Sv_Datas'] = 'Datas' ; 18 $lang['Sv_Group'] = $lang['Group']; 19 $lang['Sv_mail_content'] = $lang['mail_content']; 20 $lang['Sv_options'] = 'Options' ; 21 $lang['Sv_raz'] = 'raz' ; 22 $lang['Sv_Quarantaine'] = 'Quarantaine' ; 23 $lang['Sv_config'] = 'Configuration' ; 8 //======================================================= 9 $lang['Sv_Datas'] = 'Datas' ; 10 $lang['Sv_Group'] = $lang['Group']; 11 $lang['Sv_mail_content'] = $lang['mail_content']; 12 $lang['Sv_options'] = 'Options' ; 13 $lang['Sv_raz'] = 'raz' ; 14 $lang['Sv_Quarantaine'] = 'Quarantaine' ; 15 $lang['Sv_config'] = 'Configuration' ; 24 16 25 17 $lang['Sv_rest'] = 'Reste'; … … 27 19 $lang['Sv_iP_adress'] = 'IP adresse'; 28 20 $lang['Sv_Test'] = 'Test'; 21 29 22 $lang['Sv_Valider'] = 'Valider'; 30 23 $lang['Sv_version'] = ' Version :'; 24 31 25 $lang['Sv_fai'] = $lang['Sv_username']; 32 26 $lang['Sv_not_a_spam'] = 'N\'est pas dans la base de données de "stopforumspam".'; … … 82 76 $lang['Sv_nb_maxi'] = ' Nombre maxi '; 83 77 $lang['Sv_quarantaine'] = 'Vous êtes en quarantaine jusqu\'au : '; 78 84 79 $lang['Sv_heures'] = ' Heures '; 85 80 $lang['Sv_date'] = ' Date : '; … … 89 84 //======================================================================== 90 85 $lang['Sv_To_day_is'] = 'Nous sommes le:'.date('d-M-Y H:i:s') ; 91 92 93 94 86 95 87 $lang['Sv_formatdate'] = 'd-M-Y H:i:s'; 88 $lang['Sv_format'] = 'Valeurs acceptées:'; 89 96 90 97 91 $lang['Sv_mise_en_quarantaine %s %s %s %s %s'] = ' … … 120 114 %s 121 115 '; 122 123 116 $lang['Sv_message_texte %s %s %s %s'] =' 124 117 %s 125 Bonjour "%s" , 126 118 '. l10n('hello') .' "%s" , 127 119 %s 128 129 130 A bientot 131 120 '. l10n('See you soon.') .' 132 121 %s 133 122 '; 134 135 136 123 ?> -
extensions/Mail_supervisor/main.inc.php
r4879 r4888 2 2 /* 3 3 Plugin Name: Mail supervisor 4 Version: 1.3. 34 Version: 1.3.5 5 5 Description: Mail supervisor surveille l'envoie des mails. 6 6 Plugin URI: http://piwigo.org/ext/extension_view.php?eid=315 … … 15 15 /* EVENT_HANDLER_PRIORITY_NEUTRAL */ 16 16 17 18 19 global $superv_champs , $superv_type ,$superv_bl_champs , $superv_bl_type ;20 $superv_champs = array(21 "id",22 "nb_mails",23 "date_mail",24 "nb_mails_maxi",25 "nb_mails_periode",26 "nb_spams",27 "date_spam",28 "nb_spams_maxi",29 "nb_spams_periode",30 "quarantaine",31 "date_quarantaine",32 "quarantaine_periode",33 "message",34 "message_test",35 "header_text",36 37 );38 39 $superv_type = array(40 " SMALLINT( 5 ) NOT NULL DEFAULT '0'" ,41 "INT NOT NULL DEFAULT '0'" ,42 "INT NOT NULL DEFAULT '0'" ,43 "INT NOT NULL DEFAULT '2000'",44 "TEXT" ,45 "INT NOT NULL DEFAULT '0'",46 "INT NOT NULL DEFAULT '0'",47 "INT NOT NULL DEFAULT '10'",48 "TEXT" ,49 "TEXT" ,50 "INT NOT NULL DEFAULT '0'",51 "TEXT" ,52 "TEXT" ,53 "TEXT" ,54 "TEXT" ,55 56 );57 58 59 $superv_bl_champs = array(60 "id",61 "ip",62 "pays",63 "region",64 "ville",65 "adresse",66 "fai",67 "nb"68 );69 70 $superv_bl_type = array(71 " smallint(5) UNSIGNED NOT NULL auto_increment ",72 "TEXT" ,73 "TEXT" ,74 "TEXT" ,75 "TEXT" ,76 "TEXT" ,77 "TEXT" ,78 " smallint(5) UNSIGNED "79 );80 81 17 global $conf ; 82 18 83 date_default_timezone_set("Europe/Paris");84 19 85 20 add_event_handler('send_mail', 'clj_mail',EVENT_HANDLER_PRIORITY_NEUTRAL - 1 , 6); 86 87 21 function clj_mail($result, $mailto, $subject, $content, $headers, $args) 88 22 { … … 128 62 // lecture données ------------- 129 63 $mails_données = Get_Datas(); 130 131 64 132 65 $nb_mails = $mails_données['nb_mails'] ; 133 66 $next_day = $mails_données['date_mail'] ; -
extensions/Mail_supervisor/maintain.inc.php
r4715 r4888 27 27 if (!defined('MAIL_SUPERV_PATH')) define('MAIL_SUPERV_PATH' , PHPWG_PLUGINS_PATH.basename(dirname(__FILE__)).'/'); 28 28 include_once (MAIL_SUPERV_PATH.'include/constants.php'); 29 30 31 global $superv_champs , $superv_type ,$superv_bl_champs , $superv_bl_type ;32 $superv_champs = array(33 "id",34 "nb_mails",35 "date_mail",36 "nb_mails_maxi",37 "nb_mails_periode",38 "nb_spams",39 "date_spam",40 "nb_spams_maxi",41 "nb_spams_periode",42 "quarantaine",43 "date_quarantaine",44 "quarantaine_periode",45 "message",46 "message_test",47 "header_text",48 49 );50 51 $superv_type = array(52 " SMALLINT( 5 ) NOT NULL DEFAULT '0'" ,53 "INT NOT NULL DEFAULT '0'" ,54 "INT NOT NULL DEFAULT '0'" ,55 "INT NOT NULL DEFAULT '2000'",56 "TEXT" ,57 "INT NOT NULL DEFAULT '0'",58 "INT NOT NULL DEFAULT '0'",59 "INT NOT NULL DEFAULT '10'",60 "TEXT" ,61 "TEXT" ,62 "INT NOT NULL DEFAULT '0'",63 "TEXT" ,64 "TEXT" ,65 "TEXT" ,66 "TEXT" ,67 68 );69 70 71 $superv_bl_champs = array(72 "id",73 "ip",74 "pays",75 "region",76 "ville",77 "adresse",78 "fai",79 "nb"80 );81 82 $superv_bl_type = array(83 " smallint(5) UNSIGNED NOT NULL auto_increment ",84 "TEXT" ,85 "TEXT" ,86 "TEXT" ,87 "TEXT" ,88 "TEXT" ,89 "TEXT" ,90 " smallint(5) UNSIGNED "91 );92 29 93 30 … … 140 77 } 141 78 142 143 79 ?>
Note: See TracChangeset
for help on using the changeset viewer.