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

Revision 8271, 1.3 KB checked in by Eric, 9 years ago (diff)

bug 2066 second step fix :

  • Add option to enable / disable email send
  • Email function integration in userlist table
  • LCAS_SendMail function coded (not tested)

Database init updated
Translation files updated

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  $default = array('false','false','false','Example customized content of the notification email');
21
22  $q = '
23INSERT INTO '.CONFIG_TABLE.' (param, value, comment)
24VALUES ("LoginCaseAccentsSensitivity","'.addslashes(serialize($default)).'","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.