[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 | // +-----------------------------------------------------------------------+ |
---|
| 23 | if (!defined('PHPWG_ROOT_PATH')) |
---|
| 24 | { |
---|
| 25 | die('Hacking attempt!'); |
---|
| 26 | } |
---|
[4020] | 27 | |
---|
| 28 | |
---|
[4051] | 29 | if (!defined('MAIL_SUPERV_DIR')) define('MAIL_SUPERV_DIR' , basename(dirname(__FILE__))); |
---|
[4041] | 30 | if (!defined('MAIL_SUPERV_PATH')) define('MAIL_SUPERV_PATH' , PHPWG_PLUGINS_PATH.basename(dirname(__FILE__)).'/'); |
---|
| 31 | |
---|
[4020] | 32 | include_once (MAIL_SUPERV_PATH.'include/constants.php'); |
---|
[4054] | 33 | |
---|
[4020] | 34 | include_once (MAIL_SUPERV_PATH.'include/fonctions.php'); |
---|
| 35 | |
---|
| 36 | function plugin_install() |
---|
| 37 | { |
---|
| 38 | |
---|
[4029] | 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)); |
---|
[4054] | 43 | $nb= $plugs['total']; |
---|
[4029] | 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 | |
---|
[4049] | 70 | pwg_query( $q ); |
---|
| 71 | $q = ' |
---|
| 72 | DELETE FROM '.CONFIG_TABLE.' |
---|
| 73 | WHERE param="mail_superv" |
---|
| 74 | ;'; |
---|
| 75 | pwg_query($q); |
---|
[4029] | 76 | |
---|
| 77 | |
---|
[4020] | 78 | $q = ' |
---|
| 79 | INSERT INTO '.CONFIG_TABLE.' (param, value, comment) |
---|
[4040] | 80 | VALUES ("mail_superv","on,on,off ,off,off","Parametres du plugin Mail superviseur") |
---|
[4020] | 81 | ;'; |
---|
| 82 | pwg_query($q); |
---|
| 83 | |
---|
| 84 | |
---|
[4049] | 85 | vérif_base(); |
---|
[4020] | 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 | |
---|
[4059] | 113 | function plugin_activate() |
---|
| 114 | { |
---|
[4020] | 115 | |
---|
[4059] | 116 | } |
---|
[4020] | 117 | |
---|
[4059] | 118 | function plugin_deactivate() |
---|
| 119 | { |
---|
| 120 | |
---|
| 121 | } |
---|
| 122 | |
---|
| 123 | |
---|
[4020] | 124 | ?> |
---|