From ebee550db79718874abf8a199cb84a52b1285479 Mon Sep 17 00:00:00 2001 From: jengo Date: Wed, 2 May 2001 08:00:33 +0000 Subject: [PATCH] Added the new config class --- setup/config.php | 4 ++-- setup/sql/common_default_records.inc.php | 7 +++++++ setup/sql/mysql_newtables.inc.php | 3 ++- setup/sql/mysql_upgrade_beta.inc.php | 12 +++++++++++- setup/sql/pgsql_newtables.inc.php | 3 ++- setup/sql/pgsql_upgrade_beta.inc.php | 23 +++++++++++++++++++++++ version.inc.php | 2 +- 7 files changed, 48 insertions(+), 6 deletions(-) diff --git a/setup/config.php b/setup/config.php index b30b0f8625..555ec5a506 100644 --- a/setup/config.php +++ b/setup/config.php @@ -34,7 +34,7 @@ if ($submit) { @$phpgw_setup->db->query("delete from phpgw_config"); // This is only temp. - $phpgw_setup->db->query("insert into phpgw_config (config_name, config_value) values ('useframes','never')"); + $phpgw_setup->db->query("insert into phpgw_config (config_app,config_name, config_value) values ('phpgwapi','useframes','never')"); while ($newsetting = each($newsettings)) { if ($newsetting[0] == "nntp_server") { $phpgw_setup->db->query("select config_value FROM phpgw_config WHERE config_name='nntp_server'"); @@ -46,7 +46,7 @@ } } } - $phpgw_setup->db->query("insert into phpgw_config (config_name, config_value) values ('" . addslashes($newsetting[0]) + $phpgw_setup->db->query("insert into phpgw_config (config_app,config_name, config_value) values ('phpgwapi','" . addslashes($newsetting[0]) . "','" . addslashes($newsetting[1]) . "')"); } if ($newsettings["auth_type"] == "ldap") { diff --git a/setup/sql/common_default_records.inc.php b/setup/sql/common_default_records.inc.php index 7ee8742fc9..61fa3774d2 100644 --- a/setup/sql/common_default_records.inc.php +++ b/setup/sql/common_default_records.inc.php @@ -49,6 +49,9 @@ $phpgw_setup->db->query("insert into phpgw_config (config_name, config_value) values ('htmlcompliant', 'False')"); $phpgw_setup->db->query("insert into phpgw_config (config_name, config_value) values ('checkfornewversion', 'False')"); $phpgw_setup->db->query("insert into phpgw_config (config_name, config_value) values ('freshinstall', 'True')"); + + // I didn't want to change all of these becuase of setup2 (jengo) + $phpgw_setup->db->query("update phpgw_config set config_app='phpgwapi'",__LINE__,__FILE__); } if ($useglobalconfigsettings == "on"){ @@ -85,6 +88,10 @@ $phpgw_setup->db->query("insert into phpgw_config (config_name, config_value) values ('httpproxy_port', '".$phpgw_info["server"]["httpproxy_port"]."')"); $phpgw_setup->db->query("insert into phpgw_config (config_name, config_value) values ('showpoweredbyon', '".$phpgw_info["server"]["showpoweredbyon"]."')"); $phpgw_setup->db->query("insert into phpgw_config (config_name, config_value) values ('checkfornewversion', '".$phpgw_info["server"]["checkfornewversion"]."')"); + + // I didn't want to change all of these becuase of setup2 (jengo) + $phpgw_setup->db->query("update phpgw_config set config_app='phpgwapi'",__LINE__,__FILE__); + }else{ echo "\n"; echo " \n"; diff --git a/setup/sql/mysql_newtables.inc.php b/setup/sql/mysql_newtables.inc.php index 70b75030a0..cbe671e9e9 100644 --- a/setup/sql/mysql_newtables.inc.php +++ b/setup/sql/mysql_newtables.inc.php @@ -14,6 +14,7 @@ // NOTE: Please use spaces to seperate the field names. It makes copy and pasting easier. $sql = "CREATE TABLE phpgw_config ( + config_app varchar(50), config_name varchar(255) NOT NULL, config_value varchar(100), UNIQUE config_name (config_name) @@ -360,7 +361,7 @@ )"; $phpgw_setup->db->query($sql); - $phpgw_info['setup']['currentver']['phpgwapi'] = '0.9.11.003'; + $phpgw_info['setup']['currentver']['phpgwapi'] = '0.9.11.005'; $phpgw_info['setup']['oldver']['phpgwapi'] = $phpgw_info['setup']['currentver']['phpgwapi']; update_version_table(); // $phpgw_setup->update_version_table(); diff --git a/setup/sql/mysql_upgrade_beta.inc.php b/setup/sql/mysql_upgrade_beta.inc.php index 7267140d9a..ed1df7525b 100644 --- a/setup/sql/mysql_upgrade_beta.inc.php +++ b/setup/sql/mysql_upgrade_beta.inc.php @@ -1589,7 +1589,17 @@ $phpgw_info['setup']['currentver']['phpgwapi'] = '0.9.11.004'; } - + $test[] = '0.9.11.004'; + function upgrade0_9_11_004() + { + global $phpgw_info,$phpgw_setup; + + $phpgw_setup->db->query("alter table phpgw_config add column config_app varchar(50) first",__LINE__,__FILE__); + $phpgw_setup->db->query("update phpgw_config set config_app='phpgwapi'",__LINE__,__FILE__); + + $phpgw_info['setup']['currentver']['phpgwapi'] = '0.9.11.005'; + } + reset ($test); while (list ($key, $value) = each ($test)){ if ($phpgw_info["setup"]["currentver"]["phpgwapi"] == $value) { diff --git a/setup/sql/pgsql_newtables.inc.php b/setup/sql/pgsql_newtables.inc.php index 53f92be93c..c5700cb5b5 100644 --- a/setup/sql/pgsql_newtables.inc.php +++ b/setup/sql/pgsql_newtables.inc.php @@ -14,6 +14,7 @@ // NOTE: Please use spaces to seperate the field names. It makes copy and pasting easier. $sql = "CREATE TABLE phpgw_config ( + config_app varchar(50), config_name varchar(255) NOT NULL UNIQUE, config_value varchar(100) NOT NULL )"; @@ -328,7 +329,7 @@ )"; $phpgw_setup->db->query($sql); - $phpgw_info['setup']['currentver']['phpgwapi'] = '0.9.11.003'; + $phpgw_info['setup']['currentver']['phpgwapi'] = '0.9.11.005'; $phpgw_info['setup']['oldver']['phpgwapi'] = $phpgw_info['setup']['currentver']['phpgwapi']; update_version_table(); ?> diff --git a/setup/sql/pgsql_upgrade_beta.inc.php b/setup/sql/pgsql_upgrade_beta.inc.php index 67003e8cf6..f620fbea79 100644 --- a/setup/sql/pgsql_upgrade_beta.inc.php +++ b/setup/sql/pgsql_upgrade_beta.inc.php @@ -2034,6 +2034,29 @@ $phpgw_info["setup"]["currentver"]["phpgwapi"] = "0.9.11.004"; } + $test[] = '0.9.11.004'; + function upgrade0_9_11_004() + { + global $phpgw_info, $phpgw_setup; + + $phpgw_setup->db->query("create table phpgw_config_temp as select * from phpgw_config",__LINE__,__FILE__); + $phpgw_setup->db->query("drop table phpgw_config",__LINE__,__FILE__); + + $sql = "CREATE TABLE phpgw_config ( + config_app varchar(50), + config_name varchar(255) NOT NULL UNIQUE, + config_value varchar(100) NOT NULL + )"; + $phpgw_setup->db->query($sql,__LINE,__FILE__); + + $phpgw_setup->db->query("insert into phpgw_config select * from phpgw_config_temp",__LINE__,__FILE__); + $phpgw_setup->db->query("drop table phpgw_config_temp",__LINE__,__FILE__); + $phpgw_setup->db->query("update phpgw_config set config_app='phpgwapi'",__LINE__,__FILE__); + + $phpgw_info['setup']['currentver']['phpgwapi'] = '0.9.11.005'; + } + + reset ($test); while (list ($key, $value) = each ($test)){ if ($phpgw_info["setup"]["currentver"]["phpgwapi"] == $value) { diff --git a/version.inc.php b/version.inc.php index 1cf15edef2..504a91d4d0 100644 --- a/version.inc.php +++ b/version.inc.php @@ -11,5 +11,5 @@ /* $Id$ */ - $phpgw_info['server']['versions']['phpgwapi'] = '0.9.11.004'; + $phpgw_info['server']['versions']['phpgwapi'] = '0.9.11.005'; $phpgw_info['server']['versions']['current_header'] = '1.11';