Ignore:
Timestamp:
Jan 26, 2011, 3:59:23 PM (13 years ago)
Author:
cljosse
Message:

[Mail_Supervisor] compatibility with piwigo 2.2

Location:
extensions/Mail_supervisor/include
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • extensions/Mail_supervisor/include/Scripts.js

    r5671 r8917  
    1 function blockToggleDisplay(headerId, contentId)
    2 {
     1function blockToggleDisplay(headerId, contentId){
    32        var revHeader = document.getElementById(headerId);
    43        var revContent = document.getElementById(contentId);
  • extensions/Mail_supervisor/include/fonctions.php

    r7050 r8917  
    2929if (!defined('MAIL_SUPERV_PATH')) define('MAIL_SUPERV_PATH' , PHPWG_PLUGINS_PATH.basename(dirname(__FILE__)).'/');
    3030
    31     define ("check_mailto", 0); define ("check_header_carbon",1); define ("check_header_text",2);
    32     define ("no_mail_list", 3); define ("no_connect",4); define ("set_auto",5);
    33     define ("ip",6); define ("set_id",7);
     31    define ("check_mailto", 0);
     32        define ("check_header_carbon",1);
     33        define ("check_header_text",2);
     34    define ("no_mail_list", 3);
     35        define ("no_connect",4);        // empeche l'ip de se connecter au site.
     36        define ("set_auto",5);          // Test a l'ouverture et enregistrement
     37    define ("ip",6);                    // dernirre adresse IP
     38        define ("set_id",7);            // enregistrment nouvel
    3439 
    3540 
     
    288293//===============================================
    289294
    290 function corrige_header($Carbonne,$headers,$args)
     295function corrige_header($Carbonne,$headers,$args,$cl_list_mail)
    291296        {
    292297        global $mails_options,$conf_mail,$mailto,$infos_message;
     
    294299 if (!empty($args[$Carbonne]))
    295300         {
    296  
    297                 if ( count($args[$Carbonne]) > 0 )
     301                if ( count($args[$Carbonne]) > 0 )
    298302                {
    299                  if ($mails_options[check_header_carbon] == 'on') {
    300                         $list_mail  = str_replace(","," ,",get_strict_email_list(implode(',', $args[$Carbonne])))." \n" ;
    301                         $headers = preg_replace('/.*'.$Carbonne.'(.*).\n/i', $Carbonne.': '.$list_mail, $headers);
    302                  }
     303                        if ($mails_options[check_header_carbon] == 'on') {
     304                                        $cl_list_mail  =  str_replace(","," , ",get_strict_email_list(implode(',', $args[$Carbonne])))." \n" ;
     305                                        $headers = preg_replace('/.*'.$Carbonne.'(.*).\n/i', $Carbonne.': '.$cl_list_mail, $headers);
     306                                }
    303307                }
     308       
    304309        } else {
    305         // Raz Bcc, Cc dans headers
     310             // Raz Bcc, Cc dans headers
    306311                        $headers = preg_replace('/.*'.$Carbonne.'(.*).\n/i', "" , $headers);
    307312        }
    308313               
    309                
    310 return $headers;
     314                $headers  = str_replace("\n.", "\n..",$headers );
     315        $ret->headers = $headers ;
     316        $ret->list_mail = $cl_list_mail ;
     317        return $ret;
    311318
    312319               
     
    433440                u.'.$conf['user_fields']['email'].' AS email,
    434441                ui.status,
    435                 ui.adviser,
    436442                ui.enabled_high,
    437443                ui.level
     
    765771//=======================================================================       
    766772
    767 if ($mails_options[set_auto] == 'on')
     773if ($mails_options[set_auto] == 'nonoui') // ne plus tester automatiquement .
    768774{
    769775 // $ip="94.102.63.13"; ' Spammeurs
     
    887893function test_spam($ip =0,$user_name ='', $mail_adresse = "")
    888894{
    889 $buffer="";
     895        $buffer="";
     896        global $page,$infos_message;
    890897
    891898// fretgpsolodens
    892 $src = "" ;// "http://www.stopforumspam.com/api?";
    893 $type=array();
    894 $result="";
     899        $src = "http://www.stopforumspam.com/api?";
     900        $type=array();
     901        $result="";
    895902if (strlen($ip)>3) {
    896903//==================  Verifie si l'IP est correct  ================================
    897904if (clj_is_ip($ip)){     
    898       
     905     
    899906} else { 
    900907//==================  Verifie si l'adresse mail est correcte  ================================
    901908      if( clj_is_mail($ip) ){ 
    902               $mail_adresse=$ip ;
     909                          $mail_adresse=$ip ;
    903910              $ip="";
    904911         }
     
    921928if ( strlen($mail_adresse) > 3)   $type[]="email=".$mail_adresse ;
    922929if ( strlen($ip) > 3)   $type[]="ip=".$ip ;
    923  
     930
    924931         foreach  ( $type as $fil )
    925932     {   
    926            $resultat="";
     933          $resultat="";
    927934           if (  clj_fetchRemote($src.$fil , $resultat,1))
    928935                  {
    929                   $result .= $resultat.'<br />'  ;
     936                    $result .= $resultat.'<br />'  ;
    930937                  }  else {
    931938                 
    932939                  }
     940                 
    933941      }
    934942
     
    960968function clj_is_mail($mail)
    961969{     
     970
     971 if(preg_match('/^[\w.-]+@[\w.-]+\.[a-zA-Z]{2,5}$/' ,$mail)) return true ;     
    962972  if(preg_match('/#^[\w.-]+@[\w.-]+\.[a-zA-Z]{2,5}$#/' ,$mail)) return true ;   
    963973}         
     
    967977{
    968978  // Try to retrieve data from local file?
     979 // http://www.stopforumspam.com/api?ip=95.211.1.39
     980
     981  if ($src=="") return ;
     982 
    969983  if (!url_is_remote($src))
    970984  {
     985 
    971986    $content = @file_get_contents($src);
    972987    if ($content !== false)
     
    980995    }
    981996  }
    982 
     997 
    983998  // After 3 redirections, return false
    984999  if ($step > 3) return false;
     
    10721087
    10731088  }
     1089
     1090
     1091
    10741092?>
  • extensions/Mail_supervisor/include/function_test_send.php

    r7050 r8917  
    226226}
    227227
     228
    228229?>
Note: See TracChangeset for help on using the changeset viewer.