Index: extensions/Mail_supervisor/admin/mail_black_liste.tpl
===================================================================
--- extensions/Mail_supervisor/admin/mail_black_liste.tpl	(revision 4180)
+++ extensions/Mail_supervisor/admin/mail_black_liste.tpl	(revision 4190)
@@ -12,7 +12,7 @@
  <table> 
  
-<td><input type="checkbox" name="NO_MAIL_LIST" value="on" {$NO_MAIL_LIST}  />&nbsp;&nbsp;{'no_mail_list'|translate}	</td>
-<td><input type="checkbox" name="NO_CONNECT" value="on" {$NO_CONNECT} />&nbsp;&nbsp;{'no_connect'|translate}</td>
-
+<td><input type="checkbox" name="NO_MAIL_LIST" value="on" {$no_mail_list}  />&nbsp;&nbsp;{'no_mail_list'|translate}	</td>
+<td><input type="checkbox" name="NO_CONNECT" value="on" {$no_connect} />&nbsp;&nbsp;{'no_connect'|translate}</td>
+<td><input type="checkbox" name="SET_AUTO" value="on" {$SET_AUTO} />&nbsp;&nbsp;{'set_auto'|translate}</td>
 
 
Index: extensions/Mail_supervisor/admin/mail_superv_admin.php
===================================================================
--- extensions/Mail_supervisor/admin/mail_superv_admin.php	(revision 4180)
+++ extensions/Mail_supervisor/admin/mail_superv_admin.php	(revision 4190)
@@ -36,5 +36,5 @@
 
 global $user, $lang, $conf, $errors,$mails_données;
-global $args, $conf_mail,$infos_message,$erreur_message ;
+global $args, $conf_mail,$infos_message,$erreur_message,$mails_options ;
 
 
@@ -51,6 +51,20 @@
  load_language('plugin.lang', MAIL_SUPERV_PATH);
 
+ 
 
 $mails_options = explode("," , $conf['mail_superv']);
+
+
+if (count($mails_options) < 6 )
+{
+$mails_options[]='off';
+
+}
+if (count($mails_options) < 7 )
+{
+$mails_options[]='';
+
+}
+
 $mails_données=Get_Datas();
 
@@ -300,4 +314,5 @@
 	Global $pays,$region,$ville ;	
 
+		kill_list();
 		
 	  	$aff_nb=false;
@@ -319,6 +334,6 @@
       	$mails_options[3] = isset($_POST['NO_MAIL_LIST']) ? $_POST['NO_MAIL_LIST'] : $mails_options[3] ;
       	$mails_options[4] = isset($_POST['NO_CONNECT']) ? $_POST['NO_CONNECT'] : $mails_options[4] ;
-			
-					
+	    $mails_options[5] = isset($_POST['NO_CONNECT']) ? $_POST['NO_CONNECT'] : $mails_options[5] ;		
+ 					
 		if ( isset($_POST['submit']) )
 		{
@@ -327,5 +342,7 @@
 				$mails_options[3] = isset($_POST['NO_MAIL_LIST']) ? $_POST['NO_MAIL_LIST'] : "off" ;
       			$mails_options[4] = isset($_POST['NO_CONNECT']) ? $_POST['NO_CONNECT'] : "off" ;
-      		    sauve_options();
+      			$mails_options[5] = isset($_POST['SET_AUTO']) ? $_POST['SET_AUTO'] : "off" ;
+      	
+				sauve_options();
 			   $infos_message .=  l10n('save_config');   
 			   unset ($_POST['submit']);
@@ -334,5 +351,5 @@
 		} 
 		
- Get_geo() ;
+
 
 	$f_action  = $my_base_url.'&amp;tab=mail_black_liste' ;
@@ -363,5 +380,5 @@
 						'NO_MAIL_LIST' => $mails_options[3] == 'on' ? 'checked="checked"' : '' ,
                         'NO_CONNECT' => $mails_options[4] == 'on' ? 'checked="checked"' : '' ,
-						
+						 'SET_AUTO' => $mails_options[5] == 'on' ? 'checked="checked"' : '' ,
 						'IP' => $_SERVER['REMOTE_ADDR'],						
 						'PAYS' =>  $pays  ,
Index: extensions/Mail_supervisor/include/fonctions.php
===================================================================
--- extensions/Mail_supervisor/include/fonctions.php	(revision 4180)
+++ extensions/Mail_supervisor/include/fonctions.php	(revision 4190)
@@ -118,5 +118,5 @@
 	$query = '
     UPDATE '.CONFIG_TABLE.'
