1 | <?php |
---|
2 | |
---|
3 | if(!defined("NBC_UserAdvManager_PATH")) |
---|
4 | define('NBC_UserAdvManager_PATH' , PHPWG_PLUGINS_PATH.basename(dirname(__FILE__)).'/'); |
---|
5 | |
---|
6 | include_once (NBC_UserAdvManager_PATH.'include/constants.php'); |
---|
7 | |
---|
8 | function plugin_install() |
---|
9 | { |
---|
10 | $q = ' |
---|
11 | INSERT INTO '.CONFIG_TABLE.' (param, value, comment) |
---|
12 | VALUES ("nbc_UserAdvManager","true;false;false;-1;-1;-1;false;false;;-1;;;false;;","Parametres du plugin nbc UserAdvManager") |
---|
13 | ;'; |
---|
14 | pwg_query($q); |
---|
15 | |
---|
16 | $q = ' |
---|
17 | INSERT INTO '.CONFIG_TABLE.' (param, value, comment) |
---|
18 | VALUES ("nbc_UserAdvManager_ConfirmMail","false;5;","Parametres nbc_UserAdvManager - ConfirmMail") |
---|
19 | ;'; |
---|
20 | pwg_query($q); |
---|
21 | |
---|
22 | $q = " |
---|
23 | CREATE TABLE IF NOT EXISTS ".USER_CONFIRM_MAIL_TABLE." ( |
---|
24 | id varchar(50) NOT NULL default '', |
---|
25 | user_id smallint(5) NOT NULL default '0', |
---|
26 | mail_address varchar(255) default NULL, |
---|
27 | status enum('webmaster','admin','normal','generic','guest') default NULL, |
---|
28 | date_check datetime default NULL, |
---|
29 | PRIMARY KEY (id) |
---|
30 | ) |
---|
31 | ;"; |
---|
32 | pwg_query($q); |
---|
33 | } |
---|
34 | |
---|
35 | |
---|
36 | |
---|
37 | function plugin_uninstall() |
---|
38 | { |
---|
39 | global $conf; |
---|
40 | |
---|
41 | if (isset($conf['nbc_UserAdvManager'])) |
---|
42 | { |
---|
43 | $q = ' |
---|
44 | DELETE FROM '.CONFIG_TABLE.' |
---|
45 | WHERE param="nbc_UserAdvManager" |
---|
46 | ;'; |
---|
47 | |
---|
48 | pwg_query($q); |
---|
49 | } |
---|
50 | |
---|
51 | |
---|
52 | $q = 'DROP TABLE '.USER_CONFIRM_MAIL_TABLE.';'; |
---|
53 | pwg_query( $q ); |
---|
54 | } |
---|
55 | ?> |
---|