source: extensions/Register_FluxBB/trunk/maintain.inc.php @ 7154

Revision 6815, 1.9 KB checked in by Eric, 10 years ago (diff)

bug 1434 fixed : Bridge between Register_FluxBB and UAM for users registration control

  • Language files updated (FR and EN are OK. DE is to do)
  • Admin page small refactory
  • Database upgrade process updated for new plugin version
  • Version 2.3.0 hard coded
  • Property svn:eol-style set to LF
Line 
1<?php
2
3if(!defined("REGFLUXBB_DIR")) define('REGFLUXBB_DIR' , basename(dirname(__FILE__)));
4if(!defined("REGFLUXBB_PATH")) define('REGFLUXBB_PATH' , PHPWG_PLUGINS_PATH.REGFLUXBB_DIR.'/');
5//ini_set('error_reporting', E_ALL);
6//ini_set('display_errors', true);
7
8include_once (PHPWG_ROOT_PATH.'/include/constants.php');
9include_once (REGFLUXBB_PATH.'include/constants.php');
10include_once (REGFLUXBB_PATH.'include/functions.inc.php');
11
12
13function plugin_install()
14{
15  global $prefixeTable;
16
17  $q = '
18INSERT INTO '.CONFIG_TABLE.' (param,value,comment)
19VALUES ("Register_FluxBB","FluxBB_;PhpWebGallery;Guest;false;false;true;false;0","Parametres Register_FluxBB")
20;';
21   
22  pwg_query($q);
23 
24  $q = "
25CREATE TABLE IF NOT EXISTS ".Register_FluxBB_ID_TABLE." (
26  id_user_pwg smallint(5) NOT NULL default '0',
27  id_user_FluxBB int(10) NOT NULL default '0',
28PRIMARY KEY  (id_user_pwg),
29  KEY id_user_pwg (id_user_pwg, id_user_FluxBB)
30)
31;";
32
33  pwg_query($q);
34
35}
36
37function plugin_activate()
38{
39  global $conf;
40
41/* Cleaning obsolete files */
42/* *********************** */
43  regfluxbb_obsolete_files();
44
45/* Check version < 2.3.0 */
46  $conf_Register_FluxBB = isset($conf['Register_FluxBB']) ? explode(";" , $conf['Register_FluxBB']) : array();
47 
48  if (!isset($conf_Register_FluxBB[6]) and !isset($conf_Register_FluxBB[7]))
49  {
50    $upgrade_RFBB = $conf_Register_FluxBB[0].';'.$conf_Register_FluxBB[1].';'.$conf_Register_FluxBB[2].';'.$conf_Register_FluxBB[3].';'.$conf_Register_FluxBB[4].';'.$conf_Register_FluxBB[5].';false;0';
51               
52    $query = '
53UPDATE '.CONFIG_TABLE.'
54SET value="'.$upgrade_RFBB.'"
55WHERE param="Register_FluxBB"
56LIMIT 1
57;';
58                pwg_query($query);
59  }
60}
61
62function plugin_uninstall()
63{
64  global $conf;
65
66  if (isset($conf['Register_FluxBB']))
67  {
68    $q = '
69DELETE FROM '.CONFIG_TABLE.'
70WHERE param="Register_FluxBB" LIMIT 1
71;';
72
73    pwg_query($q);
74  }
75 
76  $q = 'DROP TABLE '.Register_FluxBB_ID_TABLE.';';
77  pwg_query( $q );
78
79}
80?>
Note: See TracBrowser for help on using the repository browser.