Changeset 10419 for extensions/Mail_supervisor/mail_super.inc.php
- Timestamp:
- Apr 16, 2011, 3:53:31 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/Mail_supervisor/mail_super.inc.php
r10385 r10419 39 39 */ 40 40 static public function init() { 41 global $template,$version,$icon_path; 41 global $template,$version,$icon_path; 42 42 $action_spam = pwg_get_session_var('action_spam') ; 43 43 $theme="default"; … … 48 48 if (PHPWG_VERSION < 2.2 ) { 49 49 $file =MAIL_SUPERV_PATH_ABS.'admin/header_2_1.tpl' ; 50 50 51 51 } else { 52 52 $file = MAIL_SUPERV_PATH_ABS.'admin/header_2_2.tpl' ; 53 53 54 54 } 55 55 if(isset($_GET['action_spam']) and $_GET['action_spam']=="no"){ … … 62 62 $profile=array('theme' => $theme, 63 63 '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 66 66 ); 67 67 … … 86 86 $ip=getenv("REMOTE_ADDR"); 87 87 } 88 } 88 } 89 89 // unset ($_SESSION['pwg_'.'action_spam']); 90 90 $action_spam = pwg_get_session_var('action_spam') ; 91 91 92 92 if ($action_spam == null or $action_spam == 'false') { 93 93 $action_spam = kill_list(); 94 94 } 95 95 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" ; 97 97 if ($action_spam == "true" ) { 98 98 $erreur_message .= $ip . " " . $action_spam ; … … 122 122 else $page['infos']=Array($infos_message); 123 123 $infos_message=""; 124 } 124 } 125 125 if (isset($erreur_message)) 126 126 if ($erreur_message != "") { … … 130 130 else $page['errors']=Array($erreur_message); 131 131 $erreur_message =""; 132 } 132 } 133 133 return $action_spam; 134 134 } //fin Affiche_message … … 140 140 static public function Get_geo() { 141 141 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'); 144 144 if (count($info_geo) > 0){ 145 145 $pays = $info_geo[0]; … … 177 177 if(count($variables)>1){ 178 178 foreach($variables as $key => $line){ 179 echo $key . " => " . $line ; 179 echo $key . " => " . $line ; 180 180 echo "<br />"; 181 } 181 } 182 182 }else{ 183 183 echo "<i>".$variables."</i><br />"; … … 233 233 global $conf,$mails_options ; 234 234 $mails_options= $conf[$str_index]; 235 235 236 236 if(isset($mails_options)) 237 237 if ( preg_match("|s:(.*)|", $mails_options, $val) ) … … 239 239 else{ 240 240 $parametres=explode(",",$mails_options); 241 241 242 242 $def_para->check_mailto="on"; 243 243 $def_para->check_header_carbon="on"; 244 244 $def_para->check_header_text="on"; 245 245 $def_para->no_mail_list="on"; 246 $def_para->no_connect="on"; 247 $def_para->set_auto="on"; // Test a l'ouverture et enregistrement248 $def_para->ip="127.0.0.1"; 249 $def_para->set_id="on"; // enregistrment nouvel246 $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 250 250 $i=0; 251 251 foreach ($def_para as $key => $value) { 252 252 $value=$parametres[$i]; 253 253 unset( $parametres[$i]) ; 254 $parametres[$key]= $value ; 254 $parametres[$key]= $value ; 255 255 $i++; 256 256 } 257 257 } 258 258 return mail_supervisor::Set_Options($parametres,$str_index); 259 } 259 } 260 260 //========================================================== 261 function Set_Options($parametres,$str_index){ 261 function Set_Options($parametres,$str_index){ 262 262 global $infos_message,$conf; 263 foreach ($parametres as $key => $value) { 263 foreach ($parametres as $key => $value) { 264 264 $parametres[$key]=(isset($_POST[$key]))? "on" : $value ; 265 265 } 266 $parametres['no_connect']= 'off' ; 266 $parametres['no_connect']= 'off' ; 267 267 return $parametres ; 268 268 } … … 274 274 275 275 if ( isset($mails_parametres) ) 276 {$query = '277 278 279 280 281 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 284 284 } 285 285 … … 287 287 function sauve_donnees(){ 288 288 global $mails_donnees,$superv_champs,$superv_type,$erreur_message ; 289 //===================================================================== 289 //===================================================================== 290 290 $clefs = $superv_champs ; 291 291 $valeurs = array(); 292 292 foreach ( $clefs as $champ){ 293 $champ = trim($champ); 294 295 293 $champ = trim($champ); 294 if ( isset($mails_donnees[ $champ ]) ) { 295 $sep= (is_string($mails_donnees[ $champ ])) ? '"' : '' ; 296 296 array_push($valeurs , "`".$champ."`" . ' = ' . $sep . $mails_donnees[ $champ ] . $sep) ; 297 }else{ 298 299 } 297 }else{ 298 array_push($valeurs , "`".$champ."`" . ' = ' . "0" ) ; 299 } 300 300 } 301 301 $valeurs = implode(", ",$valeurs) ; … … 304 304 UPDATE '.mail_superv_TABLE.' 305 305 SET '. $valeurs .' 306 307 306 WHERE `id` = 1 LIMIT 1 '; 307 ; 308 308 ob_start(); 309 309 $ret= pwg_query($query) ; … … 316 316 global $superv_champs ; 317 317 $champs = implode(",",$superv_champs ); 318 $query = "SELECT ".$champs." 318 $query = "SELECT ".$champs." 319 319 FROM ".mail_superv_TABLE." 320 320 ;"; 321 $result = @pwg_query($query); 321 $result = @pwg_query($query); 322 322 if (!$result) { 323 324 325 } 323 verif_base(); 324 $result = @pwg_query($query); 325 } 326 326 $data = mysql_fetch_array($result,MYSQL_ASSOC); 327 327 //==================================================================================== 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()) ; 330 330 $data['rest_mail'] = $next_day - time() ; 331 331 $next_day = Str_To_Time( $data['nb_spams_periode'],$data['date_spam']); 332 332 $next_day = ($next_day >0) ? $next_day : (172800 + time()) ; 333 333 $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']); 335 335 $next_day = ($next_day >0) ? $next_day : (172800 + time()) ; 336 336 337 337 if ($data['quarantaine'] == 'true' ) { 338 338 $data['reste'] = ( $next_day )-time() ; 339 339 }else{ 340 341 } 342 343 340 $data['reste'] = 0; 341 } 342 343 return $data; 344 344 } 345 345 }
Note: See TracChangeset
for help on using the changeset viewer.