source: extensions/LCAS/trunk/maintain.inc.php @ 8209

Last change on this file since 8209 was 8141, checked in by Whiler, 14 years ago

Initial version

File size: 1.3 KB
Line 
1<?php
2
3if(!defined('LCAS_PATH'))
4{
5  define('LCAS_PATH' , PHPWG_PLUGINS_PATH.basename(dirname(__FILE__)).'/');
6}
7if (!defined('LCAS_ROOT'))
8{
9  define('LCAS_ROOT', dirname(__FILE__).'/');
10}
11
12include_once (LCAS_PATH.'include/constants.php');
13include_once (LCAS_PATH.'include/functions.inc.php');
14
15
16function plugin_install()
17{
18        global $conf;
19       
20  $default1 = array('false','false');
21
22  $q = '
23INSERT INTO '.CONFIG_TABLE.' (param, value, comment)
24VALUES ("LoginCaseAccentsSensitivity","'.addslashes(serialize($default1)).'","LCAS parameters")
25  ;';
26  pwg_query($q);
27
28}
29
30
31function 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 = '
42SELECT param
43  FROM '.CONFIG_TABLE.'
44WHERE 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
55function plugin_uninstall()
56{
57  global $conf;
58
59  if (isset($conf['LoginCaseAccentsSensitivity']))
60  {
61    $q = '
62DELETE FROM '.CONFIG_TABLE.'
63WHERE param="LoginCaseAccentsSensitivity"
64;';
65
66    pwg_query($q);
67  }
68
69}
70?>
Note: See TracBrowser for help on using the repository browser.