<?php
/* This file is part of the FiForms Framework
Copyright (C) 2003-2008 by Daniel McFeeters,
Licensed under the GNU GPL.
See LICENSE.txt for details.
*/
if(file_exists('localconfig.php'))
{
include_once('localconfig.php');
}
else
{
include_once('localconfig.php.default');
}
$checkpass = true;
$configpath = dirname(dirname(__FILE__))."/FiForms-includes";
if(!file_exists('localconfig.php') && $_POST['config_path'])
{
$configpath = $_POST['config_path'];
}
if(file_exists($configpath."/FiForms_global.inc.php"))
{
include_once($configpath."/FiForms_genericIcons.inc.php");
include_once($configpath."/FiForms_global.inc.php");
}
else
{
include_once('promptpage.php');
promptPage("Looking For FiForms Includes",<<<EOD
<p>
The FiForms Setup program is looking for the path to the FiForms Framework includes (normally called FiForms-includes) on your server, but could not find it at $configpath. Please enter the path below:
</p>
<form method="post">
Path: <input action="editConfig.php" name="config_path" size="80" /><br /><br />
<input type="submit" value="Continue to Setup" />
</form>
EOD
,"2%","2%","96%");
die();
}
require_once("authenticate.php");
require_once("promptpage.php");
$CONFIG_COPY = $FIFORMS_CONFIG;
$output = '';
$output .= "
<script type=\"text/javascript\">
var url;
var newwindow;
function fipopup(url)
{
newwindow=window.open(url,'FiPopup','menubar,scrollbars,resizable,height=400,width=850');
if (window.focus) {newwindow.focus()}
}
</script>
<p>
Welcome to the FiForms configuration screen. On this page,
you can set many parameters that affect the behavior of
FiForms. These should be set to reasonable defaults already,
so if you are new to FiForms, you can leave most of these
as they are. However, you should at least set the
<b>Online Administrator Password</b> so that you can access
administrations functions (such as this one) from the browser,
and also set the ENCRYPT_KEY at the bottom of this page
to some random data or password, so that record change
merging will function properly. When you are satisfied with
this configuration, click \"Save Configuration\" at the bottom
of this page.
</p><hr>
<form method=\"POST\" action=\"createConfig.php\">";
if($_POST['config_path'])
{
$output .= "<input type=\"hidden\" name=\"config_path\" value=\"". $_POST['config_path']."\" />";
}
$output .= "<p>
<a href=\"javascript:fipopup('http://wiki.fiforms.org/index.php/Configuration#OS');\">
<b>OS</b></a>
<br />". $CONFIG_COPY['OS']."</p>";
$output .= "<p>
<a href=\"javascript:fipopup('http://wiki.fiforms.org/index.php/Configuration#VERSION');\">
<b>VERSION</b></a>
<br />". $CONFIG_COPY['VERSION']."</p>";
$output .= "<h2>Path Configuration<hr /></h2>";
$output .= "<p><a href=\"javascript:fipopup('http://wiki.fiforms.org/index.php/Configuration#SCRIPT_PATH');\">
<b>SCRIPT_PATH</b></a><br />
<input type=\"text\" name=\"SCRIPT_PATH\" size=\"100\" value=\"". $CONFIG_COPY['SCRIPT_PATH']."\" /></p>";
$output .= "<p><a href=\"javascript:fipopup('http://wiki.fiforms.org/index.php/Configuration#INCLUDE_PATH');\">
<b>INCLUDE_PATH</b></a><br />
<input type=\"text\" name=\"INCLUDE_PATH\" size=\"100\" value=\"". $CONFIG_COPY['INCLUDE_PATH']."\" /></p>";
$output .= "<p>
<a href=\"javascript:fipopup('http://wiki.fiforms.org/index.php/Configuration#APP_BASE');\">
<b>APP_BASE</b></a><br />
<input type=\"text\" name=\"APP_BASE\" size=\"100\" value=\"". $CONFIG_COPY['APP_BASE']."\" /></p>";
$output .= "<p>
<a href=\"javascript:fipopup('http://wiki.fiforms.org/index.php/Configuration#AUTH_MODULE');\">
<b>AUTH_MODULE</b></a><br />
<input type=\"text\" name=\"AUTH_MODULE\" size=\"100\" value=\"". $CONFIG_COPY['AUTH_MODULE']."\" /></p>";
$output .= "<p>
<a href=\"javascript:fipopup('http://wiki.fiforms.org/index.php/Configuration#TEMP_PATH');\">
<b>TEMP_PATH</b></a><br />
<input type=\"text\" name=\"TEMP_PATH\" size=\"100\" value=\"". $CONFIG_COPY['TEMP_PATH']."\" /></p>";
$output .= "<p>
<a href=\"javascript:fipopup('http://wiki.fiforms.org/index.php/Configuration#XSLTPROC');\">
<b>XSLTPROC</b></a><br />
<input type=\"text\" name=\"XSLTPROC\" size=\"100\" value=\"". $CONFIG_COPY['XSLTPROC']."\" /></p>";
$output .= "<p>
<a href=\"javascript:fipopup('http://wiki.fiforms.org/index.php/Configuration#UNZIP');\">
<b>UNZIP</b></a><br />
<input type=\"text\" name=\"UNZIP\" size=\"100\" value=\"". $CONFIG_COPY['UNZIP']."\" /></p>";
$output .= "<p>
<a href=\"javascript:fipopup('http://wiki.fiforms.org/index.php/Configuration#MYSQLDUMP');\">
<b>MYSQLDUMP</b></a><br />
<input type=\"text\" name=\"MYSQLDUMP\" size=\"100\" value=\"". $CONFIG_COPY['MYSQLDUMP']."\" /></p>";
$output .= "<p>
<a href=\"javascript:fipopup('http://wiki.fiforms.org/index.php/Configuration#SERVER_ADDRESS');\">
<b>SERVER_ADDRESS</b></a><br />
<input type=\"text\" name=\"SERVER_ADDRESS\" size=\"100\" value=\"". $CONFIG_COPY['SERVER_ADDRESS']."\" /></p>";
$output .= "<p>
<a href=\"javascript:fipopup('http://wiki.fiforms.org/index.php/Configuration#URI');\">
<b>URI</b></a><br />
<input type=\"text\" name=\"URI\" size=\"100\" value=\"". $CONFIG_COPY['URI']."\" /></p>";
$output .= "<p>
<a href=\"javascript:fipopup('http://wiki.fiforms.org/index.php/Configuration#DEFAULT_SERVER');\">
<b>DEFAULT_SERVER</b></a><br />
<input type=\"text\" name=\"DEFAULT_SERVER\" size=\"100\" value=\"". $CONFIG_COPY['DEFAULT_SERVER']."\" /></p>";
$output .= "<h2>Online Administration Configuration<hr /></h2>";
$output .= "<p>
<a href=\"javascript:fipopup('http://wiki.fiforms.org/index.php/Configuration#UPDATEPW_HASH');\">
<b>Online Administrator Password (UPDATEPW_HASH)</b></a><br />
Enter Password:<br />
<input type=\"password\" name=\"UPDATEPW\" size=\"100\" /><br />
Confirm Password: <br />
<input type=\"password\" name=\"UPDATEPW_CONFIRM\" size=\"100\" /></p>";
$output .= "<p>
<a href=\"javascript:fipopup('http://wiki.fiforms.org/index.php/Configuration#UPDATE_HOST');\">
<b>UPDATE_HOST</b></a><br />
<input type=\"text\" name=\"UPDATE_HOST\" size=\"100\" value=\"". $CONFIG_COPY['UPDATE_HOST']."\" /></p>";
$output .= "<h2>HTTP Report Server Configuration<hr /></h2>";
$output .= "<p>
<a href=\"javascript:fipopup('http://wiki.fiforms.org/index.php/Configuration#ALLOW_USER_QUERIES');\">
<b>ALLOW_USER_QUERIES</b></a><br />
<input type=\"text\" name=\"ALLOW_USER_QUERIES\" size=\"100\" value=\"". $CONFIG_COPY['ALLOW_USER_QUERIES']."\" /></p>";
$output .= "<p>
<a href=\"javascript:fipopup('http://wiki.fiforms.org/index.php/Configuration#ALLOWED_SERVERS');\">
<b>ALLOWED_SERVERS</b></a><br />
<input type=\"text\" name=\"ALLOWED_SERVERS\" size=\"100\" value=\"". $CONFIG_COPY['ALLOWED_SERVERS']."\" /></p>";
$output .= "<h2>Debugging Options<hr /></h2>";
$output .= "<p>
<a href=\"javascript:fipopup('http://wiki.fiforms.org/index.php/Configuration#QUERY_DEBUGGING');\">
<b>QUERY_DEBUGGING</b></a><br />
<input type=\"checkbox\" name=\"QUERY_DEBUGGING\"". ($CONFIG_COPY['QUERY_DEBUGGING'] ? "checked=\"checked\"" : "")." /></p>";
$output .= "<p>
<a href=\"javascript:fipopup('http://wiki.fiforms.org/index.php/Configuration#SHOW_DEFINITION');\">
<b>SHOW_DEFINITION</b></a><br />
<input type=\"checkbox\" name=\"SHOW_DEFINITION\"". ($CONFIG_COPY['SHOW_DEFINITION'] ? "checked=\"checked\"" : "")." /></p>";
$output .= "<p>
<a href=\"javascript:fipopup('http://wiki.fiforms.org/index.php/Configuration#USE_XHTML');\">
<b>USE_XHTML</b></a><br />
<input type=\"checkbox\" name=\"USE_XHTML\"". ($CONFIG_COPY['USE_XHTML'] ? "checked=\"checked\"" : "")." /></p>";
$output .= "<h2>Miscellaneous Configuration<hr /></h2>";
$output .= "<p>
<a href=\"javascript:fipopup('http://wiki.fiforms.org/index.php/Configuration#PHP_XSLT');\">
<b>PHP_XSLT</b></a><br />
<input type=\"checkbox\" name=\"PHP_XSLT\"". ($CONFIG_COPY['PHP_XSLT'] ? "checked=\"checked\"" : "")." /></p>";
$output .= "<p>
<a href=\"javascript:fipopup('http://wiki.fiforms.org/index.php/Configuration#DEFAULT_LIMIT');\">
<b>DEFAULT_LIMIT</b></a><br />
<input type=\"text\" name=\"DEFAULT_LIMIT\" size=\"100\" value=\"". $CONFIG_COPY['DEFAULT_LIMIT']."\" /></p>";
$output .= "<p>
<a href=\"javascript:fipopup('http://wiki.fiforms.org/index.php/Configuration#ICON_SET');\">
<b>ICON_SET</b></a><br />
<input type=\"text\" name=\"ICON_SET\" size=\"100\" value=\"". $CONFIG_COPY['ICON_SET']."\" /></p>";
$output .= "<p>
<a href=\"javascript:fipopup('http://wiki.fiforms.org/index.php/Configuration#MENU_POPUPS');\">
<b>MENU_POPUPS</b></a><br />
<select name=\"MENU_POPUPS\"><option ".($CONFIG_COPY['MENU_POPUPS'] == 'new' ? ' selected="selected" ' : '').">new</option><option ".($CONFIG_COPY['MENU_POPUPS'] == 'new' ? '' : ' selected="selected" ').">default</option></select></p>";
$output .= "<p>
<a href=\"javascript:fipopup('http://wiki.fiforms.org/index.php/Configuration#DEFAULT_HEADER');\">
<b>DEFAULT_HEADER</b></a><br />
<input type=\"text\" name=\"DEFAULT_HEADER\" size=\"100\" value=\"". $CONFIG_COPY['DEFAULT_HEADER']."\" /></p>";
$output .= "<p>
<a href=\"javascript:fipopup('http://wiki.fiforms.org/index.php/Configuration#AUTH_REALM');\">
<b>AUTH_REALM</b></a><br />
<input type=\"text\" name=\"AUTH_REALM\" size=\"100\" value=\"". $CONFIG_COPY['AUTH_REALM']."\" /></p>";
$output .= "<p>
<a href=\"javascript:fipopup('http://wiki.fiforms.org/index.php/Configuration#ENCRYPT_KEY');\">
<b>ENCRYPT_KEY</b></a><br />
<input type=\"text\" name=\"ENCRYPT_KEY\" size=\"100\" value=\"". $CONFIG_COPY['ENCRYPT_KEY']."\" /></p>";
$output .= "<input type=\"hidden\" name=\"password\" value=\"". $_POST['password']."\" />";
$output .= "<input type=\"submit\" value=\"Save Configuration\">";
$output .= "</form>";
promptPage("Configuration",$output,
"2%","2%","96%");
?>