1 | <?php |
---|
2 | |
---|
3 | if(!defined('LCAS_PATH')) |
---|
4 | { |
---|
5 | define('LCAS_PATH' , PHPWG_PLUGINS_PATH.basename(dirname(__FILE__)).'/'); |
---|
6 | } |
---|
7 | if (!defined('LCAS_ROOT')) |
---|
8 | { |
---|
9 | define('LCAS_ROOT', dirname(__FILE__).'/'); |
---|
10 | } |
---|
11 | |
---|
12 | include_once (LCAS_PATH.'include/constants.php'); |
---|
13 | include_once (LCAS_PATH.'include/functions.inc.php'); |
---|
14 | |
---|
15 | |
---|
16 | function plugin_install() |
---|
17 | { |
---|
18 | global $conf; |
---|
19 | |
---|
20 | $default = array('0','false','Example customized content of the notification email'); |
---|
21 | |
---|
22 | $q = ' |
---|
23 | INSERT INTO '.CONFIG_TABLE.' (param, value, comment) |
---|
24 | VALUES ("LoginCaseAccentsSensitivity","'.pwg_db_real_escape_string(serialize($default)).'","LCAS parameters") |
---|
25 | ;'; |
---|
26 | pwg_query($q); |
---|
27 | |
---|
28 | } |
---|
29 | |
---|
30 | |
---|
31 | function plugin_activate() |
---|
32 | { |
---|
33 | global $conf; |
---|
34 | |
---|
35 | /* Cleaning obsolete files */ |
---|
36 | /* *********************** */ |
---|
37 | LCAS_clean_obsolete_files(); |
---|
38 | |
---|
39 | include_once (LCAS_PATH.'include/upgradedb.inc.php'); |
---|
40 | |
---|
41 | $query = ' |
---|
42 | SELECT param |
---|
43 | FROM '.CONFIG_TABLE.' |
---|
44 | WHERE param = "LoginCaseAccentsSensitivity" |
---|
45 | ;'; |
---|
46 | $count1 = pwg_db_num_rows(pwg_query($query)); |
---|
47 | |
---|
48 | if ($count1 == 1) |
---|
49 | { |
---|
50 | load_conf_from_db('param like \'LoginCaseAccentsSensitivity\''); |
---|
51 | } |
---|
52 | } |
---|
53 | |
---|
54 | |
---|
55 | function plugin_uninstall() |
---|
56 | { |
---|
57 | global $conf; |
---|
58 | |
---|
59 | if (isset($conf['LoginCaseAccentsSensitivity'])) |
---|
60 | { |
---|
61 | $q = ' |
---|
62 | DELETE FROM '.CONFIG_TABLE.' |
---|
63 | WHERE param="LoginCaseAccentsSensitivity" |
---|
64 | ;'; |
---|
65 | |
---|
66 | pwg_query($q); |
---|
67 | } |
---|
68 | |
---|
69 | } |
---|
70 | ?> |
---|