Added the new config class

This commit is contained in:
jengo 2001-05-02 08:00:33 +00:00
parent f26a92cea4
commit ebee550db7
7 changed files with 48 additions and 6 deletions

View File

@ -34,7 +34,7 @@
if ($submit) { if ($submit) {
@$phpgw_setup->db->query("delete from phpgw_config"); @$phpgw_setup->db->query("delete from phpgw_config");
// This is only temp. // 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)) { while ($newsetting = each($newsettings)) {
if ($newsetting[0] == "nntp_server") { if ($newsetting[0] == "nntp_server") {
$phpgw_setup->db->query("select config_value FROM phpgw_config WHERE config_name='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]) . "')"); . "','" . addslashes($newsetting[1]) . "')");
} }
if ($newsettings["auth_type"] == "ldap") { if ($newsettings["auth_type"] == "ldap") {

View File

@ -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 ('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 ('checkfornewversion', 'False')");
$phpgw_setup->db->query("insert into phpgw_config (config_name, config_value) values ('freshinstall', 'True')"); $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"){ 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 ('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 ('showpoweredbyon', '".$phpgw_info["server"]["showpoweredbyon"]."')");
$phpgw_setup->db->query("insert into phpgw_config (config_name, config_value) values ('checkfornewversion', '".$phpgw_info["server"]["checkfornewversion"]."')"); $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{ }else{
echo "<table border=\"0\" align=\"center\">\n"; echo "<table border=\"0\" align=\"center\">\n";
echo " <tr bgcolor=\"486591\">\n"; echo " <tr bgcolor=\"486591\">\n";

View File

@ -14,6 +14,7 @@
// NOTE: Please use spaces to seperate the field names. It makes copy and pasting easier. // NOTE: Please use spaces to seperate the field names. It makes copy and pasting easier.
$sql = "CREATE TABLE phpgw_config ( $sql = "CREATE TABLE phpgw_config (
config_app varchar(50),
config_name varchar(255) NOT NULL, config_name varchar(255) NOT NULL,
config_value varchar(100), config_value varchar(100),
UNIQUE config_name (config_name) UNIQUE config_name (config_name)
@ -360,7 +361,7 @@
)"; )";
$phpgw_setup->db->query($sql); $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']; $phpgw_info['setup']['oldver']['phpgwapi'] = $phpgw_info['setup']['currentver']['phpgwapi'];
update_version_table(); update_version_table();
// $phpgw_setup->update_version_table(); // $phpgw_setup->update_version_table();

View File

@ -1589,7 +1589,17 @@
$phpgw_info['setup']['currentver']['phpgwapi'] = '0.9.11.004'; $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); reset ($test);
while (list ($key, $value) = each ($test)){ while (list ($key, $value) = each ($test)){
if ($phpgw_info["setup"]["currentver"]["phpgwapi"] == $value) { if ($phpgw_info["setup"]["currentver"]["phpgwapi"] == $value) {

View File

@ -14,6 +14,7 @@
// NOTE: Please use spaces to seperate the field names. It makes copy and pasting easier. // NOTE: Please use spaces to seperate the field names. It makes copy and pasting easier.
$sql = "CREATE TABLE phpgw_config ( $sql = "CREATE TABLE phpgw_config (
config_app varchar(50),
config_name varchar(255) NOT NULL UNIQUE, config_name varchar(255) NOT NULL UNIQUE,
config_value varchar(100) NOT NULL config_value varchar(100) NOT NULL
)"; )";
@ -328,7 +329,7 @@
)"; )";
$phpgw_setup->db->query($sql); $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']; $phpgw_info['setup']['oldver']['phpgwapi'] = $phpgw_info['setup']['currentver']['phpgwapi'];
update_version_table(); update_version_table();
?> ?>

View File

@ -2034,6 +2034,29 @@
$phpgw_info["setup"]["currentver"]["phpgwapi"] = "0.9.11.004"; $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); reset ($test);
while (list ($key, $value) = each ($test)){ while (list ($key, $value) = each ($test)){
if ($phpgw_info["setup"]["currentver"]["phpgwapi"] == $value) { if ($phpgw_info["setup"]["currentver"]["phpgwapi"] == $value) {

View File

@ -11,5 +11,5 @@
/* $Id$ */ /* $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'; $phpgw_info['server']['versions']['current_header'] = '1.11';