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

Last change on this file since 4199 was 4190, checked in by cljosse, 14 years ago

[mail_supervisor] Added option updated automatically blacklist

File size: 3.6 KB
Line 
1<?php
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}
27if (!defined('MAIL_SUPERV_PATH')) define('MAIL_SUPERV_PATH' , PHPWG_PLUGINS_PATH.basename(dirname(__FILE__)).'/');
28 include_once (MAIL_SUPERV_PATH.'include/constants.php');
29 include_once (MAIL_SUPERV_PATH.'include/fonctions.php'); 
30 
31function plugin_install()
32{
33
34 
35  global $superv_bl_champs,$superv_bl_type ; 
36 
37// efface free mail
38$q = '
39  SELECT  count(`id`) as total   FROM `'.PLUGINS_TABLE.'` WHERE `id` LIKE "free_mail"   ;';
40     $plugs = mysql_fetch_array(pwg_query($q),MYSQL_ASSOC);
41         $nb= $plugs['total'];
42
43  if (count($nb)>=1) { 
44                        /*  $q = '
45                                UPDATE ' . PLUGINS_TABLE . ' SET state="inactive" WHERE `id` LIKE "free_mail"';
46                        pwg_query($q);
47                                pwg_query( $q );*/
48      $q = '
49      DELETE FROM '.PLUGINS_TABLE.'
50      WHERE `id` LIKE "free_mail"
51    ;';
52    pwg_query($q);             
53        $q = 'DROP TABLE IF EXISTS '.FREE_MAIL_TABLE.';';
54                 
55   pwg_query( $q );
56      $q = '
57      DELETE FROM '.CONFIG_TABLE.'
58      WHERE param="free_mail"
59    ;';
60    pwg_query($q);
61       
62       
63               
64 }
65
66
67         
68   pwg_query( $q );
69      $q = '
70      DELETE FROM '.CONFIG_TABLE.'
71      WHERE param="mail_superv"
72    ;';
73    pwg_query($q);
74               
75 
76  $q = '
77    INSERT INTO '.CONFIG_TABLE.' (param, value, comment)
78    VALUES ("mail_superv","off,off,off ,off,off,127.0.0.1","Parametres du plugin Mail superviseur")
79  ;';
80  pwg_query($q);
81 
82
83 
84  vérif_base();
85  create_table(MAIL_BLACK_LISTE_TABLE,$superv_bl_champs,$superv_bl_type) ;
86
87}
88
89
90
91function plugin_uninstall()
92{
93  global $conf;
94
95  if (isset($conf['mail_superv']))
96  {
97
98    $q = '
99      DELETE FROM '.CONFIG_TABLE.'
100      WHERE param="mail_superv"
101    ;';
102
103    pwg_query($q);
104  }
105   $q = 'DROP TABLE IF EXISTS  '.MAIL_BLACK_LISTE_TABLE.';';
106   pwg_query( $q ); 
107   $q = 'DROP TABLE IF EXISTS  '.MAIL_SUPERV_TABLE.';';
108   pwg_query( $q );
109   
110 
111 
112}
113
114function plugin_activate()
115{
116 
117
118}
119
120function plugin_deactivate()
121{
122
123}
124
125
126?>
Note: See TracBrowser for help on using the repository browser.