Renamed the config table to phpgw_config

This commit is contained in:
jengo 2001-02-08 19:34:14 +00:00
parent 10a2004c97
commit 015a627b1e
10 changed files with 100 additions and 78 deletions

View File

@ -74,7 +74,7 @@
global $phpgw_info, $phpgw;
/* ********This sets the server variables from the database******** */
/* $db->query("select * from config",__LINE__,__FILE__);
/* $db->query("select * from phpgw_config",__LINE__,__FILE__);
while ($db->next_record()) {
$phpgw_info["server"][$db->f("config_name")] = $db->f("config_value");
}

View File

@ -189,7 +189,7 @@
print_debug('main class loaded');
/* Fill phpgw_info["server"] array */
$phpgw->db->query("select * from config",__LINE__,__FILE__);
$phpgw->db->query("select * from phpgw_config",__LINE__,__FILE__);
while ($phpgw->db->next_record()) {
$phpgw_info["server"][$phpgw->db->f("config_name")] = stripslashes($phpgw->db->f("config_value"));
}

View File

@ -27,8 +27,10 @@
// Actual content
echo "<a href=\"" . $phpgw->link("changepassword.php") . "\">"
if ($phpgw->acl->check('changepassword',1)) {
echo "<a href=\"" . $phpgw->link("changepassword.php") . "\">"
. lang("change your password") . "</a>";
}
echo "<br><a href=\"" . $phpgw->link("settings.php") . "\">"
. lang("change your settings") . "</a>";
// echo "<br><a href=\"" . $phpgw->link("changeprofile.php") . "\">"

View File

