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 | // +-----------------------------------------------------------------------+ |
---|
23 | if (!defined('PHPWG_ROOT_PATH')) |
---|
24 | { |
---|
25 | die('Hacking attempt!'); |
---|
26 | } |
---|
27 | |
---|
28 | |
---|
29 | if (!defined('MAIL_SUPERV_DIR')) define('MAIL_SUPERV_DIR' , basename(dirname(__FILE__))); |
---|
30 | if (!defined('MAIL_SUPERV_PATH')) define('MAIL_SUPERV_PATH' , PHPWG_PLUGINS_PATH.basename(dirname(__FILE__)).'/'); |
---|
31 | |
---|
32 | include_once (MAIL_SUPERV_PATH.'include/constants.php'); |
---|
33 | |
---|
34 | include_once (MAIL_SUPERV_PATH.'include/fonctions.php'); |
---|
35 | |
---|
36 | function plugin_install() |
---|
37 | { |
---|
38 | |
---|
39 | // efface free mail |
---|
40 | $q = ' |
---|
41 | SELECT count(`id`) as total FROM `'.PLUGINS_TABLE.'` WHERE `id` LIKE "free_mail" ;'; |
---|
42 | $plugs = mysql_fetch_array(pwg_query($q)); |
---|
43 | $nb= $plugs['total']; |
---|
44 | |
---|
45 | if (count($nb)>=1) { |
---|
46 | /* $q = ' |
---|
47 | UPDATE ' . PLUGINS_TABLE . ' SET state="inactive" WHERE `id` LIKE "free_mail"'; |
---|
48 | pwg_query($q); |
---|
49 | pwg_query( $q );*/ |
---|
50 | $q = ' |
---|
51 | DELETE FROM '.PLUGINS_TABLE.' |
---|
52 | WHERE `id` LIKE "free_mail" |
---|
53 | ;'; |
---|
54 | pwg_query($q); |
---|
55 | $q = 'DROP TABLE IF EXISTS '.FREE_MAIL_TABLE.';'; |
---|
56 | |
---|
57 | pwg_query( $q ); |
---|
58 | $q = ' |
---|
59 | DELETE FROM '.CONFIG_TABLE.' |
---|
60 | WHERE param="free_mail" |
---|
61 | ;'; |
---|
62 | pwg_query($q); |
---|
63 | |
---|
64 | |
---|
65 | |
---|
66 | } |
---|
67 | |
---|
68 | |
---|
69 | |
---|
70 | pwg_query( $q ); |
---|
71 | $q = ' |
---|
72 | DELETE FROM '.CONFIG_TABLE.' |
---|
73 | WHERE param="mail_superv" |
---|
74 | ;'; |
---|
75 | pwg_query($q); |
---|
76 | |
---|
77 | |
---|
78 | $q = ' |
---|
79 | INSERT INTO '.CONFIG_TABLE.' (param, value, comment) |
---|
80 | VALUES ("mail_superv","on,on,off ,off,off","Parametres du plugin Mail superviseur") |
---|
81 | ;'; |
---|
82 | pwg_query($q); |
---|
83 | |
---|
84 | |
---|
85 | vérif_base(); |
---|
86 | |
---|
87 | } |
---|
88 | |
---|
89 | |
---|
90 | |
---|
91 | function 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 | |
---|
106 | |
---|
107 | $q = 'DROP TABLE '.MAIL_SUPERV_TABLE.';'; |
---|
108 | pwg_query( $q ); |
---|
109 | } |
---|
110 | |
---|
111 | } |
---|
112 | |
---|
113 | function plugin_activate() |
---|
114 | { |
---|
115 | |
---|
116 | } |
---|
117 | |
---|
118 | function plugin_deactivate() |
---|
119 | { |
---|
120 | |
---|
121 | } |
---|
122 | |
---|
123 | |
---|
124 | ?> |
---|