1 | <?php |
---|
2 | /** |
---|
3 | * @author Eric@piwigo.org |
---|
4 | * |
---|
5 | * Upgrade processes for old plugin version |
---|
6 | * Called from maintain.inc.php on plugin activation |
---|
7 | * |
---|
8 | */ |
---|
9 | |
---|
10 | if(!defined('REGFLUXBB_PATH')) |
---|
11 | { |
---|
12 | define('REGFLUXBB_PATH' , PHPWG_PLUGINS_PATH.basename(dirname(__FILE__)).'/'); |
---|
13 | } |
---|
14 | |
---|
15 | include_once (REGFLUXBB_PATH.'include/functions.inc.php'); |
---|
16 | |
---|
17 | // +----------------------------------------------------------+ |
---|
18 | // | Upgrading database from old plugin versions | |
---|
19 | // +----------------------------------------------------------+ |
---|
20 | |
---|
21 | /* upgrade from 2.4.x to 2.5.0 */ |
---|
22 | /* *************************** */ |
---|
23 | function upgrade_240_250() |
---|
24 | { |
---|
25 | global $conf; |
---|
26 | |
---|
27 | load_language('plugin.lang', REGFLUXBB_PATH); |
---|
28 | |
---|
29 | $plugin = RegFluxBB_Infos(REGFLUXBB_PATH); |
---|
30 | $version = $plugin['version']; |
---|
31 | |
---|
32 | // Upgrading options - Changing config variables to assoc array |
---|
33 | // ------------------------------------------------------------ |
---|
34 | |
---|
35 | $conf_RegFluxBB = isset($conf['Register_FluxBB']) ? explode(";" , $conf['Register_FluxBB']) : array(); |
---|
36 | |
---|
37 | $Newconf_RegFluxBB = array( |
---|
38 | 'REGFLUXBB_VERSION' => $version, |
---|
39 | 'FLUXBB_PREFIX' => $conf_RegFluxBB[0], |
---|
40 | 'FLUXBB_ADMIN' => $conf_RegFluxBB[1], |
---|
41 | 'FLUXBB_GUEST' => $conf_RegFluxBB[2], |
---|
42 | 'FLUXBB_DEL_PT' => $conf_RegFluxBB[3], |
---|
43 | 'FLUXBB_CONFIRM' => $conf_RegFluxBB[4], |
---|
44 | 'FLUXBB_DETAIL' => $conf_RegFluxBB[5], |
---|
45 | 'FLUXBB_UAM_LINK' => $conf_RegFluxBB[6], |
---|
46 | 'FLUXBB_GROUP' => $conf_RegFluxBB[7] |
---|
47 | ); |
---|
48 | |
---|
49 | $update_conf = serialize($Newconf_RegFluxBB); |
---|
50 | |
---|
51 | $q = ' |
---|
52 | DELETE FROM '.CONFIG_TABLE.' |
---|
53 | WHERE param="Register_FluxBB" LIMIT 1 |
---|
54 | ;'; |
---|
55 | |
---|
56 | pwg_query($q); |
---|
57 | |
---|
58 | $q = ' |
---|
59 | INSERT INTO '.CONFIG_TABLE.' (param, value, comment) |
---|
60 | VALUES ("Register_FluxBB","'.pwg_db_real_escape_string($update_conf).'","Register_FluxBB parameters") |
---|
61 | ;'; |
---|
62 | |
---|
63 | pwg_query($q); |
---|
64 | } |
---|
65 | |
---|
66 | |
---|
67 | /* upgrade from 2.5.x to 2.5.5 */ |
---|
68 | /* *************************** */ |
---|
69 | function upgrade_250_255() |
---|
70 | { |
---|
71 | global $conf; |
---|
72 | |
---|
73 | // Add new field in Register_FluxBB ID links table |
---|
74 | $query ='ALTER TABLE '.Register_FluxBB_ID_TABLE.' ADD PwdSynch VARCHAR(3) NULL DEFAULT NULL;'; |
---|
75 | pwg_query($query); |
---|
76 | } |
---|
77 | ?> |
---|