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

[extensions] mail_supervisor fix bug in design

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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 }
Note: See TracChangeset for help on using the changeset viewer.