source: extensions/Mail_supervisor/maintain.inc.php @ 4366

Last change on this file since 4366 was 4361, checked in by cljosse, 14 years ago

[mail_supervisor] update function test_spam.

File size: 4.1 KB
RevLine 
[4020]1<?php
[4029]2// +-----------------------------------------------------------------------+
3// | Piwigo - a PHP based picture gallery                                  |
4// +-----------------------------------------------------------------------+
5// | Copyright(C) 2008-2009 Piwigo Team                  http://piwigo.org |
6// | Copyright(C) 2003-2008 PhpWebGallery Team    http://phpwebgallery.net |
7// | Copyright(C) 2002-2003 Pierrick LE GALL   http://le-gall.net/pierrick |
8// +-----------------------------------------------------------------------+
9// | This program is free software; you can redistribute it and/or modify  |
10// | it under the terms of the GNU General Public License as published by  |
11// | the Free Software Foundation                                          |
12// |                                                                       |
13// | This program is distributed in the hope that it will be useful, but   |
14// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
15// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
16// | General Public License for more details.                              |
17// |                                                                       |
18// | You should have received a copy of the GNU General Public License     |
19// | along with this program; if not, write to the Free Software           |
20// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
21// | USA.                                                                  |
22// +-----------------------------------------------------------------------+
23if  (!defined('PHPWG_ROOT_PATH')) 
24{
25  die('Hacking attempt!');
26}
[4041]27if (!defined('MAIL_SUPERV_PATH')) define('MAIL_SUPERV_PATH' , PHPWG_PLUGINS_PATH.basename(dirname(__FILE__)).'/');
[4180]28 include_once (MAIL_SUPERV_PATH.'include/constants.php');
[4020]29
[4029]30
[4220]31global  $superv_champs , $superv_type ,$superv_bl_champs , $superv_bl_type ; 
32          $superv_champs = array(
33                       "id",
34                                        "nb_mails",
35                                        "date_mail",
36                                        "nb_mails_maxi",               
37                                        "nb_mails_periode",     
38                                        "nb_spams",
39                                        "date_spam",   
40                                        "nb_spams_maxi",       
41                                        "nb_spams_periode",     
42                                        "quarantaine",
43                                        "date_quarantaine",
44                                        "quarantaine_periode", 
45                                        "message", 
46                                        "message_test", 
47                                    "header_text",
48                               
49                                        );
50                                       
51        $superv_type = array(
52                        " SMALLINT( 5 ) NOT NULL DEFAULT '0'"      ,
53                                        "INT NOT NULL DEFAULT '0'"  ,
54                                        "INT NOT NULL DEFAULT '0'"  ,
55                                        "INT NOT NULL DEFAULT '2000'",         
56                                        "TEXT"  ,       
57                                        "INT NOT NULL DEFAULT '0'",
58                                        "INT NOT NULL DEFAULT '0'",     
59                                        "INT NOT NULL DEFAULT '10'",   
60                                        "TEXT"  ,       
61                                        "TEXT" ,
62                                        "INT NOT NULL DEFAULT '0'",
63                                        "TEXT"  ,       
64                                        "TEXT"  , 
65                                        "TEXT"  , 
66                                        "TEXT"  ,
67                                       
68                                        );             
69                                       
70 
71          $superv_bl_champs = array(
72                                        "id",
73                                        "ip",
74                                        "pays",
75                                        "region",               
76                                        "ville",       
77                                        "adresse",
78                                        "fai", 
79                                        "nb"
80                                        );
81                                       
82        $superv_bl_type = array(
83                        " smallint(5) UNSIGNED NOT NULL auto_increment ",
84                                        "TEXT"  ,
85                                        "TEXT"  ,
86                                        "TEXT"  ,
87                                        "TEXT"  ,
88                                        "TEXT"  ,
89                                        "TEXT"  ,
90                                        " smallint(5) UNSIGNED "
91                                        );                                                                                                                                     
[4029]92
93
[4220]94function plugin_install()
95{
96global $conf ;
97 if ( !isset($conf['mail_superv']) ) 
98 {
99    plugin_uninstall() ;
100    $query = '
[4020]101    INSERT INTO '.CONFIG_TABLE.' (param, value, comment)
[4361]102    VALUES ("mail_superv","off,off,off,off,off,on,127.0.0.1,?? ,?? ,?? ","Parametres du plugin Mail superviseur")
[4220]103    ;';
104    pwg_query($query);
105        //==================================================================
106       
107 } 
[4020]108
109}
110
111
112
113function plugin_uninstall()
114{
115
[4220]116    $query = '
[4020]117      DELETE FROM '.CONFIG_TABLE.'
118      WHERE param="mail_superv"
119    ;';
[4220]120    pwg_query($query);
121    $query = 'DROP TABLE IF EXISTS  '.MAIL_BLACK_LISTE_TABLE.';';
122    pwg_query( $query ); 
123    $query = 'DROP TABLE IF EXISTS  '.MAIL_SUPERV_TABLE.';';
124    pwg_query( $query);
[4132]125   
[4020]126 
127}
128
[4059]129function plugin_activate()
130{
[4020]131
[4220]132include_once (MAIL_SUPERV_PATH.'include/fonctions.php');       
133 vérif_base() ;
134
[4059]135}
[4020]136
[4059]137function plugin_deactivate()
138{
139
140}
141
142
[4020]143?>
Note: See TracBrowser for help on using the repository browser.