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 | global $conf; |
---|
11 | |
---|
12 | $q = ' |
---|
13 | INSERT INTO '.CONFIG_TABLE.' (param, value, comment) |
---|
14 | VALUES ("nbc_UserAdvManager","true;false;false;-1;-1;-1;false;false;;-1;;;false;;","Parametres du plugin nbc UserAdvManager") |
---|
15 | ;'; |
---|
16 | pwg_query($q); |
---|
17 | |
---|
18 | $q = ' |
---|
19 | INSERT INTO '.CONFIG_TABLE.' (param, value, comment) |
---|
20 | VALUES ("nbc_UserAdvManager_ConfirmMail","true;5;Hello. |
---|
21 | |
---|
22 | This is a reminder message because you registered on our gallery but you do not validate your registration and your |
---|
23 | |
---|
24 | validation key has expired. To still allow you to access to our gallery, your validation period has been reset. You |
---|
25 | |
---|
26 | have again 5 days to validate your registration. |
---|
27 | |
---|
28 | Note: After this period, your account will be permanently deleted.;true;Hello. |
---|
29 | |
---|
30 | This is a reminder message because you registered on our gallery but you do not validate your registration and your |
---|
31 | |
---|
32 | validation key will expire. To allow you access to our gallery, you have 2 days to confirm your registration by |
---|
33 | |
---|
34 | clicking on the link in the message you should have received when you registered. |
---|
35 | |
---|
36 | Note: After this period, your account will be permanently deleted.","Parametres nbc_UserAdvManager - ConfirmMail") |
---|
37 | ;'; |
---|
38 | pwg_query($q); |
---|
39 | |
---|
40 | $q = " |
---|
41 | CREATE TABLE IF NOT EXISTS ".USER_CONFIRM_MAIL_TABLE." ( |
---|
42 | id varchar(50) NOT NULL default '', |
---|
43 | user_id smallint(5) NOT NULL default '0', |
---|
44 | mail_address varchar(255) default NULL, |
---|
45 | status enum('webmaster','admin','normal','generic','guest') default NULL, |
---|
46 | date_check datetime default NULL, |
---|
47 | PRIMARY KEY (id) |
---|
48 | ) |
---|
49 | ;"; |
---|
50 | pwg_query($q); |
---|
51 | } |
---|
52 | |
---|
53 | function plugin_activate() |
---|
54 | { |
---|
55 | global $conf; |
---|
56 | |
---|
57 | /* Check for upgrade */ |
---|
58 | $query = ' |
---|
59 | SELECT *, COUNT (*) |
---|
60 | FROM '.CONFIG_TABLE.' |
---|
61 | WHERE param = "nbc_UserAdvManager_ConfirmMail" |
---|
62 | ;'; |
---|
63 | list($count) = mysql_fetch_row(pwg_query($query)); |
---|
64 | |
---|
65 | /* upgrade from branch 2.10 */ |
---|
66 | if ($count == 0) |
---|
67 | { |
---|
68 | upgrade_UserAdvManager(); |
---|
69 | } |
---|
70 | } |
---|
71 | |
---|
72 | function plugin_uninstall() |
---|
73 | { |
---|
74 | global $conf; |
---|
75 | |
---|
76 | if (isset($conf['nbc_UserAdvManager'])) |
---|
77 | { |
---|
78 | $q = ' |
---|
79 | DELETE FROM '.CONFIG_TABLE.' |
---|
80 | WHERE param="nbc_UserAdvManager" |
---|
81 | ;'; |
---|
82 | |
---|
83 | pwg_query($q); |
---|
84 | } |
---|
85 | |
---|
86 | |
---|
87 | $q = 'DROP TABLE '.USER_CONFIRM_MAIL_TABLE.';'; |
---|
88 | pwg_query( $q ); |
---|
89 | } |
---|
90 | |
---|
91 | function upgrade_UserAdvManager() |
---|
92 | { |
---|
93 | global $conf; |
---|
94 | |
---|
95 | $q = ' |
---|
96 | INSERT INTO '.CONFIG_TABLE.' (param, value, comment) |
---|
97 | VALUES ("nbc_UserAdvManager_ConfirmMail","true;5;Hello. |
---|
98 | |
---|
99 | This is a reminder message because you registered on our gallery but you do not validate your registration and your |
---|
100 | |
---|
101 | validation key has expired. To still allow you to access to our gallery, your validation period has been reset. You |
---|
102 | |
---|
103 | have again 5 days to validate your registration. |
---|
104 | |
---|
105 | Note: After this period, your account will be permanently deleted.;true;Hello. |
---|
106 | |
---|
107 | This is a reminder message because you registered on our gallery but you do not validate your registration and your |
---|
108 | |
---|
109 | validation key will expire. To allow you access to our gallery, you have 2 days to confirm your registration by |
---|
110 | |
---|
111 | clicking on the link in the message you should have received when you registered. |
---|
112 | |
---|
113 | Note: After this period, your account will be permanently deleted.","Parametres nbc_UserAdvManager - ConfirmMail") |
---|
114 | ;'; |
---|
115 | pwg_query($q); |
---|
116 | } |
---|
117 | ?> |
---|