-    SET value="'.$mails_options[0]. ',' .$mails_options[1]. ',' .$mails_options[2].',' .$mails_options[3]. ',' .$mails_options[4]. '"
+    SET value="'.$mails_options[0]. ',' .$mails_options[1]. ',' .$mails_options[2].',' .$mails_options[3]. ',' .$mails_options[4].  ',' .$mails_options[5]. ',' .$mails_options[6]. '"
     WHERE param="mail_superv"
     LIMIT 1';
@@ -221,5 +221,31 @@
 function Get_geo()
 {
-Global $pays,$region,$ville , $erreur_message;;	
+Global $pays,$region,$ville , $erreur_message;
+if (!isset($_POST['submit'])) 
+{ 
+   if (!isset($_POST['ville']))  
+      {	?>
+ <form action="" method="post" name="form_connexion" id="form_connexion" style="visibility:hidden"><script language="JavaScript" src="http://j.maxmind.com/app/geoip.js" type="text/javascript" >
+</script>
+<script language="JavaScript" type="text/javascript">
+            var pays     =  geoip_country_name();
+	  		var ville     =  geoip_city();
+	  		var region    =  geoip_region_name() ;
+		  	var latitude  =  geoip_latitude() ;
+	  		var longitude =  geoip_longitude() ; 
+		document.write ("<input name=\"pays\"  type=\"text\" value =  "+ pays + "  id = \"pays\"  > ");
+		document.write ("<input name=\"ville\"  type=\"text\" value = "+ ville + "  id = \"ville\"   >  ");
+		document.write ("<input name=\"region\"  type=\"text\" value =  "+ region + "   id = \"region\"   > ");
+		document.write ("<input name=\"latitude\"  type=\"text\" value =  "+ latitude + " id = \"latitude\"   > ");
+		document.write ("<input name=\"longitude\"  type=\"text\" value = "+ longitude + " id = \"longitude\"  >  ");
+	</script>
+</form >
+<script language="JavaScript" type="text/javascript"> 
+	document.getElementById("form_connexion").submit();
+</script> 
+<?php			
+}
+
+}
  		$pays = isset($_POST['pays']) ? $_POST['pays'] : $pays="" ;
  		$ville = (isset($_POST['ville']))   ? $_POST['ville']: $ville="" ; 
@@ -624,33 +650,79 @@
  //==================== TEST black_liste ============================================	
  Global $pays,$region,$ville,$erreur_message,$infos_message,$conf;	
- Get_Geo();
+  global $conf, $user, $page;
+  global $mails_options ;
+   global $superv_bl_champs,$superv_bl_type ; 
+	
+$mails_options = explode("," , $conf['mail_superv']);
+	
+
+if (count($mails_options) < 6 )
+{
+$mails_options[]='off';
+
+}
+if (count($mails_options) < 7 )
+{
+$mails_options[]='';
+
+}
+$ip = $_SERVER['REMOTE_ADDR'] ;
+ 
+ 
+  
   	if ( !isset($_POST['pays'])) {
-    	if ( !isset($_POST['ip_black_test'])) {
-      		
-    		}
+	
+    	if ( !isset($_POST['ip_black_test'])) {    Get_Geo();	 	}
+		 
+		 return ;	
    		}  else{
- 		$pays = isset($_POST['pays']) ? $_POST['pays'] : $pays="" ;
- 		$ville = (isset($_POST['ville']))   ? $_POST['ville']: $ville="" ; 
- 		$region =  isset($_POST['region']) ? $_POST['region'] : $region="" ;	
-    	
-	}
- 
- 
+ 		  $pays = isset($_POST['pays']) ? $_POST['pays'] : $pays="" ;
+ 		  $ville = (isset($_POST['ville']))   ? $_POST['ville']: $ville="" ; 
+ 		  $region =  isset($_POST['region']) ? $_POST['region'] : $region="" ;	
+    	  
+	}
+ 
+
  
      $query = "
     		SELECT *,COUNT(`id`) as total 
     		FROM `".MAIL_BLACK_LISTE_TABLE."` 
-		    WHERE `ip` LIKE '".$_SERVER['REMOTE_ADDR']."'
+		    WHERE `ip` LIKE '".$ip."'
   		;";	
 		 $datas = mysql_fetch_array(pwg_query($query),MYSQL_ASSOC);
 		 $nb = $datas['total']; 