@ -32,12 +32,12 @@
}
if ($submit) {
@$phpgw_setup->db->query("delete from config");
@$phpgw_setup->db->query("delete from phpgw_config");
// This is only temp.
$phpgw_setup->db->query("insert into config (config_name, config_value) values ('useframes','never')");
$phpgw_setup->db->query("insert into phpgw_config (config_name, config_value) values ('useframes','never')");
while ($newsetting = each($newsettings)) {
if ($newsetting[0] == "nntp_server") {
$phpgw_setup->db->query("select config_value FROM config WHERE config_name='nntp_server'");
$phpgw_setup->db->query("select config_value FROM phpgw_config WHERE config_name='nntp_server'");
if ($phpgw_setup->db->num_rows()) {
$phpgw_setup->db->next_record();
if ($phpgw_setup->db->f("config_value") <> $newsetting[1]) {
@ -46,7 +46,7 @@
}
}
}
$phpgw_setup->db->query("insert into config (config_name, config_value) values ('" . addslashes($newsetting[0])
$phpgw_setup->db->query("insert into phpgw_config (config_name, config_value) values ('" . addslashes($newsetting[0])
. "','" . addslashes($newsetting[1]) . "')");
}
if ($newsettings["auth_type"] == "ldap") {
@ -63,7 +63,7 @@
$phpgw_setup->show_header("Configuration");
}
@$phpgw_setup->db->query("select * from config");
@$phpgw_setup->db->query("select * from phpgw_config");
while (@$phpgw_setup->db->next_record()) {
$current_config[$phpgw_setup->db->f("config_name")] = $phpgw_setup->db->f("config_value");
}

View File

@ -20,78 +20,78 @@
function add_default_server_config(){
global $phpgw_info, $phpgw_setup;
$phpgw_setup->db->query("insert into config (config_name, config_value) values ('template_set', 'user_choice')");
$phpgw_setup->db->query("insert into config (config_name, config_value) values ('temp_dir', '/path/to/tmp')");
$phpgw_setup->db->query("insert into config (config_name, config_value) values ('files_dir', '/path/to/dir/phpgroupware/files')");
$phpgw_setup->db->query("insert into config (config_name, config_value) values ('encryptkey', 'change this phrase 2 something else')");
$phpgw_setup->db->query("insert into config (config_name, config_value) values ('site_title', 'phpGroupWare')");
$phpgw_setup->db->query("insert into config (config_name, config_value) values ('hostname', 'local.machine.name')");
$phpgw_setup->db->query("insert into config (config_name, config_value) values ('webserver_url', 'http://www.domain.com/phpgroupware')");
$phpgw_setup->db->query("insert into config (config_name, config_value) values ('auth_type', 'sql')");
$phpgw_setup->db->query("insert into config (config_name, config_value) values ('ldap_host', 'localhost')");
$phpgw_setup->db->query("insert into config (config_name, config_value) values ('ldap_context', 'ou=People,dc=my-domain,dc=com')");
$phpgw_setup->db->query("insert into config (config_name, config_value) values ('ldap_encryption_type', 'DES')");
$phpgw_setup->db->query("insert into config (config_name, config_value) values ('ldap_root_dn', 'cn=Manager,dc=my-domain,dc=com')");
$phpgw_setup->db->query("insert into config (config_name, config_value) values ('ldap_root_pw', 'secret')");
$phpgw_setup->db->query("insert into config (config_name, config_value) values ('usecookies', 'True')");
$phpgw_setup->db->query("insert into config (config_name, config_value) values ('mail_server', 'localhost')");
$phpgw_setup->db->query("insert into config (config_name, config_value) values ('mail_server_type', 'imap')");
$phpgw_setup->db->query("insert into config (config_name, config_value) values ('imap_server_type', 'Cyrus')");
$phpgw_setup->db->query("insert into config (config_name, config_value) values ('mail_suffix', 'yourdomain.com')");
$phpgw_setup->db->query("insert into config (config_name, config_value) values ('mail_login_type', 'standard')");
$phpgw_setup->db->query("insert into config (config_name, config_value) values ('smtp_server', 'localhost')");
$phpgw_setup->db->query("insert into config (config_name, config_value) values ('smtp_port', '25')");
$phpgw_setup->db->query("insert into config (config_name, config_value) values ('nntp_server', 'yournewsserver.com')");
$phpgw_setup->db->query("insert into config (config_name, config_value) values ('nntp_port', '119')");
$phpgw_setup->db->query("insert into config (config_name, config_value) values ('nntp_sender', 'complaints@yourserver.com')");
$phpgw_setup->db->query("insert into config (config_name, config_value) values ('nntp_organization', 'phpGroupWare')");
$phpgw_setup->db->query("insert into config (config_name, config_value) values ('nntp_admin', 'admin@yourserver.com')");
$phpgw_setup->db->query("insert into config (config_name, config_value) values ('nntp_login_username', '')");
$phpgw_setup->db->query("insert into config (config_name, config_value) values ('nntp_login_password', '')");
$phpgw_setup->db->query("insert into config (config_name, config_value) values ('charset', 'iso-8859-1')");
$phpgw_setup->db->query("insert into config (config_name, config_value) values ('default_ftp_server', 'localhost')");
$phpgw_setup->db->query("insert into config (config_name, config_value) values ('httpproxy_server', '')");
$phpgw_setup->db->query("insert into config (config_name, config_value) values ('httpproxy_port', '')");
$phpgw_setup->db->query("insert into config (config_name, config_value) values ('showpoweredbyon', 'bottom')");
$phpgw_setup->db->query("insert into config (config_name, config_value) values ('htmlcompliant', 'False')");
$phpgw_setup->db->query("insert into config (config_name, config_value) values ('checkfornewversion', 'False')");
$phpgw_setup->db->query("insert into config (config_name, config_value) values ('freshinstall', 'True')");
$phpgw_setup->db->query("insert into phpgw_config (config_name, config_value) values ('template_set', 'user_choice')");
$phpgw_setup->db->query("insert into phpgw_config (config_name, config_value) values ('temp_dir', '/path/to/tmp')");
$phpgw_setup->db->query("insert into phpgw_config (config_name, config_value) values ('files_dir', '/path/to/dir/phpgroupware/files')");
$phpgw_setup->db->query("insert into phpgw_config (config_name, config_value) values ('encryptkey', 'change this phrase 2 something else')");
$phpgw_setup->db->query("insert into phpgw_config (config_name, config_value) values ('site_title', 'phpGroupWare')");
$phpgw_setup->db->query("insert into phpgw_config (config_name, config_value) values ('hostname', 'local.machine.name')");
$phpgw_setup->db->query("insert into phpgw_config (config_name, config_value) values ('webserver_url', 'http://www.domain.com/phpgroupware')");
$phpgw_setup->db->query("insert into phpgw_config (config_name, config_value) values ('auth_type', 'sql')");
$phpgw_setup->db->query("insert into phpgw_config (config_name, config_value) values ('ldap_host', 'localhost')");
$phpgw_setup->db->query("insert into phpgw_config (config_name, config_value) values ('ldap_context', 'ou=People,dc=my-domain,dc=com')");
$phpgw_setup->db->query("insert into phpgw_config (config_name, config_value) values ('ldap_encryption_type', 'DES')");
$phpgw_setup->db->query("insert into phpgw_config (config_name, config_value) values ('ldap_root_dn', 'cn=Manager,dc=my-domain,dc=com')");
$phpgw_setup->db->query("insert into phpgw_config (config_name, config_value) values ('ldap_root_pw', 'secret')");
$phpgw_setup->db->query("insert into phpgw_config (config_name, config_value) values ('usecookies', 'True')");
$phpgw_setup->db->query("insert into phpgw_config (config_name, config_value) values ('mail_server', 'localhost')");
$phpgw_setup->db->query("insert into phpgw_config (config_name, config_value) values ('mail_server_type', 'imap')");
$phpgw_setup->db->query("insert into phpgw_config (config_name, config_value) values ('imap_server_type', 'Cyrus')");
$phpgw_setup->db->query("insert into phpgw_config (config_name, config_value) values ('mail_suffix', 'yourdomain.com')");
$phpgw_setup->db->query("insert into phpgw_config (config_name, config_value) values ('mail_login_type', 'standard')");
$phpgw_setup->db->query("insert into phpgw_config (config_name, config_value) values ('smtp_server', 'localhost')");
$phpgw_setup->db->query("insert into phpgw_config (config_name, config_value) values ('smtp_port', '25')");
$phpgw_setup->db->query("insert into phpgw_config (config_name, config_value) values ('nntp_server', 'yournewsserver.com')");
$phpgw_setup->db->query("insert into phpgw_config (config_name, config_value) values ('nntp_port', '119')");
$phpgw_setup->db->query("insert into phpgw_config (config_name, config_value) values ('nntp_sender', 'complaints@yourserver.com')");
$phpgw_setup->db->query("insert into phpgw_config (config_name, config_value) values ('nntp_organization', 'phpGroupWare')");
$phpgw_setup->db->query("insert into phpgw_config (config_name, config_value) values ('nntp_admin', 'admin@yourserver.com')");
$phpgw_setup->db->query("insert into phpgw_config (config_name, config_value) values ('nntp_login_username', '')");
$phpgw_setup->db->query("insert into phpgw_config (config_name, config_value) values ('nntp_login_password', '')");
$phpgw_setup->db->query("insert into phpgw_config (config_name, config_value) values ('charset', 'iso-8859-1')");
$phpgw_setup->db->query("insert into phpgw_config (config_name, config_value) values ('default_ftp_server', 'localhost')");
$phpgw_setup->db->query("insert into phpgw_config (config_name, config_value) values ('httpproxy_server', '')");
$phpgw_setup->db->query("insert into phpgw_config (config_name, config_value) values ('httpproxy_port', '')");
$phpgw_setup->db->query("insert into phpgw_config (config_name, config_value) values ('showpoweredbyon', 'bottom')");
$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')");
}
if ($useglobalconfigsettings == "on"){
if (is_file($basedir)){
include ($phpgw_info["server"]["include_root"]."/globalconfig.inc.php");
$phpgw_setup->db->query("insert into config (config_name, config_value) values ('template_set', '".$phpgw_info["server"]["template_set"]."')");
$phpgw_setup->db->query("insert into config (config_name, config_value) values ('temp_dir', '".$phpgw_info["server"]["temp_dir"]."')");
$phpgw_setup->db->query("insert into config (config_name, config_value) values ('files_dir', '".$phpgw_info["server"]["files_dir"]."')");
$phpgw_setup->db->query("insert into config (config_name, config_value) values ('encryptkey', '".$phpgw_info["server"]["encryptkey"]."')");
$phpgw_setup->db->query("insert into config (config_name, config_value) values ('site_title', '".$phpgw_info["server"]["site_title"]."')");
$phpgw_setup->db->query("insert into config (config_name, config_value) values ('hostname', '".$phpgw_info["server"]["hostname"]."')");
$phpgw_setup->db->query("insert into config (config_name, config_value) values ('webserver_url', '".$phpgw_info["server"]["webserver_url"].")");
$phpgw_setup->db->query("insert into config (config_name, config_value) values ('auth_type', '".$phpgw_info["server"]["auth_type"]."')");
$phpgw_setup->db->query("insert into config (config_name, config_value) values ('ldap_host', '".$phpgw_info["server"]["ldap_host"]."')");
$phpgw_setup->db->query("insert into config (config_name, config_value) values ('ldap_context', '".$phpgw_info["server"]["ldap_context"]."')");
$phpgw_setup->db->query("insert into config (config_name, config_value) values ('usecookies', '".$phpgw_info["server"]["usecookies"]."')");
$phpgw_setup->db->query("insert into config (config_name, config_value) values ('mail_server', '".$phpgw_info["server"]["mail_server"]."')");
$phpgw_setup->db->query("insert into config (config_name, config_value) values ('mail_server_type', '".$phpgw_info["server"]["mail_server_type"]."')");
$phpgw_setup->db->query("insert into config (config_name, config_value) values ('imap_server_type', '".$phpgw_info["server"]["imap_server_type"]."')");
$phpgw_setup->db->query("insert into config (config_name, config_value) values ('mail_suffix', '".$phpgw_info["server"]["mail_suffix"]."')");
$phpgw_setup->db->query("insert into config (config_name, config_value) values ('mail_login_type', '".$phpgw_info["server"]["mail_login_type"]."')");
$phpgw_setup->db->query("insert into config (config_name, config_value) values ('smtp_server', '".$phpgw_info["server"]["smtp_server"]."')");
$phpgw_setup->db->query("insert into config (config_name, config_value) values ('smtp_port', '".$phpgw_info["server"]["smtp_port"]."')");
$phpgw_setup->db->query("insert into config (config_name, config_value) values ('nntp_server', '".$phpgw_info["server"]["nntp_server"]."')");
$phpgw_setup->db->query("insert into config (config_name, config_value) values ('nntp_port', '".$phpgw_info["server"]["nntp_port"]."')");
$phpgw_setup->db->query("insert into config (config_name, config_value) values ('nntp_sender', '".$phpgw_info["server"]["nntp_sender"]."')");
$phpgw_setup->db->query("insert into config (config_name, config_value) values ('nntp_organization', '".$phpgw_info["server"]["nntp_organization"]."')");
$phpgw_setup->db->query("insert into config (config_name, config_value) values ('nntp_admin', '".$phpgw_info["server"]["nntp_admin"]."')");
$phpgw_setup->db->query("insert into config (config_name, config_value) values ('nntp_login_username', '".$phpgw_info["server"]["nntp_login_username"]."')");
$phpgw_setup->db->query("insert into config (config_name, config_value) values ('nntp_login_password', '".$phpgw_info["server"]["nntp_login_password"]."')");
$phpgw_setup->db->query("insert into config (config_name, config_value) values ('charset', '".$phpgw_info["server"]["charset"]."')");
$phpgw_setup->db->query("insert into config (config_name, config_value) values ('default_ftp_server', '".$phpgw_info["server"]["default_ftp_server"]."')");
$phpgw_setup->db->query("insert into config (config_name, config_value) values ('httpproxy_server', '".$phpgw_info["server"]["httpproxy_server"]."')");
$phpgw_setup->db->query("insert into config (config_name, config_value) values ('httpproxy_port', '".$phpgw_info["server"]["httpproxy_port"]."')");
$phpgw_setup->db->query("insert into config (config_name, config_value) values ('showpoweredbyon', '".$phpgw_info["server"]["showpoweredbyon"]."')");
$phpgw_setup->db->query("insert into config (config_name, config_value) values ('checkfornewversion', '".$phpgw_info["server"]["checkfornewversion"]."')");
$phpgw_setup->db->query("insert into phpgw_config (config_name, config_value) values ('template_set', '".$phpgw_info["server"]["template_set"]."')");
$phpgw_setup->db->query("insert into phpgw_config (config_name, config_value) values ('temp_dir', '".$phpgw_info["server"]["temp_dir"]."')");
$phpgw_setup->db->query("insert into phpgw_config (config_name, config_value) values ('files_dir', '".$phpgw_info["server"]["files_dir"]."')");
$phpgw_setup->db->query("insert into phpgw_config (config_name, config_value) values ('encryptkey', '".$phpgw_info["server"]["encryptkey"]."')");
$phpgw_setup->db->query("insert into phpgw_config (config_name, config_value) values ('site_title', '".$phpgw_info["server"]["site_title"]."')");
$phpgw_setup->db->query("insert into phpgw_config (config_name, config_value) values ('hostname', '".$phpgw_info["server"]["hostname"]."')");
$phpgw_setup->db->query("insert into phpgw_config (config_name, config_value) values ('webserver_url', '".$phpgw_info["server"]["webserver_url"].")");
$phpgw_setup->db->query("insert into phpgw_config (config_name, config_value) values ('auth_type', '".$phpgw_info["server"]["auth_type"]."')");
$phpgw_setup->db->query("insert into phpgw_config (config_name, config_value) values ('ldap_host', '".$phpgw_info["server"]["ldap_host"]."')");
$phpgw_setup->db->query("insert into phpgw_config (config_name, config_value) values ('ldap_context', '".$phpgw_info["server"]["ldap_context"]."')");
$phpgw_setup->db->query("insert into phpgw_config (config_name, config_value) values ('usecookies', '".$phpgw_info["server"]["usecookies"]."')");
$phpgw_setup->db->query("insert into phpgw_config (config_name, config_value) values ('mail_server', '".$phpgw_info["server"]["mail_server"]."')");
$phpgw_setup->db->query("insert into phpgw_config (config_name, config_value) values ('mail_server_type', '".$phpgw_info["server"]["mail_server_type"]."')");
$phpgw_setup->db->query("insert into phpgw_config (config_name, config_value) values ('imap_server_type', '".$phpgw_info["server"]["imap_server_type"]."')");
$phpgw_setup->db->query("insert into phpgw_config (config_name, config_value) values ('mail_suffix', '".$phpgw_info["server"]["mail_suffix"]."')");
$phpgw_setup->db->query("insert into phpgw_config (config_name, config_value) values ('mail_login_type', '".$phpgw_info["server"]["mail_login_type"]."')");
$phpgw_setup->db->query("insert into phpgw_config (config_name, config_value) values ('smtp_server', '".$phpgw_info["server"]["smtp_server"]."')");
$phpgw_setup->db->query("insert into phpgw_config (config_name, config_value) values ('smtp_port', '".$phpgw_info["server"]["smtp_port"]."')");
$phpgw_setup->db->query("insert into phpgw_config (config_name, config_value) values ('nntp_server', '".$phpgw_info["server"]["nntp_server"]."')");
$phpgw_setup->db->query("insert into phpgw_config (config_name, config_value) values ('nntp_port', '".$phpgw_info["server"]["nntp_port"]."')");
$phpgw_setup->db->query("insert into phpgw_config (config_name, config_value) values ('nntp_sender', '".$phpgw_info["server"]["nntp_sender"]."')");
$phpgw_setup->db->query("insert into phpgw_config (config_name, config_value) values ('nntp_organization', '".$phpgw_info["server"]["nntp_organization"]."')");
$phpgw_setup->db->query("insert into phpgw_config (config_name, config_value) values ('nntp_admin', '".$phpgw_info["server"]["nntp_admin"]."')");
$phpgw_setup->db->query("insert into phpgw_config (config_name, config_value) values ('nntp_login_username', '".$phpgw_info["server"]["nntp_login_username"]."')");
$phpgw_setup->db->query("insert into phpgw_config (config_name, config_value) values ('nntp_login_password', '".$phpgw_info["server"]["nntp_login_password"]."')");
$phpgw_setup->db->query("insert into phpgw_config (config_name, config_value) values ('charset', '".$phpgw_info["server"]["charset"]."')");
$phpgw_setup->db->query("insert into phpgw_config (config_name, config_value) values ('default_ftp_server', '".$phpgw_info["server"]["default_ftp_server"]."')");
$phpgw_setup->db->query("insert into phpgw_config (config_name, config_value) values ('httpproxy_server', '".$phpgw_info["server"]["httpproxy_server"]."')");
$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"]."')");
}else{
echo "<table border=\"0\" align=\"center\">\n";
echo " <tr bgcolor=\"486591\">\n";

View File

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

View File

@ -960,6 +960,16 @@
$phpgw_info["setup"]["currentver"]["phpgwapi"] = "0.9.10pre6";
}
$test[] = "0.9.10pre6";
function upgrade0_9_10pre6()
{
global $phpgw_info, $phpgw_setup;
$phpgw_setup->db->query("alter table config rename phpgw_config",__LINE__,__FILE__);
$phpgw_info["setup"]["currentver"]["phpgwapi"] = "0.9.10pre7";
}
reset ($test);
while (list ($key, $value) = each ($test)){
if ($phpgw_info["setup"]["currentver"]["phpgwapi"] == $value) {

View File

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

View File

@ -1014,6 +1014,16 @@
$phpgw_info["setup"]["currentver"]["phpgwapi"] = "0.9.10pre6";
}
$test[] = "0.9.10pre6";
function upgrade0_9_10pre6()
{
global $phpgw_info, $phpgw_setup;
$phpgw_setup->db->query("alter table config rename phpgw_config",__LINE__,__FILE__);
$phpgw_info["setup"]["currentver"]["phpgwapi"] = "0.9.10pre7";
}
reset ($test);
while (list ($key, $value) = each ($test)){
if ($phpgw_info["setup"]["currentver"]["phpgwapi"] == $value) {

View File

@ -11,5 +11,5 @@
/* $Id$ */
$phpgw_info["server"]["versions"]["phpgwapi"] = "0.9.10pre6";
$phpgw_info["server"]["versions"]["phpgwapi"] = "0.9.10pre7";
$phpgw_info["server"]["versions"]["current_header"] = "1.11";