2000-09-28 03:59:21 +02:00
|
|
|
<?php
|
|
|
|
/**************************************************************************\
|
2000-11-05 07:47:24 +01:00
|
|
|
* phpGroupWare - Setup *
|
2000-09-28 03:59:21 +02:00
|
|
|
* http://www.phpgroupware.org *
|
|
|
|
* -------------------------------------------- *
|
|
|
|
* This program is free software; you can redistribute it and/or modify it *
|
|
|
|
* under the terms of the GNU General Public License as published by the *
|
|
|
|
* Free Software Foundation; either version 2 of the License, or (at your *
|
|
|
|
* option) any later version. *
|
|
|
|
\**************************************************************************/
|
|
|
|
|
|
|
|
/* $Id$ */
|
|
|
|
|
2000-12-14 07:38:47 +01:00
|
|
|
$phpgw_info["flags"] = array("noheader" => True, "nonavbar" => True, "currentapp" => "home", "noapi" => True);
|
2000-12-01 19:25:01 +01:00
|
|
|
include("./inc/functions.inc.php");
|
2000-09-28 03:59:21 +02:00
|
|
|
include("../header.inc.php");
|
|
|
|
|
2000-11-22 09:34:19 +01:00
|
|
|
// Authorize the user to use setup app and load the database
|
2000-09-28 16:28:34 +02:00
|
|
|
// Does not return unless user is authorized
|
2000-12-27 23:04:44 +01:00
|
|
|
if (!$phpgw_setup->auth("Config")){
|
2000-12-01 19:25:01 +01:00
|
|
|
Header("Location: index.php");
|
|
|
|
exit;
|
|
|
|
}
|
2000-12-27 10:05:13 +01:00
|
|
|
$phpgw_setup->loaddb();
|
2000-09-28 04:32:53 +02:00
|
|
|
|
2000-12-04 09:45:30 +01:00
|
|
|
/* Guessing default paths. */
|
|
|
|
$current_config["files_dir"] = ereg_replace("/setup","/files",dirname($SCRIPT_FILENAME));
|
|
|
|
if (is_dir("/tmp")){
|
|
|
|
$current_config["temp_dir"] = "/tmp";
|
|
|
|
}else{
|
|
|
|
$current_config["temp_dir"] = "/path/to/temp/dir";
|
|
|
|
}
|
|
|
|
|
2000-09-28 04:32:53 +02:00
|
|
|
if ($submit) {
|
2001-02-08 20:34:14 +01:00
|
|
|
@$phpgw_setup->db->query("delete from phpgw_config");
|
2001-01-10 04:08:03 +01:00
|
|
|
// This is only temp.
|
2001-02-08 20:34:14 +01:00
|
|
|
$phpgw_setup->db->query("insert into phpgw_config (config_name, config_value) values ('useframes','never')");
|
2001-01-10 04:08:03 +01:00
|
|
|
while ($newsetting = each($newsettings)) {
|
|
|
|
if ($newsetting[0] == "nntp_server") {
|
2001-02-08 20:34:14 +01:00
|
|
|
$phpgw_setup->db->query("select config_value FROM phpgw_config WHERE config_name='nntp_server'");
|
2001-01-10 04:08:03 +01:00
|
|
|
if ($phpgw_setup->db->num_rows()) {
|
|
|
|
$phpgw_setup->db->next_record();
|
|
|
|
if ($phpgw_setup->db->f("config_value") <> $newsetting[1]) {
|
|
|
|
$phpgw_setup->db->query("DELETE FROM newsgroups");
|
2001-01-01 00:46:55 +01:00
|
|
|
// $phpgw_setup->db->query("DELETE FROM users_newsgroups");
|
2001-01-10 04:08:03 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2001-02-08 20:34:14 +01:00
|
|
|
$phpgw_setup->db->query("insert into phpgw_config (config_name, config_value) values ('" . addslashes($newsetting[0])
|
2001-01-10 04:08:03 +01:00
|
|
|
. "','" . addslashes($newsetting[1]) . "')");
|
2000-12-14 07:38:47 +01:00
|
|
|
}
|
2000-12-01 21:07:23 +01:00
|
|
|
if ($newsettings["auth_type"] == "ldap") {
|
|
|
|
Header("Location: ldap.php");
|
|
|
|
exit;
|
|
|
|
} else {
|
|
|
|
//echo "<center>Your config has been updated<br><a href='".$newsettings["webserver_url"]."/login.php'>Click here to login</a>";
|
|
|
|
Header("Location: index.php");
|
|
|
|
exit;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($newsettings["auth_type"] != "ldap") {
|
2000-12-27 10:05:13 +01:00
|
|
|
$phpgw_setup->show_header("Configuration");
|
2000-09-28 04:32:53 +02:00
|
|
|
}
|
|
|
|
|
2001-02-08 20:34:14 +01:00
|
|
|
@$phpgw_setup->db->query("select * from phpgw_config");
|
2000-12-27 10:05:13 +01:00
|
|
|
while (@$phpgw_setup->db->next_record()) {
|
|
|
|
$current_config[$phpgw_setup->db->f("config_name")] = $phpgw_setup->db->f("config_value");
|
2000-12-14 07:38:47 +01:00
|
|
|
}
|
2000-12-12 17:39:18 +01:00
|
|
|
|
|
|
|
if ($current_config["files_dir"] == "/path/to/dir/phpgroupware/files") {
|
|
|
|
$current_config["files_dir"] = $phpgw_info["server"]["server_root"] . "/files";
|
|
|
|
}
|
|
|
|
|
2000-11-17 16:35:25 +01:00
|
|
|
|
|
|
|
if ($error == "badldapconnection") {
|
|
|
|
// Please check the number and dial again :)
|
|
|
|
echo "<br><center><b>Error:</b> There was a problem tring to connect to your LDAP server, please "
|
|
|
|
. "check your config.</center>";
|
|
|
|
}
|
|
|
|
|
2000-09-28 04:32:53 +02:00
|
|
|
?>
|
2000-09-28 03:59:21 +02:00
|
|
|
<form method="POST" action="config.php">
|
2000-09-28 06:38:04 +02:00
|
|
|
<table border="0" align="center">
|
|
|
|
|
2001-01-07 11:43:48 +01:00
|
|
|
<?php
|
2001-01-08 19:51:39 +01:00
|
|
|
$phpgw_setup->execute_script("config",array("phpgwapi","admin", "preferences","email"));
|
2001-01-07 11:43:48 +01:00
|
|
|
?>
|
2000-09-28 06:38:04 +02:00
|
|
|
|
|
|
|
<tr bgcolor="FFFFFF">
|
|
|
|
<td colspan="2"> </td>
|
|
|
|
</tr>
|
|
|
|
|
2000-09-28 03:59:21 +02:00
|
|
|
<tr>
|
|
|
|
<td colspan="2" align="center"><input type="submit" name="submit" value="Submit"></td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
2000-09-28 16:28:34 +02:00
|
|
|
</form>
|
|
|
|
</body></html>
|