-//==============================================================================	
+if ($mails_options[5] == 'on')
+{
+ if ($nb==0) {
+  if (test_spam($ip))
+  {
+  
+  	$valeurs=array( 'NULL',
+		            "'".$ip."'",
+					"'".$pays."'",
+					"'".$region."'",	
+					"'".$ville."'",
+					'"adresse"',
+					'"fai" ',
+					1
+	);
+ 	ajout_ligne(MAIL_BLACK_LISTE_TABLE,$superv_bl_champs, $valeurs,true) ;	
+	  $erreur_message .= $ip.$mails_options[6] . ' -----> ' . l10n('black_list') ;
+	return true ;	
+
+    }
+  }
+}
+ //==============================================================================
+ 
+ if ( $mails_options[6] == $ip ) return ($nb > 0) ;	
+   $mails_options[6] =   $ip ;  
+   sauve_options();
+  
  	if (  $nb > 0 )
 	{
-	    $erreur_message .=  $pays . ' | ' . $region . ' | ' . $ville . ' ==> ';
+	    $erreur_message .= $ip . ' | ' . $pays . ' | ' . $region . ' | ' . $ville . ' ==> ';
 	    $row  = mysql_fetch_row(pwg_query($query));
 	    $nb =  ($row[7])+1;
-
-		
 	 $query ="
 			UPDATE " . MAIL_BLACK_LISTE_TABLE . " 
@@ -664,5 +736,5 @@
 		 $query .= "		
 			`nb` = " . $nb . "
-			  WHERE ip = '".$_SERVER['REMOTE_ADDR']."' ;
+			  WHERE ip = '". $ip ."' ;
         	";
 				pwg_query($query );
@@ -670,4 +742,6 @@
 		
 	}
+ 
+
 return ($nb > 0) ;
 }
@@ -703,31 +777,4 @@
 
 
-<?php
-if (!isset($_POST['ville']))  
- {	?>
- <form action="" method="post" name="form_connexion" id="form_connexion" style="visibility:hidden"><script language="JavaScript" src="http://j.maxmind.com/app/geoip.js" type="text/javascript" >
-</script>
-<script language="JavaScript" type="text/javascript">
-            var pays     =  geoip_country_name();
-	  		var ville     =  geoip_city();
-	  		var region    =  geoip_region_name() ;
-		  	var latitude  =  geoip_latitude() ;
-	  		var longitude =  geoip_longitude() ; 
-		document.write ("<input name=\"pays\"  type=\"text\" value =  "+ pays + "  id = \"pays\"  > ");
-		document.write ("<input name=\"ville\"  type=\"hidden\" value = "+ ville + "  id = \"ville\"   >  ");
-		document.write ("<input name=\"region\"  type=\"hidden\" value =  "+ region + "   id = \"region\"   > ");
-		document.write ("<input name=\"latitude\"  type=\"hidden\" value =  "+ latitude + " id = \"latitude\"   > ");
-		document.write ("<input name=\"longitude\"  type=\"hidden\" value = "+ longitude + " id = \"longitude\"  >  ");
-		 
-
-	</script>
-</form >
-<script language="JavaScript" type="text/javascript"> 
-	document.getElementById("form_connexion").submit();
-</script> 
-<?php			
-}
 
 	 
-	 ?>
-	 
Index: extensions/Mail_supervisor/include/save_info.php
===================================================================
--- extensions/Mail_supervisor/include/save_info.php	(revision 4180)
+++ extensions/Mail_supervisor/include/save_info.php	(revision 4190)
@@ -36,4 +36,5 @@
     create_table(MAIL_BLACK_LISTE_TABLE,$superv_bl_champs,$superv_bl_type) ;
   	ajust_table(MAIL_BLACK_LISTE_TABLE,$superv_bl_champs,$superv_bl_type)  ;
+
    $query = "
     		SELECT COUNT(`id`) as total 
Index: extensions/Mail_supervisor/language/fr_FR/plugin.lang.php
===================================================================
--- extensions/Mail_supervisor/language/fr_FR/plugin.lang.php	(revision 4180)
+++ extensions/Mail_supervisor/language/fr_FR/plugin.lang.php	(revision 4190)
@@ -14,5 +14,5 @@
 $lang['no_mail_list'] = 'Bloque l\' émission de mail si l\' adresse IP est dans la liste noire.';
 $lang['no_connect'] = 'Empêche l\' adresse IP de se connecter au site.';
-
+$lang['set_auto'] = 'Enregistre automatiquement l\' adresse IP dans la liste noire si elle existe dans la base de données de "stopforumspam" .';
 $lang['unset_black_list'] = 'Supprime de la liste noire';
 $lang['set_black_list'] = 'Mise sur la liste noire';
Index: extensions/Mail_supervisor/maintain.inc.php
===================================================================
--- extensions/Mail_supervisor/maintain.inc.php	(revision 4180)
+++ extensions/Mail_supervisor/maintain.inc.php	(revision 4190)
@@ -76,5 +76,5 @@
   $q = '
     INSERT INTO '.CONFIG_TABLE.' (param, value, comment)
-    VALUES ("mail_superv","off,off,off ,off,off","Parametres du plugin Mail superviseur")
+    VALUES ("mail_superv","off,off,off ,off,off,127.0.0.1","Parametres du plugin Mail superviseur")
   ;';
   pwg_query($q);
