).
** This warning is here for people first installing FreeTrade, so
** once you pass this test, feel free to remove the test.
*/
if(get_magic_quotes_gpc() == 1)
{
print("Warning: magic_quotes_gpc needs to be off for FreeTrade to function properly.
\n");
exit();
}
/*
** Get the name of the server, file path, URI and script name
**
** We need to set the following four constants:
** SERVER_NAME -- just the name of the server, like www.mystore.com
** SCRIPT_NAME -- just the name of the store script, which is index.php3 by default
** APPLICATION_ROOT -- The path on the Web server's filesystem where the modules
** directory is found, like /www/
** EXTERNAL_PATH -- The path from the root of the Web site to the index script.
**
** These values are being set with environment variables that work with Apache
** for Unix where PHP is compiled as a module.
**
** As far as it is known, $SERVER_NAME and $SCRIPT_NAME are supported by Apache
** on Unix and Windows, as well as IIS. You may have to look at phpinfo() to
** figure out the exact settings for your Web server. You can always hardcode
** these values, and doing so will make the script a tiny bit faster.
**
** Note that
** define("APPLICATION_ROOT", dirname(dirname(__FILE__)));
** is finding the parent of the current directory.
*/
define("SERVER_NAME", $SERVER_NAME);
define("SCRIPT_NAME", basename(__FILE__));
define("APPLICATION_ROOT", dirname(dirname(__FILE__)));
define("EXTERNAL_PATH", dirname($SCRIPT_NAME) . "/");
/*
** get global settings
*/
include(APPLICATION_ROOT . "/modules/include/global_settings");
/*
** get standard library
*/
include(APPLICATION_ROOT . "/modules/include/standard_library");
/*
** initialize database connection, set browser variables, check sid
*/
include(APPLICATION_ROOT . "/modules/include/init");
/*
** send headers to cause pages to expire immediately
**
** This is important because almost every page contains
** informatin that should be completely fresh. Things
** can get very confusing if a page shows the contents
** of your basket from ten minutes ago. Plus, we want
** to defeat the naughty users who use the back button.
** At the very least, we'll force them to reload the page.
**
** HTTP 1.1 Spec:
*/
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Expires: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");
/*
** Take action. Be careful of actions such as ACTION="../../hackmeister.php3".
*/
if(isset($ACTION) AND ($ACTION != ""))
{
if(eregi('^[A-Z_0-9]*$', $ACTION) AND
file_exists(APPLICATION_ROOT . "/modules/actions/$ACTION") )
{
//try, as much as possible, to disallow actions from being interrupted
set_time_limit(ACTION_TIME_LIMIT);
$userAbortOrig = ignore_user_abort(TRUE);
include(APPLICATION_ROOT . "/modules/actions/$ACTION");
//restore default settings (we don't care about the time limit before
//the action since it's only screens and actions that take a lot of time)
set_time_limit(DEFAULT_TIME_LIMIT);
ignore_user_abort($userAbortOrig);
}
else
{
$ActionResults[] = "\"" . prepareText($ACTION) .
"\" is not a valid action.";
}
}
/*
** -----------------------------------------------------------------------
** no output should be generated above this line because both
** check_sid and GENERATE_SID send cookies.
*/
/*
** include array of page titles
*/
require(APPLICATION_ROOT . "/modules/include/ScreenInfo");
/*
** If we aren't given a screen, go home
*/
if(!(isset($SCREEN)) OR ($SCREEN==""))
{
$SCREEN="welcome";
}
/*
** If screen is bad, go home
*/
if(!(file_exists(APPLICATION_ROOT . "/modules/screens/$SCREEN")) OR
(!isset($ScreenInfo[$SCREEN][0])))
{
$SCREEN="welcome";
}
/*
** Start page
*/
print('');
print("\n");
print("\n");
print("\n");
print("" . $ScreenInfo[$SCREEN][0] . "\n");
/*
** Meta tags
*/
print("\n");
print("\n");
print("\n");
/*
** styles
*/
if($Browser_CSSOK)
{
include(APPLICATION_ROOT . "/modules/include/styles");
}
/*
** Javascript functions
*/
if($Browser_JavaScriptOK)
{
include(APPLICATION_ROOT . "/modules/include/popupwindow");
}
print("\n");
print("\n");
/*
** include the page body
*/
include(APPLICATION_ROOT . "/modules/layout/".$ScreenInfo[$SCREEN][3]);
/*
** close page
*/
print("\n");
print("\n");
?>