source: extensions/NBC_UserAdvManager/tags/2.11.1/maintain.inc.php @ 3875

Last change on this file since 3875 was 3875, checked in by Eric, 15 years ago

Tag 2.11.1

  • Property svn:eol-style set to LF
File size: 3.3 KB
RevLine 
[3875]1<?php
2
3if(!defined("NBC_UserAdvManager_PATH"))
4  define('NBC_UserAdvManager_PATH' , PHPWG_PLUGINS_PATH.basename(dirname(__FILE__)).'/');
5
6include_once (NBC_UserAdvManager_PATH.'include/constants.php');
7
8function 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
22This is a reminder message because you registered on our gallery but you do not validate your registration and your
23
24validation key has expired. To still allow you to access to our gallery, your validation period has been reset. You
25
26have again 5 days to validate your registration.
27
28Note: After this period, your account will be permanently deleted.;true;Hello.
29
30This is a reminder message because you registered on our gallery but you do not validate your registration and your
31
32validation key will expire. To allow you access to our gallery, you have 2 days to confirm your registration by
33
34clicking on the link in the message you should have received when you registered.
35
36Note: 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
53function 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
72function 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
91function 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
99This is a reminder message because you registered on our gallery but you do not validate your registration and your
100
101validation key has expired. To still allow you to access to our gallery, your validation period has been reset. You
102
103have again 5 days to validate your registration.
104
105Note: After this period, your account will be permanently deleted.;true;Hello.
106
107This is a reminder message because you registered on our gallery but you do not validate your registration and your
108
109validation key will expire. To allow you access to our gallery, you have 2 days to confirm your registration by
110
111clicking on the link in the message you should have received when you registered.
112
113Note: After this period, your account will be permanently deleted.","Parametres nbc_UserAdvManager - ConfirmMail")
114  ;';
115  pwg_query($q);
116}
117?>
Note: See TracBrowser for help on using the repository browser.