Added in the new serialized config table

This commit is contained in:
jengo 2000-12-12 22:39:50 +00:00
parent 8a084c4e4f
commit c92d4c5e11
7 changed files with 68 additions and 18 deletions

View File

@ -11,9 +11,12 @@
/* $Id$ */
$phpgw_info["flags"] = array("noheader" => True, "nonavbar" => True, "currentapp" => "home", "noapi" => True);
$phpgw_info["flags"] = array("noheader" => True, "nonavbar" => True, "currentapp" => "home",
"noapi" => True);
include("./inc/functions.inc.php");
include("../header.inc.php");
include($phpgw_info["server"]["include_root"] . "/phpgwapi/phpgw_common.inc.php");
$common = new common;
// Authorize the user to use setup app and load the database
// Does not return unless user is authorized
@ -33,7 +36,12 @@
if ($submit) {
@$db->query("delete from config");
while ($newsetting = each($newsettings)) {
$phpgw_info["server"] = $newsettings;
//$config_string = addslashes(serialize($t_array));
$db->query("insert into config values ('" . addslashes(serialize($newsettings)) . "')",__LINE__,__FILE__);
/* while ($newsetting = each($newsettings)) {
if ($newsetting[0] == "nntp_server") {
$db->query("select config_value FROM config WHERE config_name='nntp_server'");
if ($db->num_rows()) {
@ -46,7 +54,7 @@
}
$db->query("insert into config (config_name, config_value) values ('" . addslashes($newsetting[0])
. "','" . addslashes($newsetting[1]) . "')");
}
} */
if ($newsettings["auth_type"] == "ldap") {
Header("Location: ldap.php");
exit;
@ -62,9 +70,12 @@
}
@$db->query("select * from config");
while (@$db->next_record()) {
$current_config[$db->f("config_name")] = $db->f("config_value");
}
@$db->next_record();
$current_config = unserialize($db->f(0));
// $current_config = $phpgw_info["server"];
// $current_config[$db->f("config_name")] = $db->f("config_value");
// }
if ($current_config["files_dir"] == "/path/to/dir/phpgroupware/files") {
$current_config["files_dir"] = $phpgw_info["server"]["server_root"] . "/files";

View File

@ -13,7 +13,44 @@
function add_default_server_config(){
global $db, $phpgw_info, $currentver;
$db->query("insert into config (config_name, config_value) values ('default_tplset', 'default')");
$phpgw_info["server"]["default_tplset"] = "default";
$phpgw_info["server"]["temp_dir"]="/path/to/tmp";
$phpgw_info["server"]["files_dir"]="/path/to/phpgroupware/files";
$phpgw_info["server"]["webserver_url"]="/phpgroupware";
$phpgw_info["server"]["mail_server"]="localhost";
$phpgw_info["server"]["mail_server_type"]="imap";
$phpgw_info["server"]["imap_server_type"]="UWash";
$phpgw_info["server"]["mail_suffix"]="yourdomain.com";
$phpgw_info["server"]["mail_login_type"]="standard";
$phpgw_info["server"]["smtp_server"]="localhost";
$phpgw_info["server"]["smtp_port"]="25";
$phpgw_info["server"]["auth_type"]="sql";
$phpgw_info["server"]["account_repository"]="sql";
$phpgw_info["server"]["ldap_host"]="localhost";
$phpgw_info["server"]["ldap_context"]="ou=People,dc=my-domain,dc=com";
$phpgw_info["server"]["ldap_root_dn"]="cn=Manager,dc=my-domain,dc=com";
$phpgw_info["server"]["ldap_root_pw"]="secret";
$phpgw_info["server"]["ldap_encryption_type"]="DES";
$phpgw_info["server"]["usecookies"]="True";
$phpgw_info["server"]["encryptkey"]="change this phrase 2 something else";
$phpgw_info["server"]["default_ftp_server"]="localhost";
$phpgw_info["server"]["httpproxy_server"]="";
$phpgw_info["server"]["httpproxy_port"]="";
$phpgw_info["server"]["showpoweredbyon"]="top";
$phpgw_info["server"]["site_title"]="phpGroupWare";
$phpgw_info["server"]["hostname"]="localhost";
$phpgw_info["server"]["nntp_server"]="yournewsserver.com";
$phpgw_info["server"]["nntp_port"]="119";
$phpgw_info["server"]["nntp_sender"]="complaints@yourserver.com";
$phpgw_info["server"]["nntp_organization"]="phpGroupWare";
$phpgw_info["server"]["nntp_admin"]="admin@yourserver.com";
$phpgw_info["server"]["nntp_login_username"]="";
$phpgw_info["server"]["nntp_login_password"]="";
$db->query("insert into config values("' . serialize($s) . '")");
/* $db->query("insert into config (config_name, config_value) values ('default_tplset', 'default')");
$db->query("insert into config (config_name, config_value) values ('temp_dir', '/path/to/tmp')");
$db->query("insert into config (config_name, config_value) values ('files_dir', '/path/to/dir/phpgroupware/files')");
$db->query("insert into config (config_name, config_value) values ('encryptkey', 'change this phrase 2 something else')");
@ -48,7 +85,7 @@
$db->query("insert into config (config_name, config_value) values ('showpoweredbyon', 'bottom')");
$db->query("insert into config (config_name, config_value) values ('htmlcompliant', 'False')");
$db->query("insert into config (config_name, config_value) values ('checkfornewversion', 'False')");
$db->query("insert into config (config_name, config_value) values ('freshinstall', 'True')");
$db->query("insert into config (config_name, config_value) values ('freshinstall', 'True')"); */
}
if ($useglobalconfigsettings == "on"){

View File

@ -14,9 +14,7 @@
// NOTE: Please use spaces to seperate the field names. It makes copy and pasting easier.
$sql = "CREATE TABLE config (
config_name varchar(255) NOT NULL,
config_value varchar(100),
UNIQUE config_name (config_name)
config_string blob
)";
$db->query($sql);

View File

@ -732,8 +732,11 @@
if ($currentver == "0.9.7") {
// upgrade code starts here
$db->query("drop table config");
$db->query("CREATE TABLE config ( config_string blob )");
echo "<b>Note: You will need to re-submit your config data.</b>";
// upgrade code ends here
$currentver = "0.9.8pre1";
$currentver = "0.9.8pre2";
update_version_table();
}
/*

View File

@ -14,8 +14,7 @@
// NOTE: Please use spaces to seperate the field names. It makes copy and pasting easier.
$sql = "CREATE TABLE config (
config_name varchar(255) NOT NULL UNIQUE,
config_value varchar(100) NOT NULL
config_string text
)";
$db->query($sql);

View File

@ -745,9 +745,11 @@
if ($currentver == "0.9.7" || ereg ("^0\.9\.8pre", $currentver)){
if ($currentver == "0.9.7") {
// upgrade code starts here
$db->query("drop table config");
$db->query("CREATE TABLE config ( config_string text )");
echo "<b>Note: You will need to re-submit your config data.</b>";
// upgrade code ends here
$currentver = "0.9.8pre1";
$currentver = "0.9.8pre2";
update_version_table();
}
/*

View File

@ -11,5 +11,5 @@
/* $Id$ */
$phpgw_info["server"]["version"] = "0.9.8pre1";
$phpgw_info["server"]["version"] = "0.9.8pre2";
$phpgw_info["server"]["current_header_version"] = "1.5";