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

Last change on this file since 4042 was 4041, checked in by cljosse, 15 years ago

[mail_supervisor] insert multi tabs

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