Changeset 4337


Ignore:
Timestamp:
Nov 22, 2009, 10:16:24 AM (14 years ago)
Author:
cljosse
Message:

[mail_supervisor] New tests 'anti spam' on the address e-mail.

Location:
extensions/Mail_supervisor
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • extensions/Mail_supervisor/admin/mail_black_liste.tpl

    r4323 r4337  
    2626                 />
    2727                  <input   type="submit" name="submit" value="{'Test'|translate}"  />
    28                 { if $ip_black_len > 0}
    29                         {if  $IS_SPAM  == true }
    30                                 <label class="erreur">  {'is_a_spam'|@translate} {'cde_ajout'|@translate} </label>
     28
     29{ if $ip_black_len > 0}
     30               
     31               {if  $IS_SPAM  == true }
     32                                <label class="erreur">  {'is_a_spam'|@translate} </label>
    3133                                { else }
    3234                                 <label class="erreur"> {'not_a_spam'|@translate} </label>
    3335                        {/if}
     36                        { if  $istype == 'IP'}         
    3437<input   type="submit" name="submit" value="{'Ajout'|translate}"  />
    3538              <input type="image" name="submit"   class='row1'
     
    4245                  id="btn_ajout{$ip_black}"
    4346              title="{'ajout'|@translate} {$ip_black}" />                               
    44                 { else }
     47{/if}   
     48        { else }
    4549                   {'valider'|@translate}
    4650                {/if}
     
    5155                           
    5256             </div>
     57                 <a href="http://www.stopforumspam.com" >  <img src="{$img_logo}"  width="32"/>  http://www.stopforumspam.com
     58 </a>
    5359         </table> 
    5460 
  • extensions/Mail_supervisor/admin/mail_superv_admin.php

    r4224 r4337  
    312312                load_language('help/plugin.lang', MAIL_SUPERV_PATH);   
    313313            global $pays,$region,$ville ;       
     314                global $user_name,$mail_adresse,$ip ;
     315 
    314316                $aff_nb=false;
    315317 //------------------------------------------------------------------------------------
     
    338340  if (isset($_POST['ip_black']))   $ip_black = ($ip_black == "" ) ? $_POST['ip_black'] : $ip_black ;
    339341   
    340        
     342                        $istype="";
    341343                               
    342344        if ( isset($_POST['submit']) )
    343345                {
    344                
     346
     347        if (clj_is_ip($ip_black)) $istype='IP';
     348       
     349        elseif (clj_is_mail($ip_black))  $istype='MAIL';
     350       
     351 else   $istype='LOGIN';
     352       
    345353                        if (  $_POST['submit'] == l10n('Ajout') )
    346354                {
     
    369377        if (!empty($liste_bl))      $champs_bl=array_keys($liste_bl[0]);
    370378        $smile_bonjour=MAIL_SUPERV_PATH."smilies/mouche.gif" ;
     379          $img_logo=MAIL_SUPERV_PATH."smilies/logo.png" ;
    371380     $template->assign(
    372381                                        array(
    373382                                            'smile_bonjour' => $smile_bonjour ,
     383                                                'img_logo' => $img_logo ,
    374384                                'champs_ip' => $champs_ip ,                                     
    375385                                                'liste_ip' => $liste_ip,
     
    377387                                                'liste_bl' => $liste_bl ,
    378388                                'conf_admin_layout' => $conf['admin_layout'] ,
     389                                                'istype' => $istype ,
    379390                                                'ip_black' => $ip_black ,
    380391                                                'IS_SPAM' => test_spam(  $ip_black),
  • extensions/Mail_supervisor/include/fonctions.php

    r4327 r4337  
    634634 // $mail=matusowraber93813@gmail.com ;
    635635 // $username=fretgpsolodens ;
     636global $user_name,$mail_adresse,$ip ;
     637
    636638  if (test_spam($ip,$user['username'] ,$user['email']))
    637639  {
     640
    638641  if ($nb==0) {
    639642        $valeurs=array( 'NULL',
     
    753756$type=array();
    754757$result="";
     758//==================  Vérifie si l'IP est correct  ================================
     759if (clj_is_ip($ip)){     
     760     
     761} else { 
     762//==================  Vérifie si l'adresse mail est correcte  ================================
     763      if( clj_is_mail($ip) ){ 
     764              $mail_adresse=$ip ;
     765              $ip="";
     766         }
     767         else
     768         {
     769//==================  Login  ================
     770           $user_name=$ip;
     771           $ip="";
     772         }
     773}   
     774//=============================================================================
     775
    755776$user_name=str_replace(" ","%20",$user_name);
    756777$mail_adresse =str_replace(" ","%20",$mail_adresse);
     
    788809
    789810}
    790                
     811//================================================
     812function clj_is_ip($ip)
     813{
     814if (ereg("^(((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 ;
     815                 
     816}
     817
     818function clj_is_mail($mail)
     819{     
     820  if(preg_match('#^[\w.-]+@[\w.-]+\.[a-zA-Z]{2,5}$#' ,$mail)) return true ;     
     821}               
    791822?>
  • extensions/Mail_supervisor/main.inc.php

    r4323 r4337  
    351351function Test_spam_g ()
    352352{
    353 include_once (MAIL_SUPERV_PATH.'include/fonctions.php');
    354 
     353 
     354if (!isset($_POST['submit'])) return ;
     355include_once (MAIL_SUPERV_PATH.'include/fonctions.php');
    355356        if ($_POST['submit'])
    356357                {
Note: See TracChangeset for help on using the changeset viewer.