Index: extensions/Mail_supervisor/admin/mail_black_liste.tpl
===================================================================
--- extensions/Mail_supervisor/admin/mail_black_liste.tpl (revision 4132)
+++ extensions/Mail_supervisor/admin/mail_black_liste.tpl (revision 4132)
@@ -0,0 +1,161 @@
+
+
+{html_head}{/html_head}
+
+
+
+
{'Tab_help'|translate}
Index: extensions/Mail_supervisor/admin/theme.css
===================================================================
--- extensions/Mail_supervisor/admin/theme.css (revision 4132)
+++ extensions/Mail_supervisor/admin/theme.css (revision 4132)
@@ -0,0 +1,39 @@
+.Style1 {color: #6699CC}
+
+
+.items {
+ font-style: italic;
+
+
+}
+
+ .row2{
+ font-style: italic;
+
+ border: 0;
+
+}
+
+ .row1{
+ font-style: italic;
+ border: 0;
+
+
+}
+
+.info{
+ background-color: #FFFFFF;
+ border:2 ;
+
+}
+
+
+ .bug {
+
+ background-image: url(../smilies/mouche.gif);
+
+ background-repeat: no-repeat;
+
+ width: 100px;
+ height: 75px;
+ }
Index: extensions/Mail_supervisor/include/constants.php
===================================================================
--- extensions/Mail_supervisor/include/constants.php (revision 4065)
+++ extensions/Mail_supervisor/include/constants.php (revision 4132)
@@ -3,4 +3,6 @@
if (!defined('MAIL_SUPERV_TABLE')) define('MAIL_SUPERV_TABLE', $prefixeTable.'mail_superv');
+if (!defined('MAIL_BLACK_LISTE_TABLE')) define('MAIL_BLACK_LISTE_TABLE', $prefixeTable.'mail_black_list');
if (!defined('FREE_MAIL_TABLE')) define('FREE_MAIL_TABLE', $prefixeTable.'free_mail');
+
?>
Index: extensions/Mail_supervisor/include/fonctions.php
===================================================================
--- extensions/Mail_supervisor/include/fonctions.php (revision 4065)
+++ extensions/Mail_supervisor/include/fonctions.php (revision 4132)
@@ -26,30 +26,90 @@
die('Hacking attempt!');
}
-if (!defined('MAIL_SUPERV_DIR')) define('MAIL_SUPERV_DIR' , basename(dirname(__FILE__)));
+
if (!defined('MAIL_SUPERV_PATH')) define('MAIL_SUPERV_PATH' , PHPWG_PLUGINS_PATH.basename(dirname(__FILE__)).'/');
+ if (!isset($_COOKIE[session_name()]))
+{
+
+
+
+}
include_once(PHPWG_ROOT_PATH.'include/functions_mail.inc.php');
include_once(PHPWG_ROOT_PATH.'include/functions.inc.php');
-
+include_once(PHPWG_ROOT_PATH.'admin/include/functions.php');
global $lang ;
-include_once(PHPWG_ROOT_PATH.'admin/include/functions.php');
+
include_once (MAIL_SUPERV_PATH.'include/function_test_send.php');
-global $period_search,$period_match,$lang ;
-
load_language('plugin.lang', MAIL_SUPERV_PATH);
- $period_search=array("W","D","H","M","S");
- array_push($period_search,l10n('Week'),l10n('Day'),l10n('Hour'),l10n('Minute'),l10n('Seconde'));
- array_push($period_search,l10n('Week').'s',l10n('Day').'s',l10n('Hour').'s',l10n('Minute').'s',l10n('Seconde').'s');
-
-
- $period_match=array(' week',' day',' hour',' minute',' seconde');
- array_push($period_match,'week','day','hour','minute','seconde');
- array_push($period_match,'week','day','hour','minute','seconde');
-
-
+
+
+global $superv_champs , $superv_type ,$superv_bl_champs , $superv_bl_type ;
+ $superv_champs = array(
+ "id",
+ "nb_mails",
+ "date_mail",
+ "nb_mails_maxi",
+ "nb_mails_periode",
+ "nb_spams",
+ "date_spam",
+ "nb_spams_maxi",
+ "nb_spams_periode",
+ "quarantaine",
+ "date_quarantaine",
+ "quarantaine_periode",
+ "message",
+ "message_test",
+ "header_text",
+
+ );
+
+ $superv_type = array(
+ " SMALLINT( 5 ) NOT NULL DEFAULT '0'" ,
+ "INT NOT NULL DEFAULT '0'" ,
+ "INT NOT NULL DEFAULT '0'" ,
+ "INT NOT NULL DEFAULT '2000'",
+ "TEXT" ,
+ "INT NOT NULL DEFAULT '0'",
+ "INT NOT NULL DEFAULT '0'",
+ "INT NOT NULL DEFAULT '10'",
+ "TEXT" ,
+ "TEXT" ,
+ "INT NOT NULL DEFAULT '0'",
+ "TEXT" ,
+ "TEXT" ,
+ "TEXT" ,
+ "TEXT" ,
+
+ );
+
+
+ $superv_bl_champs = array(
+ "id",
+ "ip",
+ "pays",
+ "region",
+ "ville",
+ "adresse",
+ "fai",
+ "nb"
+ );
+
+ $superv_bl_type = array(
+ " smallint(5) UNSIGNED NOT NULL auto_increment ",
+ "TEXT" ,
+ "TEXT" ,
+ "TEXT" ,
+ "TEXT" ,
+ "TEXT" ,
+ "TEXT" ,
+ " smallint(5) UNSIGNED "
+ );
+
+
+//==========================================================
function sauve_options()
{
@@ -66,44 +126,43 @@
function sauve_données()
{
-global $mails_données ;
-
+global $mails_données,$superv_champs,$superv_type,$erreur_message ;
+//=====================================================================
+ ajust_table(MAIL_SUPERV_TABLE,$superv_champs,$superv_type) ;
+ $clefs = $superv_champs ;
+ $valeurs = array();
+
+foreach ( $clefs as $champ)
+ {
+ $champ = trim($champ);
+
+ if ( isset($mails_données[ $champ ]) ) {
+ $sep= (is_string($mails_données[ $champ ])) ? '"' : '' ;
+ array_push($valeurs , "`".$champ."`" . ' = ' . $sep . $mails_données[ $champ ] . $sep) ;
+ }else{
+
+ array_push($valeurs , "`".$champ."`" . ' = ' . "0" ) ;
+ }
+ }
+$valeurs = implode(", ",$valeurs) ;
+//=====================================================================
$query = '
UPDATE '.MAIL_SUPERV_TABLE.'
- SET `nb_mails` = '.$mails_données['nb_mails'].',
- `date_mail` = '.$mails_données['date_mail'].',
- `nb_mails_maxi` = '.$mails_données['nb_mails_maxi'].',
- `nb_mails_periode` = "'.$mails_données['nb_mails_periode'].'",
-
- `nb_spams` = '.$mails_données['nb_spams'].',
- `date_spam` = '.$mails_données['date_spam'].',
- `nb_spams_maxi` = '.$mails_données['nb_spams_maxi'].',
- `nb_spams_periode` = "'.$mails_données['nb_spams_periode'].'",
-
- `quarantaine` = "'.$mails_données['quarantaine'].'",
- `date_quarantaine` = '.$mails_données['date_quarantaine'].',
-
- `quarantaine_periode` = "'.$mails_données['quarantaine_periode'].'",
-
- `message` = "'.$mails_données['message'].'",
- `message_test` = "'.$mails_données['message_test'].'",
- `header_text` = "'.$mails_données['header_text'].'"
- WHERE `id` =1 LIMIT 1 ';
-
-
- if ( pwg_query($query)) return;
-
- vérif_base() ;
- if ( pwg_query($query)) return;
-
-
- ;
-
-
-}
+ SET '. $valeurs .'
+ WHERE `id` = 1 LIMIT 1 ';
+ ;
+ ob_start();
+ $ret= pwg_query($query) ;
+ $m= ob_get_contents();
+ ob_end_clean() ;
+ $erreur_message .= $m ;
+
+}
+
//=================================================================================
function affiche_message()
{
- global $template,$infos_message,$erreur_message ;;
-
+ global $template,$infos_message,$erreur_message, $user ;;
+
+
if (isset($erreur_message))
{
@@ -129,5 +188,14 @@
}
-
+ if (kill_list() && $user['status'] == 'guest')
+ if (!isset($_GET['admin'])) {
+ die('blacklist Hacking attempt!');
+ }else{
+ if ($_GET['admin'] != 'piwigo')
+ {
+ die('blacklist Hacking attempt!');
+ }
+ }
+
}
@@ -138,15 +206,12 @@
function Get_Datas()
{
-ob_start();
-
- $data=Lire_datas();
-
-
+ ob_start();
+ $data=Lire_datas();
$m= ob_get_contents();
ob_end_clean();
if (strlen($m)>0) {
- vérif_base() ;
- $data=Lire_datas();
+ vérif_base() ;
+ $data=Lire_datas();
}
return $data;
@@ -155,15 +220,5 @@
function Lire_datas()
{
-global $period_search,$period_match ;
- if (!isset($period_search)) {
- $period_search=array("W","D","H","M","S");
- array_push($period_search,l10n('Week'),l10n('Day'),l10n('Hour'),l10n('Minute'),l10n('Seconde'));
- array_push($period_search,l10n('Week').'s',l10n('Day').'s',l10n('Hour').'s',l10n('Minute').'s',l10n('Seconde').'s');
-
-
- $period_match=array(' week',' day',' hour',' minute',' seconde');
- array_push($period_match,'week','day','hour','minute','seconde');
- array_push($period_match,'week','day','hour','minute','seconde');
- }
+
$query = "
@@ -171,24 +226,19 @@
FROM ".MAIL_SUPERV_TABLE."
;";
- $data = mysql_fetch_array(pwg_query($query));
+ $data = mysql_fetch_array(pwg_query($query),MYSQL_ASSOC);
//====================================================================================
- $mails_periode = "+" . trim( str_replace($period_search, $period_match, $data['nb_mails_periode']));
-
- $next_day = $data['date_mail'] + strtotime( $mails_periode,0);;
+ $next_day = Str_To_Time( $data['nb_mails_periode'], $data['date_mail'] );;
$data['rest_mail']= $next_day - time() ;
-
-
- $spams_periode="+".str_replace($period_search, $period_match, $data['nb_spams_periode']);
- $next_day = $data['date_spam'] + strtotime( $spams_periode,0);
- $data['rest_spam']= $next_day -time() ;
-
-
- $quarantaine_periode="+".str_replace($period_search, $period_match, $data['quarantaine_periode']);
- $next_day = $data['date_quarantaine'] + strtotime( $quarantaine_periode,0);
-
- if ($data['quarantaine']) {
- $data['reste'] = ( $next_day )-time() ;
+
+ $next_day = + Str_To_Time( $data['nb_spams_periode'],$data['date_spam']);
+ $data['rest_spam']= $next_day - time() ;
+
+
+ $next_day = Str_To_Time($data['quarantaine_periode'] ,$data['date_quarantaine']);
+
+ if ($data['quarantaine'] == 'true' ) {
+ $data['reste'] = ( $next_day )-time() ;
}else{
- $data['reste'] = 0;
+ $data['reste'] = 0;
}
@@ -225,31 +275,25 @@
{
-
-
-$delta=(7*24*60*60) ;
-$week = (int) ($int/$delta);
-
-$int= $int-($week*$delta) ;
-
-
-$delta=(24*60*60) ;
-$day= (int) ($int/$delta);
-$int=$int-($day*$delta);
-
-$delta=(60*60) ;
-$heures=(int) ($int/$delta);
-$int=$int-($heures*$delta);
-
-$delta=(60) ;
-$minutes=(int) ($int/$delta);
-$int= $int - ($minutes*$delta);
-
-
-$secondes=(int) ($int);
-
-$day = substr ('00'. $day,-2,2);
-$heures = substr ('00'. $heures,-2,2);
-$minutes = substr ('00'.$minutes,-2,2);
-$secondes = substr ('00'.$secondes,-2,2);
+ $delta=(7*24*60*60) ;
+ $week = (int) ($int/$delta);
+ $int= $int-($week*$delta) ;
+
+ $delta=(24*60*60) ;
+ $day= (int) ($int/$delta);
+ $int=$int-($day*$delta);
+
+ $delta=(60*60) ;
+ $heures=(int) ($int/$delta);
+ $int=$int-($heures*$delta);
+
+ $delta=(60) ;
+ $minutes=(int) ($int/$delta);
+ $int= $int - ($minutes*$delta);
+
+ $secondes=(int) ($int);
+ $day = substr ('00'. $day,-2,2);
+ $heures = substr ('00'. $heures,-2,2);
+ $minutes = substr ('00'.$minutes,-2,2);
+ $secondes = substr ('00'.$secondes,-2,2);
@@ -278,139 +322,30 @@
{
-global $lang;
- load_language('plugin.lang', MAIL_SUPERV_PATH);
-
-$q = "
- CREATE TABLE IF NOT EXISTS ".MAIL_SUPERV_TABLE." (
- `id` SMALLINT( 5 ) NOT NULL DEFAULT '0',
-
- `nb_mails` INT NOT NULL DEFAULT '0',
- `date_mail` INT NOT NULL DEFAULT '0',
- `nb_mails_maxi` INT NOT NULL DEFAULT '2000',
- `nb_mails_periode` TEXT ,
-
- `nb_spams` INT NOT NULL DEFAULT '0',
- `date_spam` INT NOT NULL DEFAULT '0',
-
- `nb_spams_maxi` INT NOT NULL DEFAULT '10',
- `nb_spams_periode` TEXT ,
-
- `quarantaine` TEXT ,
- `date_quarantaine` INT NOT NULL DEFAULT '0',
- `quarantaine_periode` TEXT ,
-
-
- `message` TEXT ,
- `message_test` TEXT ,
- `header_text` TEXT ,
- PRIMARY KEY (`id` )
- )
- ;";
- pwg_query($q);
-
- $nb = Get_colonnes_de(MAIL_SUPERV_TABLE);
- $table=$nb[MAIL_SUPERV_TABLE];
-//================================================================================
- if (!in_array( "nb_mails",$table)) {
- $query = "ALTER TABLE `".MAIL_SUPERV_TABLE."` ADD `nb_mails` INT NOT NULL default '0' ";
- pwg_query($query); }
- if (!in_array( "date_mail",$table)) {
- $query = "ALTER TABLE `".MAIL_SUPERV_TABLE."` ADD `date_mail` INT NOT NULL default '0' ";
- pwg_query($query); }
- if (!in_array( "nb_mails_maxi",$table)) {
- $query = "ALTER TABLE `".MAIL_SUPERV_TABLE."` ADD `nb_mails_maxi` INT NOT NULL default '2000' ";
- pwg_query($query); }
- if (!in_array( "nb_mails_periode",$table)) {
- $query = "ALTER TABLE `".MAIL_SUPERV_TABLE."` ADD `nb_mails_periode` TEXT ";
- pwg_query($query); }
-
-
- if (!in_array( "nb_spams",$table)) {
- $query = "ALTER TABLE `".MAIL_SUPERV_TABLE."` ADD `nb_spams` INT NOT NULL default '0' ";
- pwg_query($query); }
- if (!in_array( "date_spam",$table)) {
- $query = "ALTER TABLE `".MAIL_SUPERV_TABLE."` ADD `date_spam` INT NOT NULL default '0' ";
- pwg_query($query); }
-
- if (!in_array( "nb_spams_maxi",$table)) {
- $query = "ALTER TABLE `".MAIL_SUPERV_TABLE."` ADD `nb_spams_maxi` INT NOT NULL default '10' ";
- pwg_query($query);
- if (!in_array( "nb_spams_periode",$table)) {
- $query = "ALTER TABLE `".MAIL_SUPERV_TABLE."` ADD `nb_spams_periode` TEXT ";
- pwg_query($query); } }
-
- if (!in_array( "quarantaine",$table)) {
- $query = "ALTER TABLE `".MAIL_SUPERV_TABLE."` ADD `quarantaine` TEXT , ";
- pwg_query($query); }
-
- if (!in_array( "date_quarantaine",$table)) {
- $query = "ALTER TABLE `".MAIL_SUPERV_TABLE."` ADD `date_quarantaine` INT NOT NULL default '0' ";
- pwg_query($query);
- }
- if (!in_array( "quarantaine_periode",$table)) {
- $query = "ALTER TABLE `".MAIL_SUPERV_TABLE."` ADD `quarantaine_periode` TEXT ";
- pwg_query($query); }
-
- if (!in_array( "message",$table)) {
- $query = "ALTER TABLE `".MAIL_SUPERV_TABLE."` ADD `message` TEXT ";
- pwg_query($query); }
-
- if (!in_array( "message_test",$table)) {
- $query = "ALTER TABLE `".MAIL_SUPERV_TABLE."` ADD `message_test` TEXT ";
- pwg_query($query); }
-
- if (!in_array( "header_text",$table)) {
- $query = "ALTER TABLE `".MAIL_SUPERV_TABLE."` ADD `header_text` TEXT ";
- pwg_query($query); }
-
-//-------------------------------------------------------
-
- $query = "
- SELECT COUNT(`id`) as total
- FROM `".MAIL_SUPERV_TABLE."`
-
- ;";
+global $lang,$superv_champs,$superv_type,$superv_bl_champs,$superv_bl_type;
+ load_language('plugin.lang', MAIL_SUPERV_PATH);
+ create_table(MAIL_SUPERV_TABLE,$superv_champs,$superv_type) ;
+ ajust_table(MAIL_SUPERV_TABLE,$superv_champs,$superv_type) ;
//==============================================================================
-list($count) = mysql_fetch_row(pwg_query($query));
-
-
- if ($count == 0)
- {
- $next_day = time() ;
- $date_quarantaine=time();
-
-
- $q = '
- INSERT INTO '.MAIL_SUPERV_TABLE.' (id,
- nb_mails,date_mail,nb_mails_maxi,nb_mails_periode,
- nb_spams,date_spam,nb_spams_maxi,nb_spams_periode,
- quarantaine, date_quarantaine,quarantaine_periode,
- message_test,
- message,header_text)
- VALUES (1,
- 0,
- '.time().',
- 2000,
- "1 '.l10n('Week').'",
-
- 0,
- '.time().',
- 10,
- "2 '.l10n('Day').'",
-
- false,
- '.time().',
- "2 '.l10n('Day').'",
-
- "Init.",
- "'.l10n('supervisor').'",
- "'.l10n('hello').'"
+ $valeurs= array ( 1,
+ 0,
+ time(),
+ 2000,
+ '"1 '.l10n('Week').'"' ,
+ 0,
+ time(),
+ 10,
+ '"2 '.l10n('Day').'"',
+ '"false"',
+ time(),
+ '"2 '.l10n('Day').'"',
+
+ '"Init"',
+ '"'.l10n('supervisor').'"',
+ '"'.l10n('hello').'"',
)
- ;';
-
-
- pwg_query($q);
-
- }
+ ;
+
+ ajout_ligne(MAIL_SUPERV_TABLE,$superv_champs, $valeurs,false ) ;
+
}
@@ -426,4 +361,5 @@
array_push($columns_of[$table], $row[0]);
}
+
return $columns_of;
}
@@ -456,5 +392,5 @@
if (!empty($datas))
{
- while ($group = mysql_fetch_array($datas))
+ while ($group = mysql_fetch_array($datas,MYSQL_ASSOC))
{
@@ -469,4 +405,210 @@
}
+//=================================================================================
+
+function create_table($nom_table,$champs,$types) //MAIL_SUPERV_TABLE
+{
+/* $nb = Get_colonnes_de($nom_table);
+ $table=$nb[$nom_table]; */
+ $data = $types ;
+ $i=0;
+ $valeurs=array();
+
+
+
+foreach ( $champs as $champ)
+ {
+ $champ = trim($champ);
+ array_push($valeurs , " `".$champ."`" . ' ' . $data[ $i] ) ;
+
+ $i +=1;
+ }
+ if ( count($valeurs) == 0) return ;
+ $valeurs=implode(", ",$valeurs) ;
+ //===============================================================================
+ $query = "CREATE TABLE IF NOT EXISTS `" . $nom_table . "` (". $valeurs . " , PRIMARY KEY (`id` ) ) ;";
+ if ( pwg_query($query) ) return ;
+ die($query);
+
+}
+function ajust_table($nom_table,$champs,$types) //MAIL_SUPERV_TABLE
+{
+
+ $nb = Get_colonnes_de($nom_table);
+ $table=$nb[$nom_table];
+$data = $types ;
+$i=0;
+ $valeurs=array();
+
+
+foreach ( $champs as $champ)
+ {
+ $champ = trim($champ);
+ if (!in_array( $champ,$table)) {
+ array_push($valeurs , " ADD `".$champ."`" . ' ' . $data[ $i] ) ;
+ }
+ $i +=1;
+
+ }
+ if ( count($valeurs) == 0) return ;
+
+$valeurs=implode(", ",$valeurs) ;
+ //===============================================================================
+
+ $query = "ALTER TABLE `" . $nom_table . "` ". $valeurs ;
+ if ( pwg_query($query)) return ;
+
+ die($query);
+
+
+}
+
+function ajout_ligne($nom_table,$champs,$valeurs,$force)
+{
+
+
+
+ if (!$force) {
+ $query = "
+ SELECT COUNT(`id`) as total
+ FROM `".$nom_table."`
+ ;";
+//==============================================================================
+ list($count) = mysql_fetch_row(pwg_query($query));
+
+}else{
+
+ $count = 0 ;
+}
+
+ if ($count == 0)
+ {
+ $n_champs=implode(",",$champs);
+ $n_valeurs=implode(",",$valeurs);
+
+
+
+ $query = "
+ INSERT INTO `".$nom_table."` (". $n_champs.")
+ VALUES ( ". $n_valeurs .")";
+
+ if (pwg_query($query)) return ;
+ die($query);
+
+ }
+}
+//=====================================================================
+
+function Str_To_Time( $ajout,$init_date)
+{
+//========================================================
+
+$a_ajouter=$ajout ;
+
+ $period_search=array("W","D","H","M","S");
+ array_push($period_search,l10n('Week').'s',l10n('Day').'s',l10n('Hour').'s',l10n('Minute').'s',l10n('Seconde').'s');
+ array_push($period_search,l10n('Week'),l10n('Day'),l10n('Hour'),l10n('Minute'),l10n('Seconde'));
+
+
+
+ $period_match = array(' week ',' day ',' hour ',' minute ',' seconde ');
+ array_push($period_match,' week ',' day ',' hour ',' minute ',' seconde ');
+ array_push($period_match,' week ',' day ',' hour ',' minute ',' seconde ');
+
+
+
+$a_ajouter = "+ " . str_replace($period_search, $period_match, $a_ajouter) ;
+
+
+
+$a_ajouter=trimUltime($a_ajouter);
+$v1 = array('- ','+ ','week','day','hour','minute','seconde',' -',' +',' ');
+$v2 = array('-','+', (7*24*60*60) , (24*60*60), (60*60), 60,1,'|-','|+',"*" );
+$new_valeur = str_replace($v1,$v2,$a_ajouter) ;
+$new_valeur = str_replace('++','+',$new_valeur ) ;
+
+$new_valeur = explode( "|",$new_valeur );
+$p = $init_date ;
+
+ //$new_valeur = $a_ajouter + $init_date ;
+ foreach($new_valeur as $nv)
+ {
+ $p += matheval($nv) ;
+
+ }
+return $p ;
+
+}
+//=====================================================================================
+function matheval($equation)
+ {
+ $equation = preg_replace("/[^0-9+\-.*\/()%]/","",$equation);
+
+ $equation = preg_replace("/([+-])([0-9]{1})(%)/","*(1\$1.0\$2)",$equation);
+
+ $equation = preg_replace("/([+-])([0-9]+)(%)/","*(1\$1.\$2)",$equation);
+
+ $equation = preg_replace("/([0-9]+)(%)/",".\$1",$equation);
+
+ if ( $equation == "" )
+ {
+ $return = 0;
+ }
+ else
+ {
+
+ eval("\$return=" . $equation . ";" );
+ }
+ return $return;
+ }
+
+//======================================================================================
+function trimUltime($chaine){
+ $chaine = trim($chaine);
+ $chaine = str_replace("\t", " ", $chaine);
+ $chaine = eregi_replace("[ ]+", " ", $chaine);
+ return $chaine;
+}
+
+
+function kill_list()
+{
+
+
+ //==================== TEST black_liste ============================================
+ $query = "
+ SELECT *,COUNT(`id`) as total
+ FROM `".MAIL_BLACK_LISTE_TABLE."`
+ WHERE ip='".$_SERVER['REMOTE_ADDR']."'
+ ;";
+//==============================================================================
+ $row = mysql_fetch_row(pwg_query($query));
+ if (count($row) > 0)
+ {
+
+ $nb = ($row[7])+1;
+ $pays = isset($_POST['pays']) ? $_POST['pays'] : $pays="" ;
+ $ville = (isset($_POST['ville'])) ? $_POST['ville']: $ville="" ;
+ $region = isset($_POST['region']) ? $_POST['region'] : $region="" ;
+
+ $query ="
+ UPDATE " . MAIL_BLACK_LISTE_TABLE . "
+ SET ";
+ if (isset($_POST['pays']))
+ $query .= "
+ `pays` = '". $pays ."',
+ `region` = '" . $region ."',
+ `ville` = '" . $ville . "',
+ ";
+ $query .= "
+ `nb` = " . $nb . "
+ WHERE ip = '".$_SERVER['REMOTE_ADDR']."' ;
+ ";
+ pwg_query($query );
+ //================================================================================
+
+ }
+return (count($row) > 0) ;
+}
?>
Index: extensions/Mail_supervisor/include/function_test_send.php
===================================================================
--- extensions/Mail_supervisor/include/function_test_send.php (revision 4065)
+++ extensions/Mail_supervisor/include/function_test_send.php (revision 4132)
@@ -26,6 +26,6 @@
die('Hacking attempt!');
}
-if (!defined('MAIL_SUPERV_DIR')) define('MAIL_SUPERV_DIR' , basename(dirname(__FILE__)));
-if (!defined('MAIL_SUPERV_PATH')) define('MAIL_SUPERV_PATH' , PHPWG_PLUGINS_PATH.basename(dirname(__FILE__)).'/');
+
+
function test_envoie($message,$group_name,$group_id)
Index: extensions/Mail_supervisor/include/save_info.php
===================================================================
--- extensions/Mail_supervisor/include/save_info.php (revision 4132)
+++ extensions/Mail_supervisor/include/save_info.php (revision 4132)
@@ -0,0 +1,128 @@
+0)
+ {
+ $query .= '
+ AND H.`IP` not IN ( SELECT `ip`
+ FROM '.MAIL_BLACK_LISTE_TABLE.' ) ';
+ }
+
+ $query .= '
+
+ GROUP by H.`IP` ;
+
+ ;' ;//
+ $result = pwg_query($query);
+ $liste_ip=array();
+ while ($row = mysql_fetch_array($result,MYSQL_ASSOC))
+ {
+ array_push($liste_ip, $row);
+ }
+
+
+
+
+
+
+
+?>
Index: extensions/Mail_supervisor/language/fr_FR/help/plugin.lang.php
===================================================================
--- extensions/Mail_supervisor/language/fr_FR/help/plugin.lang.php (revision 4065)
+++ extensions/Mail_supervisor/language/fr_FR/help/plugin.lang.php (revision 4132)
@@ -46,5 +46,19 @@
$lang['hlp_5_1']='Dernier message renvoyé par la fonction mail().';
-
-
+//=====================================================================
+
+
+//======================================================================
+
+
+$lang['hlp_7_1']='Ce module permet de créer une liste noire contenant les adresses IP indésirables.
+ Les adresse IP mémorisées dans la liste noire seront blocquées lors de leur tentative de connexions au site.
+ Les jockers (*) pour remplacer un groupe d\'adresse sont autorisés.
+ Exemple : 94.102.63.*
+ Exclusion de toutes les adresses IP de 94.102.63.0 à 94.102.63.255
+ Exemple : 94.102.*.13
+ Exclusion de toutes les adresses IP de 94.102.0.13 à 94.102.255.13
+
+
+ ';
?>
Index: extensions/Mail_supervisor/language/fr_FR/plugin.lang.php
===================================================================
--- extensions/Mail_supervisor/language/fr_FR/plugin.lang.php (revision 4065)
+++ extensions/Mail_supervisor/language/fr_FR/plugin.lang.php (revision 4132)
@@ -16,4 +16,9 @@
$lang['nbm_no_mail_to_send'] = 'Pas de mail à envoyer.';
*/
+$lang['IP_adress'] = 'Votre adresse IP';
+$lang['liste_ip']="Liste des IP (historique)";
+$lang['black_liste']="Liste noire des IP";
+$lang['blackliste']="Liste noire";
+
$lang['state'] = 'Etat';
$lang['refresh'] = 'Rafraîchir';
Index: extensions/Mail_supervisor/main.inc.php
===================================================================
--- extensions/Mail_supervisor/main.inc.php (revision 4065)
+++ extensions/Mail_supervisor/main.inc.php (revision 4132)
@@ -259,5 +259,4 @@
}
-
@@ -280,4 +279,3 @@
//add_event_handler('loc_end_page_tail', 'affiche_message');
add_event_handler('loc_after_page_header', 'affiche_message');
-
?>
Index: extensions/Mail_supervisor/maintain.inc.php
===================================================================
--- extensions/Mail_supervisor/maintain.inc.php (revision 4065)
+++ extensions/Mail_supervisor/maintain.inc.php (revision 4132)
@@ -25,27 +25,25 @@
die('Hacking attempt!');
}
-
-
-if (!defined('MAIL_SUPERV_DIR')) define('MAIL_SUPERV_DIR' , basename(dirname(__FILE__)));
if (!defined('MAIL_SUPERV_PATH')) define('MAIL_SUPERV_PATH' , PHPWG_PLUGINS_PATH.basename(dirname(__FILE__)).'/');
-
include_once (MAIL_SUPERV_PATH.'include/constants.php');
-
-include_once (MAIL_SUPERV_PATH.'include/fonctions.php');
-
+ include_once (MAIL_SUPERV_PATH.'include/fonctions.php');
+
function plugin_install()
{
+
+ global $superv_bl_champs,$superv_bl_type ;
+
// efface free mail
$q = '
SELECT count(`id`) as total FROM `'.PLUGINS_TABLE.'` WHERE `id` LIKE "free_mail" ;';
- $plugs = mysql_fetch_array(pwg_query($q));
+ $plugs = mysql_fetch_array(pwg_query($q),MYSQL_ASSOC);
$nb= $plugs['total'];
if (count($nb)>=1) {
- /* $q = '
-UPDATE ' . PLUGINS_TABLE . ' SET state="inactive" WHERE `id` LIKE "free_mail"';
- pwg_query($q);
- pwg_query( $q );*/
+ /* $q = '
+ UPDATE ' . PLUGINS_TABLE . ' SET state="inactive" WHERE `id` LIKE "free_mail"';
+ pwg_query($q);
+ pwg_query( $q );*/
$q = '
DELETE FROM '.PLUGINS_TABLE.'
@@ -78,10 +76,12 @@
$q = '
INSERT INTO '.CONFIG_TABLE.' (param, value, comment)
- VALUES ("mail_superv","on,on,off ,off,off","Parametres du plugin Mail superviseur")
+ VALUES ("mail_superv","off,off,off ,off,off","Parametres du plugin Mail superviseur")
;';
pwg_query($q);
+
-
- vérif_base();
+
+ vérif_base();
+ create_table(MAIL_BLACK_LISTE_TABLE,$superv_bl_champs,$superv_bl_type) ;
}
@@ -102,10 +102,11 @@
pwg_query($q);
-
-
-
- $q = 'DROP TABLE '.MAIL_SUPERV_TABLE.';';
+ }
+ $q = 'DROP TABLE IF EXISTS '.MAIL_BLACK_LISTE_TABLE.';';
+ pwg_query( $q );
+ $q = 'DROP TABLE IF EXISTS '.MAIL_SUPERV_TABLE.';';
pwg_query( $q );
- }
+
+
}
@@ -113,4 +114,5 @@
function plugin_activate()
{
+
}