Changeset 10419


Ignore:
Timestamp:
Apr 16, 2011, 3:53:31 PM (13 years ago)
Author:
cljosse
Message:

[extensions] mail_supervisor fix bug in design

Location:
extensions/Mail_supervisor
Files:
20 edited

Legend:

Unmodified
Added
Removed
  • extensions/Mail_supervisor/admin/clear/theme.css

    r10385 r10419  
    2323  color: #999;
    2424  cursor: pointer;
    25   font-size: 110%;
     25  /*font-size: 110%;*/
    2626  overflow: hidden;
    2727  padding: 8px 41px;
  • extensions/Mail_supervisor/admin/default/theme.css

    r10385 r10419  
    1 .bug {
     1.bug {
    22  background-image: url('../../smilies/mouche.gif');
    33  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}
    22{known_script id="jquery.cluetip" src = $ROOT_URL|@cat:"themes/default/js/plugins/jquery.cluetip.packed.js"}
    33{known_script id="jquery.ui" src= $ROOT_URL|@cat:"themes/default/js/ui/minified/ui.core.min.js"}
     
    66<link rel="stylesheet" type="text/css" href="{$MAIL_SUPERV_PATH}admin/{$theme}/theme.css" />
    77{/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" }
    22{combine_script id="jquery.cluetip" path= "themes/default/js/plugins/jquery.cluetip.js" require="jquery"}
    33{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 $ *}
    22<script type="text/javascript">
    33  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'}?";
    55</script>
    66
    77<div class="titrePage">
    8                 <h2>{'Sv_supervisor'|translate}{'Sv_version'|translate}{$version}</h2>
    9 </div> 
     8        <h2>{'Sv_supervisor'|translate}{'Sv_version'|translate}{$version}</h2>
     9</div>
    1010<div class="bug" ></div>
    1111<form action='' method="post" name="form_black">
    1212<fieldset>
    1313<legend >{'Sv_options'|translate}</legend>
    14   <table> 
    15     <td><input type="checkbox" name="no_mail_list" value="on" {$no_mail_list}  />&nbsp;&nbsp;{'Sv_no_mail_list'|translate}      </td>
     14  <table>
     15    <td><input type="checkbox" name="no_mail_list" value="on" {$no_mail_list}  />&nbsp;&nbsp;{'Sv_no_mail_list'|translate}  </td>
    1616    <td style="visibility:hidden" ><input type="checkbox" name="no_connect" value="off" {$no_connect} />&nbsp;&nbsp;{'Sv_no_connect'|translate} </td>
    1717    <td style="visibility:visible" ><input type="checkbox"  name="set_auto" value="off" {$set_auto} />&nbsp;&nbsp;{'Sv_set_auto'|translate} </td>
     
    2525<legend>{'Sv_black_liste'|translate}</legend>
    2626<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         {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}
     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}
    3939</td>
    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         />
     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    />
    4949  </td>
    5050  <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"
    5353  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}"
    5656  title="{'Sv_Ajout'|@translate} {$ip_black}" />
    5757{ else }
    58                    
     58
    5959{/if}
    60                        
     60
    6161</td>
    62          
    63        
    64                            
    65         <td>
    66                 <a href="http://www.stopforumspam.com" >  <img src="{$img_logo}"  width="32"/>  http://www.stopforumspam.com
     62
     63
     64
     65    <td>
     66        <a href="http://www.stopforumspam.com" >  <img src="{$img_logo}"  width="32"/>  http://www.stopforumspam.com
    6767 </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>
    9770
    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>
    10181
    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 >
    103103        <legend>{'Sv_liste_ip'|translate}</legend>
    104         <p class="Style1">
    105              {'Sv_iP_adress'|translate} : {$IP}
     104    <p class="Style1">
     105         {'Sv_iP_adress'|translate} : {$IP}
    106106     </p>
    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>
     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>
    110110{if $start >0}
    111            <td><input class="submit" type="submit" name="prev"  value=   "{'previous_page'|translate}" /></td>
    112         { /if}
    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>
    114114  <td><input type="text" name="start"  value="{$start}" size=5  /></td>
    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>       
     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>
    121121 <table class="table2">
    122   <tr class="throw">   
     122  <tr class="throw">
    123123   <th>{$champs_ip[0]|@translate}</th>
    124124   <th>{$champs_ip[1]|@translate}</th>
     
    129129   <th>{'Sv_blackliste'|@translate}</th>
    130130  </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}
    133133    <tr class="{if $smarty.foreach.group_loop.index is odd}row1{else}row2{/if}">
    134134    <td>{$group.id}</td>
     
    139139    <td>{$group.total}</td>
    140140    <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                    id="btn_permissions{$group.IP}"
    146                    title="{'Sv_blacklist'|@translate} {$group.IP}"
    147                    alt="{'Sv_blacklist'|@translate} {$group.IP}" />
     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}" />
    148148    </td>
    149149    <td style="text-align:center;"></td>
     
    151151   {/foreach}
    152152  {/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>
    154154 </table>
    155 </fieldset> 
     155</fieldset>
    156156</form>
    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"  >     
     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"  >
    163163</form >
  • extensions/Mail_supervisor/admin/mail_superv_admin.php

    r10385 r10419  
    4747  +1 '.$lang['Hour'].'<br />
    4848  +1 '.$lang['Minute'].'<br />
    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';
     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';
    5555else
    5656  $page['tab'] = $_GET['tab'];
    5757
    58 if (file_exists ( 'admin/themes/clear/icon/help.png')) 
     58if (file_exists ( 'admin/themes/clear/icon/help.png'))
    5959{
    6060//version 2.1
    61  
     61
    6262   $icon_path = 'themes/default/icon/help.png';
    63    $path_js=  'themes/default/js/' ; 
     63   $path_js=  'themes/default/js/' ;
    6464
    6565 }
     
    6767 {
    6868// version 1.9
    69   $path_js=  "template-common/lib/"; 
     69  $path_js=  "template-common/lib/";
    7070  $icon_path =  "admin/template/goto/theme/clear/icon/help.png";
    7171}
    72  
     72
    7373
    7474$tabhelp=  '  <img src="'.PHPWG_ROOT_PATH. $icon_path .'"  width=10px   alt="(?)"> ';
     
    7777               l10n('Sv_Tab_set'),
    7878               $my_base_url.'&amp;tab=mail_superv_admin');
    79                            
     79
    8080$tabsheet->add('mail_superv_test',
    8181               l10n('Sv_Tab_test'),
    8282               $my_base_url.'&amp;tab=mail_superv_test');
    83                            
     83
    8484$tabsheet->add( 'mail_black_liste',
    8585               l10n('Sv_blackliste'),
    86                            $my_base_url.'&amp;tab=mail_black_liste');
    87  
    88                                                    
     86               $my_base_url.'&amp;tab=mail_black_liste');
     87
     88
    8989$tabsheet->add('mail_superv_help',
    9090                $tabhelp,
    9191               $my_base_url.'&amp;tab=mail_superv_help');
    92                            
     92
    9393$tabsheet->select($page['tab']);
    9494$tabsheet->assign();
     
    9797$error = array();
    9898
    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))   {
     99include_once (MAIL_SUPERV_PATH.'mail_super.inc.php');
     100include_once (MAIL_SUPERV_PATH.'include/constants.php');
     101
     102  if (!isset($infos_message))   {
    103103      $infos_message = "";
    104104  }
     
    108108
    109109if (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//================================================================================================
    113113
    114114   $mails_donnees = mail_supervisor::Get_Datas();
     
    127127 //=========================================================
    128128  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
    136136//================================================================================
    137137switch ($page['tab'])
    138138 {
    139    
     139
    140140// *************************************************************************
    141141//                         initialisation                                  |
    142142// *************************************************************************
    143143  case 'mail_superv_admin':
    144        
     144
    145145//=============================================================
    146146if ( isset($_POST['submit']) ) {
    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 />';
     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 />';
    162162     mail_supervisor::sauve_donnees();
    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';
     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';
    176176    mail_supervisor::sauve_donnees();
    177          $infos_message .=  l10n('Sv_raz') .'<br />';   
    178         }
     177     $infos_message .=  l10n('Sv_raz') .'<br />';
     178    }
    179179
    180180  //===================================================================
    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 
     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
    187187    $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']  ;
    189189    $mails_donnees['nb_spams_maxi'] = isset($_POST['nb_spams_maxi']) ? $_POST['nb_spams_maxi'] :  $mails_donnees['nb_spams_maxi']  ;
    190190    $mails_donnees['nb_spams_periode'] = isset($_POST['nb_spams_periode']) ? $_POST['nb_spams_periode'] :  $mails_donnees['nb_spams_periode']  ;
    191191
    192192    $mails_donnees['quarantaine_periode'] = isset($_POST['quarantaine_periode']) ? $_POST['quarantaine_periode'] :  $mails_donnees['quarantaine_periode']  ;
    193  
     193
    194194    $mails_donnees['message'] = isset($_POST['content']) ? $_POST['content'] :  $mails_donnees['message']  ;
    195195    $mails_donnees['header_text'] = isset($_POST['header_text']) ? $_POST['header_text'] :  $mails_donnees['header_text']  ;
     
    203203    $mails_donnees = mail_supervisor::Get_Datas() ;
    204204  }
    205  }     
    206         $mails_donnees = mail_supervisor::Get_Datas();
     205 }
     206    $mails_donnees = mail_supervisor::Get_Datas();
    207207 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 ;
    213213 $template->assign(
    214                                         array(
     214                    array(
    215215                        'check_mailto' => ($mails_options['check_mailto'] == 'on') ? 'checked="checked"' : '' ,
    216216                        'check_header_carbons' => ($mails_options['check_header_carbon'] == 'on') ? 'checked="checked"' : '' ,
    217217                        'check_header_text' => ($mails_options['check_header_text'] == 'on') ? 'checked="checked"' : '' ,
    218218
    219    
     219
    220220                        'nb_mails' => $mails_donnees['nb_mails'] ,
    221221                        '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
    226226                        'nb_spams' => $mails_donnees['nb_spams'] ,
    227227                        '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'] ,
    229229                        '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
    232232                        'quarantaine' => $quarantaine ,
    233233                        'date_quarantaine' => "'".date(l10n('Sv_formatdate'),time()+$reste)."'" ,
    234234                        'quarantaine_periode' => "'".int_to_heure($mails_donnees['quarantaine_periode'])."'" ,
    235235                        'reste' => "'".int_to_heure($reste)."'",
    236  
     236
    237237                        'message' => $mails_donnees['message'] ,
    238238                        'header_text' => "'".$mails_donnees['header_text']."'" ,
    239        
    240                         'PHPWG_VERSION' =>      PHPWG_VERSION ,
    241                         'version' =>    $version ,
     239
     240                        'PHPWG_VERSION' =>  PHPWG_VERSION ,
     241                        'version' =>    $version ,
    242242                        'MAIL_SUPERV_PATH' =>  MAIL_SUPERV_PATH ,
    243243                        'path_js' => $path_js,
    244244                        'MAIL_SUPERV_PATH_ABS' => MAIL_SUPERV_PATH_ABS,
    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; 
     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;
    251251  // *************************************************************************
    252252//                        TEST                                             |
    253253// *************************************************************************
    254  
     254
    255255   case 'mail_superv_test':
    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                 }               
     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        }
    270270
    271271//================================================
     
    277277  set_make_full_url();
    278278
    279   /* TODO: if $category['representative_picture_id'] 
     279  /* TODO: if $category['representative_picture_id']
    280280    is empty find child representative_picture_id */
    281281
    282282
    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']);
     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']);
    287287
    288288 if (function_exists('get_user_language_desc') ) $message = get_user_language_desc($message);
    289289
    290290 if ( $_POST['Submit']==l10n('Sv_Envoyer') ) {
    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() ;
     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() ;
    318318    $query = 'SELECT
    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 } 
     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}
    333333
    334334//======================================================================================
    335335  $groups[-1] = '---------';
    336336  $query = ' SELECT id, name
    337                         FROM '.GROUPS_TABLE.'
    338                         ORDER BY name ASC
    339                         ;';
     337            FROM '.GROUPS_TABLE.'
     338            ORDER BY name ASC
     339            ;';
    340340
    341341  $result = pwg_query($query);
    342 //----------------------------------------------------------------     
     342//----------------------------------------------------------------
    343343  while ($row = mysql_fetch_array($result,MYSQL_ASSOC))
    344344  {    $groups[$row['id']] = $row['name'];  }
    345  //--------------------------------------------------------------- 
     345 //---------------------------------------------------------------
    346346if ( isset($_POST['Submit'])) $group_id=-1;
    347347  $template->assign(
    348         'Group',
    349                 array( 'group_options'=> $groups,
    350                                 'selected' => $group_id
    351                         )
    352                 );
     348        'Group',
     349        array( 'group_options'=> $groups,
     350                'selected' => $group_id
     351            )
     352        );
    353353//=================================================================
    354354$destinataires= implode("<br />",get_liste($group_id));
    355355if( $destinataires !="" )
    356356$infos_message .= " List :<hr>" .  $destinataires . "<hr>" ;
    357  
     357
    358358  $template->assign(
    359                                         array(
     359                    array(
    360360              'Groupe'     => $groups,
    361361              'message_test' => $mails_donnees['message_test'] ,
    362362              'liste' => $destinataires ,
    363               'version' =>      $version ,
     363              'version' =>  $version ,
    364364              'MAIL_CONTENT' => $mails_donnees['message_test'],
    365365              'path_js' => $path_js,
    366366              'MAIL_SUPERV_PATH_ABS' => MAIL_SUPERV_PATH_ABS,
    367367              'MAIL_SUPERV_PATH' => MAIL_SUPERV_PATH ,
    368                                                 )
    369                                 );     
    370                                
     368                        )
     369                );
     370
    371371   $template->set_filenames(array('plugin_admin_content' => realpath(MAIL_SUPERV_PATH . 'admin/mail_superv_test.tpl')));
    372372   $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');
    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                        
     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
    384384   break;
    385385// *************************************************************************
    386386//              BLACK LISTE                                         |
    387 // *************************************************************************   
    388  case 'mail_black_liste': 
     387// *************************************************************************
     388 case 'mail_black_liste':
    389389  global $user_name,$mail_adresse,$ip ;
    390390  $aff_nb=false;
    391   //=======================================================================================     
     391  //=======================================================================================
    392392  $info_ip = (isset($info_ip)) ? $info_ip : '' ;
    393393  $info_ip = (isset($_POST['info1'])) ? $_POST['info1'] : $info_ip ;
     
    398398  $ip_black = trim($val[1]) ;
    399399  if (isset($_POST['ip_black']))   $ip_black = ($ip_black == "" ) ? $_POST['ip_black'] : $ip_black ;
    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') )        {
     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') )    {
    406406      $info_ip = 'Ajout' ;
    407407      $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
    412412     $mails_options['no_mail_list'] = isset($_POST['no_mail_list']) ? "on" : "off" ;
    413413     $mails_options['no_connect'] = isset($_POST['no_connect']) ? "on" : "off" ;
     
    415415     $mails_options['set_id'] = isset($_POST['set_id']) ? "on" : "off" ;
    416416     mail_supervisor::sauve_options();
    417      $infos_message .=  l10n('Sv_save_config') . '<br />'; 
     417     $infos_message .=  l10n('Sv_save_config') . '<br />';
    418418  }
    419419}
    420420if (!isset($params)) $params=array();
    421421if (!isset($params['per_page'])) $params['per_page'] = 20 ;
    422 if (!isset($params['start']))    $params['start'] = 0 ;
     422if (!isset($params['start']))    $params['start'] = 0 ;
    423423
    424424if (isset($_POST['per_page'])) $params['per_page'] =$_POST['per_page'];
     
    427427if (isset($_POST['prev']))  $params['start'] -=   1;
    428428 $params['start']= ($params['start']>=0) ? $params['start'] : 0 ;
    429 //=======================================================================================       
    430  include  (MAIL_SUPERV_PATH.'include/save_info.php');     
    431   $maxipage=(int) (     $nbip  / $params['per_page']) ;
    432         $f_action  = $my_base_url.'&amp;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" ;
     429//=======================================================================================
     430 include  (MAIL_SUPERV_PATH.'include/save_info.php');
     431  $maxipage=(int) ( $nbip  / $params['per_page']) ;
     432    $f_action  = $my_base_url.'&amp;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" ;
    439439     $template->assign(
    440                                         array(
     440                    array(
    441441                        'start' => $params['start'],
    442442                        'per_page' => $params['per_page'] ,
     
    444444                        'smile_bonjour' => $smile_bonjour ,
    445445                        'img_logo' => $img_logo ,
    446                         'champs_ip' => $champs_ip ,                                     
     446                        'champs_ip' => $champs_ip ,
    447447                        'liste_ip' => $liste_ip,
    448                         'champs_bl' =>  $champs_bl       ,     
     448                        'champs_bl' =>  $champs_bl   ,
    449449                        'liste_bl' => $liste_bl ,
    450450                        //'conf_admin_layout' => $conf['admin_layout'] ,
     
    456456                        'path_js' => $path_js ,
    457457                        'F_ACTION' => $f_action ,
    458                                                
     458
    459459                        'no_mail_list' => ($mails_options['no_mail_list'] == 'on') ? 'checked="checked"' : '' ,
    460460                        'no_connect' => ($mails_options['no_connect'] == 'on') ? 'checked="checked"' : '' ,
    461461                        'set_auto' => ($mails_options['set_auto'] == 'on') ? 'checked="checked"' : '' ,
    462462                        'set_id' => ($mails_options['set_id'] == 'on') ? 'checked="checked"' : '' ,
    463                         'IP' =>  $ip ,                                         
     463                        'IP' =>  $ip ,
    464464                        'PAYS' =>  $pays  ,
    465465                        'VILLE' =>  $ville ,
    466                         'REGION' =>  $region , 
    467                         'version' =>    $version ,
     466                        'REGION' =>  $region ,
     467                        'version' =>    $version ,
    468468                        'MAIL_SUPERV_PATH_ABS' => MAIL_SUPERV_PATH_ABS,
    469                      
    470                                         )
    471                                 );                       
    472          //===============================================================                                       
     469
     470                    )
     471                );
     472     //===============================================================
    473473  $template->set_filenames(array('plugin_admin_content' => realpath(MAIL_SUPERV_PATH . 'admin/mail_black_liste.tpl')));
    474474  $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');
    475      
    476 
    477    break; 
     475
     476
     477   break;
    478478
    479479// *************************************************************************
    480480//                      AIDE                                               |
    481 // *************************************************************************   
     481// *************************************************************************
    482482     case 'mail_superv_help':
    483483
    484  
    485           $aff_nb=false;
    486           $smile_bonjour=MAIL_SUPERV_PATH."smilies/bonjour.gif" ;
     484
     485      $aff_nb=false;
     486      $smile_bonjour=MAIL_SUPERV_PATH."smilies/bonjour.gif" ;
    487487      $template->assign(
    488                                         array(
     488                    array(
    489489              'smile_bonjour' => $smile_bonjour ,
    490               'version' =>      $version ,
     490              'version' =>  $version ,
    491491              'MAIL_SUPERV_PATH' =>  MAIL_SUPERV_PATH ,
    492492              'path_js' => $path_js,
    493493              'MAIL_SUPERV_PATH_ABS' => MAIL_SUPERV_PATH_ABS
    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; 
     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;
    502502 //====================================================================
    503503  }
    504504//================================================================================
    505505
    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 //========================================================================     
     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//========================================================================
    543543?>
  • extensions/Mail_supervisor/admin/mail_superv_admin.tpl

    r10155 r10419  
    33</script>
    44<div class="titrePage">
    5                 <h2>{'Sv_supervisor'|translate}{'Sv_version'|translate}{$version}</h2>
     5        <h2>{'Sv_supervisor'|translate}{'Sv_version'|translate}{$version}</h2>
    66</div>
    77  <span>{'Sv_Howto'|translate}</span>
     
    1010  <fieldset>
    1111    <legend>{'Sv_admin_titre'|translate}</legend>
    12           <fieldset>
     12      <fieldset>
    1313    <legend>{'Sv_options'|translate}</legend>
    1414
    1515    <table>
    1616<tr><td><input type="checkbox" name="check_mailto" value="on" {$check_mailto} />&nbsp;{'Sv_check_mailto'|translate}</td><td><input type="checkbox" name="check_header_carbon" value="on" {$check_header_carbons} />&nbsp;{'Sv_check_header_carbon'|translate}</td>
    17   { if  $PHPWG_VERSION <= '2.0.4' } 
     17  { if  $PHPWG_VERSION <= '2.0.4' }
    1818<td><input type="checkbox" name="check_header_text" value="on" {$check_header_text} />&nbsp;
    1919{'Sv_check_header_text'|translate}</td>
    2020<td><input type="text" name="header_text"  value={$header_text} /></td>
    21         {/if}
     21    {/if}
    2222</tr>
    2323</table>
     
    3535
    3636  <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>
    4743
    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>
    5353    </table>
    5454 </fieldset>
    55  
     55
    5656<fieldset>
    5757    <legend>{'Sv_state'|translate}</legend>
    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                
     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
    7878    </table>
    7979 </fieldset>
    80  
     80
    8181<fieldset>
    8282    <legend>{'Sv_admin_description'|translate}</legend>
    83                <table >
    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
    8686           </table>
    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}" />
     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}" />
    9191             <input class="submit" type="submit" name="submit" value="{'Sv_refresh'|translate}" />
    92           </p>
     92      </p>
    9393</fieldset>
    9494</form>
  • extensions/Mail_supervisor/admin/mail_superv_help.tpl

    r10155 r10419  
    33<fieldset style=" position:relative ; top:15px">
    44  <legend>{'Sv_admin_titre'|translate}</legend>
    5 <div id="instructionFonction" class="instructionBlock" > 
     5<div id="instructionFonction" class="instructionBlock" >
    66  <div
    77    id="fonction_header"
     
    1717  >
    1818    <p>{'Sv_oversees_management_emails'|translate}.</p>
    19     <ol>     
    20           <li>{'Sv_hlp_1_1'|translate}</li>
     19    <ol>
     20      <li>{'Sv_hlp_1_1'|translate}</li>
    2121      <li>{'Sv_hlp_1_2'|translate}</li>
    2222      <li>{'Sv_hlp_1_3'|translate}</li>
     
    4343  >
    4444
    45  
     45
    4646
    4747<ol>
     
    5151</ul>
    5252  <li ><span  class="throw">{'Sv_check_header_carbon'|translate}</span></li>
    53  
     53
    5454   <ul>
    5555 <li>{'Sv_hlp_2_2'|translate}</li>
    5656</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>
    5858  <ul>
    5959 <li>{'Sv_hlp_2_3'|translate}</li>
     
    8484
    8585<ul>
    86     <ul>     
    87           <li ><i><span class="throw">{'Sv_nb'|translate}</span></i>       {'Sv_hlp_3_1'|translate}</li>
     86    <ul>
     87      <li ><i><span class="throw">{'Sv_nb'|translate}</span></i>       {'Sv_hlp_3_1'|translate}</li>
    8888      <li><i><span class="throw">{'Sv_depuis_le'|translate}</span></i> {'Sv_hlp_3_2'|translate}</li>
    8989      <li><i><span class="throw">{'Sv_nb_maxi'|translate}</span></i>   {'Sv_hlp_3_3'|translate}</li>
    9090      <li><i><span class="throw">{'Sv_periode'|translate}</span></i>   {'Sv_hlp_3_4'|translate}
    91           {'Sv_hlp_3_4_0'|translate}
    92           </li>
     91      {'Sv_hlp_3_4_0'|translate}
     92      </li>
    9393      <li><i><span class="throw">{'Sv_rest'|translate}</span></i>          {'Sv_hlp_3_5'|translate}</li>
    94  
     94
    9595    </ul>
    96  
    97  
    98 
    99 </ul>
    100   </div> <!-- configuration_content --> 
     96
     97
     98
     99</ul>
     100  </div> <!-- configuration_content -->
    101101</div> <!-- instructionconfiguration -->
    102102
     
    120120      <li><i><span  class="throw">{'Sv_quarantaine'|translate}</span></i>     {'Sv_hlp_4_2'|translate}</li>
    121121
    122  
    123 </ul>
    124   </div> <!-- etat_content --> 
     122
     123</ul>
     124  </div> <!-- etat_content -->
    125125</div> <!-- instructionetat -->
    126126
     
    147147  <p>.</p>
    148148
    149   </div> <!-- lastmessage_content --> 
     149  </div> <!-- lastmessage_content -->
    150150</div> <!-- instructionlastmessage -->
    151151 <img src="{$smile_bonjour}" />
    152152 Redaction en cours....
    153153 </fieldset>
    154  
    155  
     154
     155
    156156 <fieldset >
    157157  <legend>{'Sv_Test'|translate}</legend>
    158158<div id="testFonction" class="instructionBlock" >
    159  
     159
    160160  <div
    161161    id="test_header"
     
    170170    style="display:none"
    171171  >
    172      
     172
    173173    <p></p>
    174174  </div> <!-- Fonction -->
     
    177177
    178178 </fieldset>
    179  
     179
    180180<fieldset >
    181181  <legend>{'Sv_blackliste'|translate}</legend>
    182182<div id="blacklisteFonction" class="instructionBlock" >
    183  
     183
    184184  <script type="text/javascript">
    185     var is_supervisor = true; 
     185    var is_supervisor = true;
    186186  </script>
    187187  <div
     
    198198  >
    199199     <p>{'Sv_hlp_7_1'|translate}
    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>
     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>
    206206  <p><input type="button" value="{'Sv_Ajout'|translate}" /></p>
    207         <p><img src="{$ROOT_URL}{$themeconf.admin_icon_dir}/plug_activate.png" />
    208         {'Sv_hlp_7_4'|translate}</p>
     207    <p><img src="{$ROOT_URL}{$themeconf.admin_icon_dir}/plug_activate.png" />
     208    {'Sv_hlp_7_4'|translate}</p>
    209209  </div> <!-- Fonction -->
    210210</div> <!-- Fonctions -->
  • extensions/Mail_supervisor/admin/mail_superv_test.tpl

    r10155 r10419  
    33</script>
    44<div class="titrePage">
    5         <h2>{'Sv_supervisor'|translate}{'Sv_version'|translate}{$version}</h2>
     5    <h2>{'Sv_supervisor'|translate}{'Sv_version'|translate}{$version}</h2>
    66</div>
    77<form action="" method="post" name="form">
    88  <fieldset>
    99    <legend>{'Sv_Tab_test'|translate}</legend>
    10               <fieldset>
     10          <fieldset>
    1111    <legend>{'Sv_message_to_send'|translate}</legend>
    1212
     
    1616      <td>
    1717        <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}
    1919        </select>
    2020      </td>
    21                   <td  >
    22                         {$liste}
    23              </td>
     21          <td  >
     22            {$liste}
     23         </td>
    2424    </tr>
    2525
     
    3131    </tr>
    3232
    33   </table>                 
    34         </fieldset>
     33  </table>
     34    </fieldset>
    3535      <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>
     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>
    4040</fieldset>
    4141</form>
  • extensions/Mail_supervisor/admin/roma/theme.css

    r10385 r10419  
    1 .bug {
     1.bug {
    22  background-image: url('../../smilies/mouche.gif');
    33  background-repeat: no-repeat;
     
    2222  text-align: left;
    2323}
    24 .instructionBlockHeaderCollapsed span, .instructionBlockHeaderExpanded span{ 
     24.instructionBlockHeaderCollapsed span, .instructionBlockHeaderExpanded span{
    2525border-bottom: none;
    2626}
  • extensions/Mail_supervisor/include/constants.php

    r9702 r10419  
    55if (!defined('MAIL_BLACK_LISTE_TABLE')) define('MAIL_BLACK_LISTE_TABLE', $prefixeTable.'mail_black_list');
    66if (!defined('Sv_MAIL_TABLE')) define('Sv_MAIL_TABLE', $prefixeTable.'Sv_mail');
    7 global  $superv_champs , $superv_type ,$superv_bl_champs , $superv_bl_type ;
     7global  $superv_champs , $superv_type ,$superv_bl_champs , $superv_bl_type ;
    88$superv_champs = array(
    99  "id",
    1010  "nb_mails",
    1111  "date_mail",
    12   "nb_mails_maxi",             
    13   "nb_mails_periode",   
     12  "nb_mails_maxi",
     13  "nb_mails_periode",
    1414  "nb_spams",
    15   "date_spam", 
    16   "nb_spams_maxi",     
    17   "nb_spams_periode",   
     15  "date_spam",
     16  "nb_spams_maxi",
     17  "nb_spams_periode",
    1818  "quarantaine",
    1919  "date_quarantaine",
    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                                         );                                                                                                                                     
     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                    );
    6767
    6868?>
  • extensions/Mail_supervisor/include/fonctions.php

    r10385 r10419  
    2626
    2727
    28 global  $superv_champs , $superv_type ,$superv_bl_champs , $superv_bl_type ;
     28global  $superv_champs , $superv_type ,$superv_bl_champs , $superv_bl_type ;
    2929// if (!isset($_COOKIE[session_name()])){}
    3030
     
    3232global $template ;
    3333//===============================================
    34 function corrige_header($Carbonne,$headers,$args,$cl_list_mail,$mailto="")      {
     34function corrige_header($Carbonne,$headers,$args,$cl_list_mail,$mailto="")  {
    3535  global $mails_options,$conf_mail,$infos_message;
    3636  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"  ;
    3838    $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 ;
    4343  } else {
    4444    // Raz Bcc, Cc dans headers
    4545    $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
    5252function int_to_heure($int){
    5353  global $lang,$mails_donnees ;
     
    5656
    5757
    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        
     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
    8080  $retour="";
    8181  $Week=explode(" ",l10n('Week %d'));
     
    8888  if ($secondes > 0) $retour .= "+" . $secondes." " .l10n('Second');
    8989  $retour=str_replace("+0","+",$retour);
    90   //================================================================================================   
     90  //================================================================================================
    9191  return $retour;
    92 }         
    93 
    94        
     92}
     93
     94
    9595function verif_base(){
    9696  global $lang,$superv_champs,$superv_type,$superv_bl_champs,$superv_bl_type;
    9797  load_language('plugin.lang', MAIL_SUPERV_PATH);
    98   //==============================================================================             
     98  //==============================================================================
    9999  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  //==============================================================================
    102102  create_table(mail_superv_TABLE,$superv_champs,$superv_type) ;
    103103  ajust_table(mail_superv_TABLE,$superv_champs,$superv_type)  ;
    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"',
     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"',
    118118   '"'.l10n('Sv_supervisor').'"',
    119         '"'.l10n('hello').'"',
    120         );
    121         ajout_ligne(mail_superv_TABLE,$superv_champs, $valeurs,false ) ;
     119    '"'.l10n('hello').'"',
     120    );
     121    ajout_ligne(mail_superv_TABLE,$superv_champs, $valeurs,false ) ;
    122122}
    123123//=================================================================================
     
    134134      array_push($columns_of, $row[0]);
    135135    }
    136  
     136
    137137  return $columns_of;
    138138}
     
    152152    LEFT JOIN '.USER_GROUP_TABLE.' AS ug
    153153      ON u.'.$conf['user_fields']['id'].' = ug.user_id
    154   WHERE ug.group_id='.$group_id.' '; 
     154  WHERE ug.group_id='.$group_id.' ';
    155155 $groups=array();
    156   $datas = pwg_query($query); 
    157  
     156  $datas = pwg_query($query);
     157
    158158  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'])){
    161161         array_push($groups, format_email($group['username'], $group['email'] ));
    162162      }
    163163    }
    164   } 
     164  }
    165165  return $groups ;
    166  
     166
    167167}
    168168//=================================================================================
     
    170170function create_table($nom_table,$champs,$types)  //mail_superv_TABLE
    171171{
    172         $i=0;
    173         $valeurs=array();
     172    $i=0;
     173    $valeurs=array();
    174174  foreach ( $champs as $champ) {
    175175      $champ = trim($champ);
     
    179179
    180180
    181        
    182         if ( count($valeurs) == 0) return ;
     181
     182    if ( count($valeurs) == 0) return ;
    183183
    184184    $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
    191191}
    192192function ajust_table($nom_table,$champs,$types)  //mail_superv_TABLE
     
    194194global $infos_message ;
    195195$colonnes = Get_colonnes_de($nom_table);
    196         $data =         $types ;
    197         $i=0;
    198         $valeurs=array();
     196    $data =     $types ;
     197    $i=0;
     198    $valeurs=array();
    199199foreach ( $champs as $champ)
    200200   {
    201201     $champ = trim($champ);
    202           if (!in_array( $champ,$colonnes)) {
     202      if (!in_array( $champ,$colonnes)) {
    203203         array_push($valeurs , " ADD `".$champ."`" . '  ' . $data[  $i] )  ;
    204         }
    205         $i +=1;
    206          
    207     }
    208 //============================================================================= 
    209         if ( count($valeurs) == 0) return ;
    210        
     204    }
     205    $i +=1;
     206
     207    }
     208//=============================================================================
     209    if ( count($valeurs) == 0) return ;
     210
    211211  $infos_message .=  "AJUSTE TABLE : ". $nom_table . "<br />" . "NB (col) : ". count($colonnes) . mail_supervisor::Memo_Var($valeurs) . "<br />" ;
    212        
     212
    213213     $valeurs=implode(", ",$valeurs) ;
    214         //===============================================================================
    215                 $query = "ALTER TABLE `" . $nom_table . "` ". $valeurs ;
    216                         if (   pwg_query($query)) return ;           
    217                 die($query);
    218 }
    219 //==============================================================================       
     214    //===============================================================================
     215        $query = "ALTER TABLE `" . $nom_table . "` ". $valeurs ;
     216            if (   pwg_query($query)) return ;
     217        die($query);
     218}
     219//==============================================================================
    220220function ajout_ligne($nom_table,$champs,$valeurs,$force)
    221221{
    222222  if (!$force) {
    223223     $query = "
    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                
     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
    230230}else{
    231231
    232         $count = 0 ;
    233 }
    234  
     232        $count = 0 ;
     233}
     234
    235235  if ($count == 0)
    236236  {
    237237      $n_champs=implode(",",$champs);
    238238      $n_valeurs=implode(",",$valeurs);
    239            $query = "
    240         INSERT INTO `".$nom_table."` (". $n_champs.")
    241         VALUES ( ".     $n_valeurs .")";
    242                
    243                 if (pwg_query($query)) return ;
    244                 die($query);
    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
    246246  }
    247247}
     
    260260if (!is_numeric($mails_donnees['quarantaine_periode'])){
    261261  $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' ;
    263263 }
    264264    if  ($infos_message != "")  {
    265265        array_push($page['infos'],  $infos_message);
    266266        $infos_message="";
    267     }           
     267    }
    268268    if  ($erreur_message != "")  {
    269269        array_push($page['errors'], $erreur_message);
    270270        $erreur_message ="";
    271     }   
    272                  
     271    }
     272
    273273}
    274274//=======================================================================
     
    295295  $lang['Sv_'. $lang['Sv_second']] = 'second';
    296296
    297 } 
    298 //--- traduction --> anglais --- 
     297}
     298//--- traduction --> anglais ---
    299299
    300300 //========= suppression numeric et symbole ==========
    301 $new_valeur =( preg_replace("/[0-9+\-.*\/()%]/"," ",$a_ajouter)); 
     301$new_valeur =( preg_replace("/[0-9+\-.*\/()%]/"," ",$a_ajouter));
    302302$nv =  trim( sup_double_espace($new_valeur)) ;
    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;
     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;
    311311
    312312  $nv = explode(" ", $nv );
    313  
     313
    314314  foreach($nv as $nv1){
    315315    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) ;
    318318      $a_ajouter= str_replace( $nv1,$nv0,   $a_ajouter);
    319       $nv1 = $nv0 ;     
    320     } 
     319      $nv1 = $nv0 ;
     320    }
    321321    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);
    324324    }else {
    325       ob_start(); 
     325      ob_start();
    326326      $match = $conv[strtolower($lang['Sv_'. $nv1])] ;
    327327      $a_ajouter = str_replace($nv1," ". $match  ." ",$a_ajouter) ;
    328328      $erreur_message .= ob_get_contents();
    329329      ob_end_clean();
    330           }               
     330      }
    331331  }
    332332
     
    338338  $new_valeur =  str_replace($v1,$v2,$a_ajouter) ;
    339339  $new_valeur =  str_replace('++','+',$new_valeur ) ;
    340                        
     340
    341341  return   $new_valeur;
    342342}
     
    347347  global $erreur_message,$infos_message,$user;
    348348  global $lang;
    349  
     349
    350350  $ajout=ucwords ($ajout);
    351  
    352  
     351
     352
    353353if (is_numeric($ajout))
    354354 $valeur=   $ajout ;
     
    356356{
    357357 $valeur= Date_to_numeric( $ajout) ;
    358  
     358
    359359 }
    360  
     360
    361361$new_valeur = explode( "|", $valeur );
    362362
     
    365365$erreur = false;
    366366
    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 ;
     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 ;
    381381return    intval($p) ;
    382  
     382
    383383}
    384384//=====================================================================================
    385 function matheval($equation) 
    386   { 
     385function matheval($equation)
     386  {
    387387
    388388  $return="error";
    389389
    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  }
    405405
    406406//======================================================================================
    407407function sup_double_espace($chaine){
    408408global $erreur_message;
    409         $str_temp = $chaine." ";
    410         $sep=" ";
    411         $chaine = trim($chaine);
     409    $str_temp = $chaine." ";
     410    $sep=" ";
     411    $chaine = trim($chaine);
    412412    if ($chaine=="") return ;
    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 ============================================   
     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 ============================================
    424424function kill_list() {
    425425  global $pays,$region,$ville,$ip ;
    426   global $erreur_message,$infos_message,$conf; 
     426  global $erreur_message,$infos_message,$conf;
    427427  global $conf, $user, $page;
    428428  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 ;
    431431  if (!isset($ip)) {
    432432    if (getenv("HTTP_CLIENT_IP"))   {
     
    437437  }
    438438  $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         $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') { 
     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') {
    453453      global $user_name,$mail_adresse;
    454454
    455455       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 .
    457457            if ($nb==0) {
    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       } 
     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      }
    488488    }
    489489 //==============================================================================
    490490
    491  if ( $mails_options['ip'] == $ip ) return ($nb > 0) ;   
     491 if ( $mails_options['ip'] == $ip ) return ($nb > 0) ;
    492492   $ip0= $mails_options['ip'] ;
    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         }
     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    }
    550550 return ($nb > 0) ;
    551551}
     
    558558 $result="";
    559559 $ip= sup_double_espace($ip);
    560  if (strlen($ip)>3) { 
     560 if (strlen($ip)>3) {
    561561   //==================  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                         $mail_adresse=$ip ;
    568                  $ip="";
    569             }
    570             else
    571             {
    572    //==================  Login  ================ 
    573               $user_name=$ip;
    574               $ip="";
    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   }
    577577   //=============================================================================
    578578 }
     
    582582 $user_name="";  // ne plus tester sur le login.
    583583 $mail_adresse =str_replace(" ","%20",trim($mail_adresse));
    584  if ( strlen($user_name) > 3)     $type[]="username=$user_name" ;
     584 if ( strlen($user_name) > 3)     $type[]="username=$user_name" ;
    585585 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 ) {
    588588  $resultat="";
    589589  if (  clj_fetchRemote($src.$fil , $resultat,1))
    590    $result .= $resultat.'<br />'  ;               
     590   $result .= $resultat.'<br />'  ;
    591591 }
    592592
    593593 return !(strpos(  $result ,'yes' ) === false) ;
    594  
     594
    595595}
    596596//==================================================================
    597597function lire_fichier_distant($fichier){
    598598  $buffer="";
    599   $handle =  @fopen($fichier,"r"); 
     599  $handle =  @fopen($fichier,"r");
    600600  if ($handle) {
    601     while (!feof($handle)) { 
     601    while (!feof($handle)) {
    602602        $buffer .= fgets($handle, 4096);
    603                   }   
    604                           fclose($handle);
    605           }
    606                                  
     603          }
     604              fclose($handle);
     605      }
     606
    607607  return  $buffer ;
    608608
     
    611611function clj_is_ip($ip){
    612612if (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
    614614}
    615615
    616616function 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
    624624function clj_fetchRemote($src, &$dest, $timeout=1, $user_agent='Piwigo', $step=0)
    625625{
     
    628628
    629629  if ($src=="") return ;
    630  
     630
    631631  if (!url_is_remote($src))
    632632  {
    633  
     633
    634634    $content = @file_get_contents($src);
    635635    if ($content !== false)
     
    643643    }
    644644  }
    645  
     645
    646646  // After 3 redirections, return false
    647647  if ($step > 3) return false;
  • extensions/Mail_supervisor/include/function_test_send.php

    r9702 r10419  
    2323
    2424if ( !defined('PHPWG_ROOT_PATH'))   die('Hacking attempt!');
    25 function test_envoie($message,$group_name,$group_id){   
     25function test_envoie($message,$group_name,$group_id){
    2626  global $infos_message,$erreur_message ,$conf,$user,$conf_mail,$mail_donnees,$args,$lang ;
    27         $mailto="";     
     27    $mailto="";
    2828 load_language('plugin.lang', MAIL_SUPERV_PATH);
    29  
     29
    3030//==================================================================================
    3131if (!isset($infos_message))
    32         {
    33         $infos_message = "";
    34         }
     32    {
     33        $infos_message = "";
     34    }
    3535if (!isset($erreur_message))
    36         {
    37         $erreur_message = '';
    38         }
     36    {
     37        $erreur_message = '';
     38    }
    3939if (!isset($mails_donnees))
    40         {
    41         $mails_donnees = mail_supervisor::Get_Datas();
    42         }               
     40    {
     41        $mails_donnees = mail_supervisor::Get_Datas();
     42    }
    4343if (!isset($conf_mail))
    4444  {
    45         $conf_mail = get_mail_configuration();
     45        $conf_mail = get_mail_configuration();
    4646  }
    47           if (isset($args))
    48   { 
     47      if (isset($args))
     48  {
    4949    $infos_message=mail_supervisor::Memo_Var($args);
    5050  }else{
    51         $args = array();
    52         }
     51    $args = array();
     52    }
    5353//=====================================================================================================
    5454
    55  
     55
    5656
    5757$groups=get_liste($group_id);
     
    6262       $args['Bcc']=$groups;
    6363   }   else {
    64        $mailto = $conf_mail['formated_email_webmaster']; 
    65    } 
    66    
     64       $mailto = $conf_mail['formated_email_webmaster'];
     65   }
     66
    6767$args['from'] =(function_exists('get_user_language_desc')) ? get_user_language_desc($conf_mail['formated_email_webmaster']):$conf_mail['formated_email_webmaster'];
    6868$message_html =$message;
    6969      if (function_exists('get_user_language_desc') and isset($message) and $message <> '')
    7070        $message = get_user_language_desc($message)."\n\n";
    71  
    72         //==================================================================
    73         $message_texte=sprintf(
     71
     72    //==================================================================
     73    $message_texte=sprintf(
    7474        l10n('Sv_message_texte %s %s %s %s'),
    7575        format_date( date("Y-m-d H:i:s")),
    76                 $group_name,
    77                 $message,
    78                 $args['from']
    79         );     
    80         //==================================================================
    81         $message_html .= "</br>" . $message . "</br>" . $message_texte;
     76        $group_name,
     77        $message,
     78        $args['from']
     79        );
     80    //==================================================================
     81    $message_html .= "</br>" . $message . "</br>" . $message_texte;
    8282 //==========================================================================
    8383
    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         }
     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    }
    101101}
    102102//===============================================================================================================
     
    105105
    106106    $mails_donnees = mail_supervisor::Get_Datas();
    107           if (!isset($conf_mail))
     107      if (!isset($conf_mail))
    108108  {
    109109    $conf_mail = get_mail_configuration();
     
    112112 load_language('plugin.lang', MAIL_SUPERV_PATH);
    113113
    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'];
     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'];
    125125$to="";
    126126
     
    128128        l10n('Sv_message_texte %s %s %s'),
    129129        format_date( date("Y-m-d H:i:s")),
    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  
     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
    138138  echo str_replace("\n","<br />",$message_texte);
    139        
     139
    140140  $message_html .= ob_get_contents()."\n";
    141141  //ob_flush();
    142142  ob_end_clean();
    143143
    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";
    146146
    147147  //=======================================================================================
     
    149149    $headers.= "Reply-To: ".$args['from']."\n";
    150150    $nb_destinataires=0;
    151     $destinataire = $conf_mail['email_webmaster']; 
     151    $destinataire = $conf_mail['email_webmaster'];
    152152    if (!empty($args['Cc'])){
    153153      $nb_destinataires += count($args['Cc']);
    154154      $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']);
    159159      $to = implode(',', $args['Bcc']);
    160       $headers  .= 'Bcc :'.get_strict_email_list($to)."\n" ;               
     160      $headers  .= 'Bcc :'.get_strict_email_list($to)."\n" ;
    161161    }
    162162
     
    166166    $headers.= 'MIME-Version: 1.0'."\n";
    167167    $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";
    187187    $ret=false;
    188188    ob_start();
    189     $ret= mail( $destinataire, $args['subject'], $texte.$attachement, $headers); 
     189    $ret= mail( $destinataire, $args['subject'], $texte.$attachement, $headers);
    190190    $message =  ob_get_contents() ;
    191191  //ob_flush();
     
    195195    $infos_message =  "-------------------";
    196196  }
    197   return  $ret; 
     197  return  $ret;
    198198}
    199199?>
  • extensions/Mail_supervisor/include/save_info.php

    r9702 r10419  
    44switch (strtolower($info_ip))
    55 {
    6   case  'ajout' : 
     6  case  'ajout' :
    77 $ip_black=str_replace("*","%",$ip_black);
    88 if (!($ip_black == '')) {
    99   $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    //==============================================================================
    1515  list($count) = mysql_fetch_row(pwg_query($query));
    16   //==============================================================================     
     16  //==============================================================================
    1717  $valeurs=array( 'NULL',
    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)) ;   
     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)) ;
    2727 }
    28  
     28
    2929 break;
    3030 //================================================================================================
    3131  case 'raz':
    3232    $ip_black=str_replace('*',"%",$ip_black);
    33                 $query = "DELETE FROM `".MAIL_BLACK_LISTE_TABLE."` WHERE `ip`  like '%".$ip_black."%' ";
    34                         pwg_query($query);
    35    
     33        $query = "DELETE FROM `".MAIL_BLACK_LISTE_TABLE."` WHERE `ip`  like '%".$ip_black."%' ";
     34            pwg_query($query);
     35
    3636    unset ($_SESSION['pwg_'.'action_spam']);
    3737   break;
    38    
    39     default:                           
     38
     39    default:
    4040   break;
    41    
    42   } 
     41
     42  }
    4343//================ Liste Black liste =================
    4444  $query = "
    45      SELECT *,  COUNT(`ip`) as total ,  `ip` as blacklist, `ip` as U_DELETE
     45     SELECT *,  COUNT(`ip`) as total ,  `ip` as blacklist, `ip` as U_DELETE
    4646     FROM ".MAIL_BLACK_LISTE_TABLE."
    47      GROUP by ip 
     47     GROUP by ip
    4848     ;";
    49         $liste_bl = array();
     49    $liste_bl = array();
    5050 $result = pwg_query($query);
    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.'    '); 
     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.'    ');
    5656$nbip =  array_pop(mysql_fetch_row($req)) ;
    5757
    58         $query = 'SELECT DISTINCT       H.`id`,
     58    $query = 'SELECT DISTINCT   H.`id`,
    5959            H.`date`,
    6060            H.`time`,
    6161            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         if (count($liste_bl)>0){
    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`
    6868    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    }
    7670
    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    '   ;
    8076
    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                }
    8383
    8484?>
  • extensions/Mail_supervisor/language/en_UK/plugin.lang.php

    r9208 r10419  
    66//=======================================================
    77$lang['Sv_Datas'] =  'Datas' ;
    8 $lang['Sv_Group'] = $lang['Group']; 
     8$lang['Sv_Group'] = $lang['Group'];
    99$lang['Sv_mail_content'] =  '';
    1010$lang['Sv_options'] =   'Options' ;
     
    1313$lang['Sv_config'] =  'Configuration' ;
    1414
    15 $lang['Sv_rest'] = 'Remain';   
     15$lang['Sv_rest'] = 'Remain';
    1616$lang['Sv_iP_list'] = 'IP\'s list';
    1717$lang['Sv_iP_adress'] = 'IP address';
     
    8484$lang['Sv_To_day_is'] = 'Today is:'.date('d-M-Y H:i:s') ;
    8585
    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:';
    8888
    8989
     
    9191                            ON QUARANTINE!<br />'.
    9292                            'Number of %s sent: %s  <br />'.
    93                             'From             : %s  <br />'.       
     93                            'From             : %s  <br />'.
    9494                            'You still have     %s  before unblocking<br />'.
    9595                              ' The       %s <br />' ;
     
    9999                            'You overpassed the number of mails within the acceptable period. <br />'.
    100100                            'Number of %s sent: %s  <br />'.
    101                             'From             : %s  <br />'.       
     101                            'From             : %s  <br />'.
    102102                            'You still have     %s before unblocking<br />'.
    103103                              ' The       %s <br />' ;
     
    113113$lang['Sv_message_texte "%s" "%s" "%s" "%s"'] ='
    114114 %s
    115         '. l10n('hello') .'  "%s"  ,
     115    '. l10n('hello') .'  "%s"  ,
    116116  %s
    117         '. l10n('See you soon.') .'  %s
    118           ';
     117    '. l10n('See you soon.') .'  %s
     118      ';
    119119?>
  • extensions/Mail_supervisor/language/fr_FR/help/plugin.lang.php

    r10385 r10419  
    99$lang['Sv_Fonctionality']='Fonctionnalites';
    1010
    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';
    1212$lang['Sv_hlp_1_1']='Compte le nombre de mails envoyes par le site.';
    1313$lang['Sv_hlp_1_2']='Detecte les differents messages d\'alertes generes par la fonction mail[]';
     
    4646$lang['Sv_hlp_4_1']='Date limite de la mise en quarantaine.';
    4747$lang['Sv_hlp_4_2']='Duree restante avant l\' anulation de la mise en quarantaine.';
    48          
     48
    4949$lang['Sv_last_message']='Dernier message renvoye.';
    5050$lang['Sv_hlp_5_1']='Dernier message renvoye par la fonction mail() en cas d\'erreur.';
    5151
    5252
    53 //====================================================================== 
     53//======================================================================
    5454$lang['Sv_hlp_7_1']='Ce module permet de creer une liste noire contenant les adresses IP indesirables.<br />
    55           ' ;   
     55          ' ;
    5656$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          ' ;
    5858$lang['Sv_hlp_7_1_2']='Option 2 Rejet de l\' adresse IP .<br />
    59                   ' ;   
     59          ' ;
    6060$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                    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                                 ' ;     
     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                ' ;
    6565$lang['Sv_hlp_7_2']= 'Ajout manuel des adresses indesirables.<br />
    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' ; 
     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' ;
    7575
    7676$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' ;
    7979?>
  • extensions/Mail_supervisor/language/fr_FR/plugin.lang.php

    r9702 r10419  
    66//=======================================================
    77
    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'];
    1313$lang['Sv_mail_content'] =  '';
    1414$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';
    2121$lang['Sv_iP_adress'] = 'IP adresse';
    2222$lang['Sv_Test'] = 'Test';
     
    8686$lang['Sv_supervisor'] = 'Superviseur de MAILS';
    8787//========================================================================
    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') ;
    8989
    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:';
    9292
    9393
    9494$lang['Sv_mise_en_quarantaine %s %s %s %s %s'] = '
    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        
     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
    101101
    102102$lang['Sv_alerte_mail %s %s %s %s %s'] = '
    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']=      '
     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']=  '
    111111La fonction mail à retourné [%s] <br />
    112112MESSAGE erreur : [ %s ] <br />
     
    118118$lang['Sv_message_texte "%s" "%s" "%s" "%s"'] ='
    119119 %s
    120         '. l10n('hello') .'  "%s"  ,
     120    '. l10n('hello') .'  "%s"  ,
    121121  %s
    122         '. l10n('See you soon.') .'  %s
    123           ';
     122    '. l10n('See you soon.') .'  %s
     123      ';
    124124?>
  • extensions/Mail_supervisor/mail_super.inc.php

    r10385 r10419  
    3939 */
    4040 static public function init() {
    41   global  $template,$version,$icon_path;   
     41  global  $template,$version,$icon_path;
    4242  $action_spam = pwg_get_session_var('action_spam') ;
    4343  $theme="default";
     
    4848  if (PHPWG_VERSION < 2.2 ) {
    4949    $file =MAIL_SUPERV_PATH_ABS.'admin/header_2_1.tpl' ;
    50  
     50
    5151  } else {
    5252    $file = MAIL_SUPERV_PATH_ABS.'admin/header_2_2.tpl' ;
    53    
     53
    5454  }
    5555  if(isset($_GET['action_spam']) and $_GET['action_spam']=="no"){
     
    6262  $profile=array('theme' => $theme,
    6363            '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
    6666          );
    6767
     
    8686          $ip=getenv("REMOTE_ADDR");
    8787      }
    88     }   
     88    }
    8989      //  unset ($_SESSION['pwg_'.'action_spam']);
    9090      $action_spam = pwg_get_session_var('action_spam') ;
    91        
     91
    9292      if  ($action_spam == null or $action_spam == 'false') {
    9393        $action_spam = kill_list();
    9494      }
    9595
    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" ;
    9797      if ($action_spam == "true" ) {
    9898        $erreur_message .= $ip . " "  . $action_spam  ;
     
    122122        else $page['infos']=Array($infos_message);
    123123        $infos_message="";
    124       }   
     124      }
    125125    if (isset($erreur_message))
    126126      if  ($erreur_message != "")  {
     
    130130        else $page['errors']=Array($erreur_message);
    131131        $erreur_message ="";
    132       } 
     132      }
    133133    return $action_spam;
    134134  } //fin Affiche_message
     
    140140  static public function Get_geo() {
    141141    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');
    144144    if (count($info_geo) > 0){
    145145        $pays  = $info_geo[0];
     
    177177    if(count($variables)>1){
    178178    foreach($variables as $key => $line){
    179       echo  $key . " =>  " . $line ; 
     179      echo  $key . " =>  " . $line ;
    180180      echo "<br />";
    181     }       
     181    }
    182182    }else{
    183183        echo "<i>".$variables."</i><br />";
     
    233233    global $conf,$mails_options ;
    234234  $mails_options=  $conf[$str_index];
    235  
     235
    236236 if(isset($mails_options))
    237237   if ( preg_match("|s:(.*)|", $mails_options, $val) )
     
    239239   else{
    240240     $parametres=explode(",",$mails_options);
    241    
     241
    242242    $def_para->check_mailto="on";
    243243    $def_para->check_header_carbon="on";
    244244    $def_para->check_header_text="on";
    245245    $def_para->no_mail_list="on";
    246     $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 
     246    $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
    250250    $i=0;
    251251    foreach ($def_para as $key => $value) {
    252252        $value=$parametres[$i];
    253253        unset( $parametres[$i]) ;
    254         $parametres[$key]= $value  ; 
     254        $parametres[$key]= $value  ;
    255255        $i++;
    256256    }
    257257     }
    258258  return mail_supervisor::Set_Options($parametres,$str_index);
    259   }       
     259  }
    260260  //==========================================================
    261   function Set_Options($parametres,$str_index){ 
     261  function Set_Options($parametres,$str_index){
    262262  global $infos_message,$conf;
    263       foreach ($parametres as $key => $value) { 
     263      foreach ($parametres as $key => $value) {
    264264       $parametres[$key]=(isset($_POST[$key]))? "on" : $value ;
    265265     }
    266    $parametres['no_connect']= 'off' ;     
     266   $parametres['no_connect']= 'off' ;
    267267     return $parametres ;
    268268  }
     
    274274
    275275 if ( isset($mails_parametres) )
    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          
     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
    284284 }
    285285
     
    287287  function sauve_donnees(){
    288288  global $mails_donnees,$superv_champs,$superv_type,$erreur_message ;
    289   //=====================================================================       
     289  //=====================================================================
    290290  $clefs = $superv_champs ;
    291291  $valeurs = array();
    292292  foreach ( $clefs as $champ){
    293         $champ = trim($champ);     
    294             if ( isset($mails_donnees[  $champ ]) ) {
    295               $sep= (is_string($mails_donnees[ $champ ])) ? '"' : '' ;
     293        $champ = trim($champ);
     294        if ( isset($mails_donnees[  $champ ]) ) {
     295          $sep= (is_string($mails_donnees[ $champ ])) ? '"' : '' ;
    296296          array_push($valeurs , "`".$champ."`" . ' = ' . $sep . $mails_donnees[  $champ ] . $sep)  ;
    297             }else{       
    298               array_push($valeurs , "`".$champ."`" . ' = ' .  "0"  )  ;
    299             }   
     297        }else{
     298          array_push($valeurs , "`".$champ."`" . ' = ' .  "0"  )  ;
     299        }
    300300      }
    301301  $valeurs = implode(", ",$valeurs) ;
     
    304304          UPDATE '.mail_superv_TABLE.'
    305305          SET '. $valeurs .'
    306                   WHERE `id` = 1 LIMIT 1 ';
    307                   ;
     306          WHERE `id` = 1 LIMIT 1 ';
     307          ;
    308308  ob_start();
    309309  $ret=  pwg_query($query)    ;
     
    316316    global $superv_champs ;
    317317    $champs = implode(",",$superv_champs );
    318       $query = "SELECT ".$champs." 
     318      $query = "SELECT ".$champs."
    319319      FROM ".mail_superv_TABLE."
    320320      ;";
    321                 $result = @pwg_query($query);
     321        $result = @pwg_query($query);
    322322    if (!$result) {
    323                         verif_base();
    324                         $result = @pwg_query($query);
    325                 }                                       
     323            verif_base();
     324            $result = @pwg_query($query);
     325        }
    326326    $data = mysql_fetch_array($result,MYSQL_ASSOC);
    327327    //====================================================================================
    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()) ;
    330330    $data['rest_mail'] =    $next_day - time() ;
    331331    $next_day = Str_To_Time( $data['nb_spams_periode'],$data['date_spam']);
    332332    $next_day = ($next_day >0) ? $next_day :  (172800  + time()) ;
    333333    $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']);
    335335    $next_day = ($next_day >0) ? $next_day :  (172800 + time()) ;
    336        
     336
    337337    if ($data['quarantaine'] == 'true' ) {
    338                     $data['reste'] =   ( $next_day )-time() ;
     338            $data['reste'] =   ( $next_day )-time() ;
    339339    }else{
    340                     $data['reste'] = 0;
    341     }
    342        
    343             return $data;
     340            $data['reste'] = 0;
     341    }
     342
     343        return $data;
    344344  }
    345345 }
  • extensions/Mail_supervisor/main.inc.php

    r10388 r10419  
    1616
    1717global $conf,$mails_options ;
    18 include_once (MAIL_SUPERV_PATH.'include/constants.php'); 
     18include_once (MAIL_SUPERV_PATH.'include/constants.php');
    1919include_once(MAIL_SUPERV_PATH.'mail_super.inc.php');
    2020
     
    2323
    2424$mails_options = mail_supervisor::Get_Options($mails_options,"mail_superv");
    25 /* EVENT_HANDLER_PRIORITY_NEUTRAL  */   
     25/* EVENT_HANDLER_PRIORITY_NEUTRAL  */
    2626//
    2727//
    2828include_once (PHPWG_ROOT_PATH.'include/functions_mail.inc.php' );
    29 include_once (MAIL_SUPERV_PATH.'include/fonctions.php'); 
     29include_once (MAIL_SUPERV_PATH.'include/fonctions.php');
    3030//===============loc_begin_index==============loc_after_page_header=============================================================
    3131add_event_handler('loc_begin_page_header',  array(&$mail_supervisor,'init')  );
     
    3535add_event_handler('send_mail', 'clj_mail',EVENT_HANDLER_PRIORITY_NEUTRAL - 10, 6);
    3636function clj_mail($result, $mailto, $subject, $content, $headers, $args) {
    37   global $conf, $user, $lang_info; 
     37  global $conf, $user, $lang_info;
    3838  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;
    4040  global $errors;
    4141  // 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
    5251  // $mails_options = explode("," , $conf['mail_superv']);
    5352  $envoie_ok=true ;
    5453  //======== verification si envoie de mail ou blocage connexion =====================
    5554
    56   if ($mails_options['no_mail_list']=='on' || $mails_options['no_connect'] == 'on' )    {
    57                 if (kill_list()) {
     55  if ($mails_options['no_mail_list']=='on' || $mails_options['no_connect'] == 'on' )    {
     56        if (kill_list()) {
    5857      $nb_destinataires=0; ;
    5958      $envoie_ok= false ;
    6059      $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 />";
    6261      if ($mails_options['no_connect'] == 'on' ){
    63               if ($user['status'] == 'webmaster'){ 
    64               //---------- continuer si web master ----------
    65               }else{
    66                       if (!isset($_GET['admin'])) {
    67                                       die('Blacklist : <br />' .$erreur_message. '<br /> Hacking attempt!');
    68                                         }elseif   ($_GET['admin'] != 'piwigo')
    69                                                 {
    70                                       die('blacklist Hacking attempt!');
    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          }
    7372      }
    74          return true;
    75                 }
    76         }
     73       trigger_event('cl_kill_send_mail', $ip);
     74         return true;
     75        }
     76    }
    7777  // 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         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; 
     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;
    9898  //====================================================
    99     $match_email = $conf_mail['email_webmaster'];     
     99    $match_email = $conf_mail['email_webmaster'];
     100
    100101    $new_args=array();
    101102    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)){
    104105          array_push($new_args, $val);
    105106      }else{
    106                 $mailto = $match_email;
     107            $mailto = $match_email;
    107108      }
    108109    }
     
    110111     //=======================================================================
    111112     $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 ) {
    121122      $mailto = $conf_mail['email_webmaster'];
    122123      $nb_destinataires ++;
    123124    }
    124125
    125                 if ($mails_options['check_mailto'] == 'on') {
    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 />";
    130131    //================= réecriture de l'entete ===============================
    131132    $match=array("<",">");
    132     $string=array("&lt;","&gt;") ;                     
    133     if ( $nb_destinataires  == 1 ) {   
    134       if ($mailto == "" ) {     
    135         if (!empty($args['Bcc'])){ 
     133    $string=array("&lt;","&gt;") ;
     134    if ( $nb_destinataires  == 1 ) {
     135      if ($mailto == "" ) {
     136        if (!empty($args['Bcc'])){
    136137          $mailto = get_strict_email_list(implode(',', $args['Bcc']));
    137138          $args['Bcc']=array();
    138         }else{   
     139        }else{
    139140          if (!empty($args['Cc']) ){  $mailto=get_strict_email_list(implode(',', $args['Cc']));
    140141           $args['Cc']=array();
     
    148149      $infos_message .="Destinataire:" .$mailto ;
    149150      //=============================================================================
    150        
     151
    151152    }else{
    152153          //=== plusieurs destinataires ===========
    153154      $cl_list_mail="";
    154       if ($mailto !="") $infos_message .="To: " . $mailto . " "."<br />" ;     
     155      if ($mailto !="") $infos_message .="To: " . $mailto . " "."<br />" ;
    155156      if (!empty($args['Cc'])) {
    156157        $ret= corrige_header('Cc',$headers,$args,$cl_list_mail,$mailto);
    157158        $headers = $ret->headers;
    158159        if($ret->list_mail!="") $infos_message .="Cc: " .  ( $ret->list_mail)."  <br />" ;
    159              
     160
    160161      }
    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);
    163164          $headers = $ret->headers ;
    164165          if($ret->list_mail!="") $infos_message .="Bcc: " . ( $ret->list_mail) ."  <br />";
    165            
    166        }     
    167              $infos_message .=  " " ;
    168     }
    169      
    170      
     166
     167       }
     168         $infos_message .=  " " ;
     169    }
     170
     171
    171172            //=============================================================================
    172173            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";
    180181              $content =$texte .$content ;
    181             }   
     182            }
    182183            // corrige erreur 'mail dropped, bare LF found'
    183           /*   if ( preg_match('/\n\./',$content)){ 
     184          /*   if ( preg_match('/\n\./',$content)){
    184185             $content=preg_replace('/\n\./', '/\n\.\./', $content);
    185186
     
    187188             }
    188189             $content = str_replace("\n.", "\n/./.", $content);
    189              $headers = str_replace("\n.", "\n..", $headers); 
     190             $headers = str_replace("\n.", "\n..", $headers);
    190191            $subject = str_replace("\n.", "\n..", $subject);
    191192             $mailto = str_replace("\n.", "\n..", $mailto);
    192193       */
    193              
    194             $ret=false; 
    195                 //======== Non mise en quarantaine ============= 
    196          
    197          
    198                     ob_start();
    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
    203204          }else{
    204205            $message .= l10n('Sv_no_receiver_available');
     
    206207        $message .= ob_get_contents();
    207208        ob_end_clean();
    208         $mails_donnees['message']=$message;     
     209        $mails_donnees['message']=$message;
    209210        Gestion_erreurs($message,$ret,$nb_destinataires,$headers,$mailto);
    210211            } else {
    211                     //================== Est en quarantaine =======================     
    212                         $erreur_message .=      l10n('Sv_To_day_is')."<br />";
    213                             if ($alerte_spam ) {
    214                                 $type="Spams";                         
    215                                         $d1=$mails_donnees['nb_spams'] . '  \\  ' . $mails_donnees['nb_spams_maxi'];
    216                                         $d2=$mails_donnees['nb_spams'];
    217                                         $d3= $mails_donnees['rest_spam'];
    218                                         $d4=time()+$d3 ;
    219                             } 
    220                             if ($alerte_mail) {
    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";
    222223                    $d1=$mails_donnees['nb_mails']. '  \\  ' . $mails_donnees['nb_mails_maxi'];;
    223224                    $d2=$mails_donnees['date_mail'];
    224225                    $d3= $mails_donnees['rest_mail'];
    225226                    $d4=time()+$d3 ;
    226                             }
    227                             if ($alerte) {
    228                         $type="Spams(Quarantaine)";
    229                                     $d1=$mails_donnees['nb_spams'] . '  \\  ' . $mails_donnees['nb_spams_maxi'];
    230                                     $d2=$mails_donnees['date_quarantaine'];
    231                                     $d3= $mails_donnees['reste'];
    232                                     $d4=time()+$d3 ;
    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                }
    234235            $d2=date(l10n('Sv_formatdate'),$d2);
    235236            $d3=int_to_heure($d3) ;
    236237            $d4=date(l10n('Sv_formatdate'),$d4);
    237238            if ($alerte_mail) {
    238                     $erreur_message .='<br />'.sprintf(l10n('Sv_alerte_mail %s %s %s %s %s'),$type,$d1,$d2,$d3,$d4).'<br />';
     239                $erreur_message .='<br />'.sprintf(l10n('Sv_alerte_mail %s %s %s %s %s'),$type,$d1,$d2,$d3,$d4).'<br />';
    239240            }else{
    240                         $erreur_message .='<br />'.sprintf(l10n('Sv_mise_en_quarantaine %s %s %s %s %s'),$type,$d1,$d2,$d3,$d4).'<br />';
    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>";
    245246    mail_supervisor::sauve_donnees();
    246247    mail_supervisor::affiche_message();
    247248    return true ;
    248249}
    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//===========================================================================================
     251function 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;
    252253     $match=array("<",">");
    253     $string=array("&lt;","&gt;") ;       
    254 //Warning: mail() has been disabled for security reasons 
    255        
    256         $est_un_spam =!(strpos(strtolower($message), 'spam') === false);
    257         $headers=str_replace( $match,$string, $headers);
    258        
    259         if ( ($ret==false) || ($est_un_spam==true) || ($nb_destinataires == 0) ) {
    260                  ;                              // Bad recipient address syntax
    261                 $pos1 = strpos(strtolower($message), 'bad recipient address syntax');
    262                 if (  !($pos1 === false) ){
    263                         $erreur_message .= l10n('Sv_detection_de').' Bad recipient address syntax .';
    264                         $erreur_message .= l10n('Sv_verifiez_les_destinataires').' (Bcc,Cc,To)<br />';
    265                         }       
    266        
    267         $erreur_message .= sprintf(l10n('Sv_debug_message'),
    268         ($ret==true)? "true" : "false",
    269         $message ,
    270         $mailto ,
    271         $headers ,
    272         $nb_destinataires );
    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                         $mails_donnees['nb_mails'] += $nb_destinataires;
    280                         }
    281                         else
    282                         {
    283                                 $mails_donnees['nb_spams'] += $nb_destinataires;                       
    284                             //--- Detection de spam ------------------
    285                                 if ($mails_donnees['nb_spams']==0) {$mails_donnees['date_spam'] = time();       }
    286 
    287                                 $trop_de_spam =!(strpos(strtolower($message), 'trop de spam') === false);
    288                                 if ( $trop_de_spam ) {
    289                                                 $mails_donnees['nb_spams_maxi']=$mails_donnees['nb_spams'];
    290 
    291                                                 $mails_donnees['date_quarantaine']= time()  ;   
    292                                                 $mails_donnees['quarantaine']= true    ;       
    293                                                 $infos_message .= mail_supervisor::Memo_Var($mails_donnees);
    294                                         }
    295                         }
     254    $string=array("&lt;","&gt;") ;
     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            }
    296297 $ret=true;
    297  return $ret ; 
     298 return $ret ;
    298299}
    299300?>
  • extensions/Mail_supervisor/maintain.inc.php

    r9702 r10419  
    2424if (!defined('MAIL_SUPERV_PATH')) define('MAIL_SUPERV_PATH' , PHPWG_PLUGINS_PATH.basename(dirname(__FILE__)).'/');
    2525 include_once (MAIL_SUPERV_PATH.'include/constants.php');
    26  
     26
    2727function plugin_install(){
    2828  global $conf ;
     
    3333    $my_para['check_header_text']="on";
    3434    $my_para['no_mail_list']="on";
    35     $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 
     35    $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
    3939    $mails_values=  addslashes(serialize($my_para));
    4040    $query = 'INSERT INTO '.CONFIG_TABLE.' (param, value, comment)
    4141    VALUES ("mail_superv", "'.$mails_values.'" ,"Parametres du plugin Mail superviseur");';
    4242    pwg_query($query);
    43   } 
     43  }
    4444}
    4545function plugin_uninstall(){
     
    5050    pwg_query($query);
    5151    $query = 'DROP TABLE IF EXISTS  '.MAIL_BLACK_LISTE_TABLE.';';
    52     pwg_query( $query ); 
     52    pwg_query( $query );
    5353    $query = 'DROP TABLE IF EXISTS  '.mail_superv_TABLE.';';
    54     pwg_query( $query); 
     54    pwg_query( $query);
    5555}
    5656
    5757function plugin_activate(){
    58 include_once (MAIL_SUPERV_PATH.'include/fonctions.php'); 
     58include_once (MAIL_SUPERV_PATH.'include/fonctions.php');
    5959 verif_base() ;
    6060}
Note: See TracChangeset for help on using the changeset viewer.