<?php
	/*
	** File: global_settings
	** Description: Sets a bunch of global variables
	** Version: $Revision: 1.48 $
	** Created: 05/18/99
	** Author: Leon Atkinson
	** Email: leon@clearink.com
	** CVS Author: $Author: leon $
	** Last Revised: $Date: 2000/03/21 23:48:10 $
	** Log : $Log: global_settings,v $
	** Log : Revision 1.48  2000/03/21 23:48:10  leon
	** Log : Bumping version since we're releasing 1.0.3
	** Log :
	** Log : Revision 1.47  2000/02/03 16:57:35  leon
	** Log : Bumping version string
	** Log :
	** Log : Revision 1.46  2000/02/02 18:59:46  leon
	** Log : Fixing bugs reported by Ted Henigson.
	** Log :
	** Log : Revision 1.45  2000/01/19 21:05:27  leon
	** Log : Bumping version up to 1.0
	** Log :
	** Log : Revision 1.44  2000/01/10 23:20:22  leon
	** Log : Changed version info.
	** Log :
	** Log : Revision 1.43  2000/01/03 21:22:27  leon
	** Log : Adding a bit of error checking
	** Log :
	** Log : Revision 1.42  1999/12/17 00:11:18  leon
	** Log : Added code to try to force actions to be atomic.  They must finish at all
	** Log : costs, at least in the case of cofirming an order.  This new code stops
	** Log : aborts due to time limits and the user hitting the stop button.
	** Log :
	** Log : Revision 1.41  1999/12/07 18:18:27  leon
	** Log : Set the default database to be 'freetrade' not ft_dev
	** Log :
	** Log : Revision 1.40  1999/12/06 21:17:23  leon
	** Log : ECML compliance
	** Log : Overhauled address functions to use ECML form field names.  Ditto with
	** Log : the billing fields on the checkout forms.  Note the change to build.sql.
	** Log : Yes, the address table changed to accomodate new fields.  The billing
	** Log : table changed too.
	** Log :
	**
	** Copyright (c) 1999 Working Dogs.  All rights reserved.
	*/


	define("FREETRADE_VERSION", "1.0.3");


	//set this to FALSE if your site is live.
	define("DEBUG", TRUE);



	//set full error reporting on
	//This setting will give you lots of warnings while you are working
	//so you don't miss uninitialized variables and such.  However, 
	//sometimes it's OK to use an unitialized variable, so all these 
	//warnings can be annoying. Turn this on if a variable is empty when
	//you expect it to have a value.  It can reveal errors like looking at
	//$shippping when you meant $shipping.  (The first one has an extra p).
	//error_reporting(63);


	/*
	** General Network Behavior
	*/
	
	define("SEND_EMAIL", FALSE);

	//when emails are sent by the system this is used
	//in the from header.
	define("EMAIL_FROM", "Webmaster <webmaster@$SERVER_NAME>");

	//privacy statement to show on pages with forms
	define("PRIVACY_STATEMENT", "<B>Privacy Statement</B><BR>\n" .
		"Your personal information will not be shared with any third party " .
		"without your permission, except in the case of cooperation with " .
		"law enforcement authorities.<BR>\n");


	//Set this constant to TRUE if you want sensitive areas of
	//the system to be viewed using an SSL connection, for example,
	//the checkout process.  This constant affects the ScreenURL
	//function which appears later in this file.
	define("USE_SSL", FALSE);

	//Set this to TRUE if you want to use cookies for session IDs
	//Users without cookies will still get $sid from a form variable 
	define("USE_COOKIES", TRUE);

	//the following constants have no meaning if cookies aren't used
	if(USE_COOKIES)
	{
		//Set this to TRUE if you want to use cookies to implement autologin.
		//Turning this on exposes your users to some security risk because
		//their password must be saved in the cookie file and then sent between
		//the browser and the server for every page load.  This allows a sniffer
		//to a greater chance at grabbing the password.  Even though the password
		//is encoded with MD5(), it's still enough by itself to allow a login
		//from anyone who has it.  Since this is such a security risk, this
		//feature is left off by default.
		define("USE_AUTOLOGIN", FALSE);
	
		if(USE_AUTOLOGIN)
		{
			//This constant controls the lifetime of a cookie used to store
			//the login and password of a user.  When the user returns to
			//the site, the cookie will allow them to be logged in automatically.
			define("AUTOLOGIN_LIFETIME", 60*60*24*365);
		}

		//Automatically check if user supports cookies
		//If we got $sid as a cookie, then the user is
		//obviously using cookies.
		if(isset($HTTP_COOKIE_VARS['sid']))
		{
			define("COOKIE_FOUND", TRUE);
		}
		else
		{
			define("COOKIE_FOUND", FALSE);
		}

	}

	//This constant controls generation of cloaking constants
	define('GENERATE_CLOAKING_CONSTANTS', TRUE);

	//How many seconds to allow an action module to run.
	//It's really important that action modules complete because
	//we never want to halfway confirm an order
	define("ACTION_TIME_LIMIT", 3600);
	
	//How long to allow a screen module to run
	define("DEFAULT_TIME_LIMIT", 60);
	
	
	/*
	** Session constants
	*/

	//The number of characters to use in the session identifier. Note that
	//the size of the ID field in the session table needs to be at least this
	//big, so change the schema if you change this number.
	define('SESSION_SIZE', 16);

	//Characters to use when making a session.
	//This is a pool of characters to use inside session identifiers.  Be careful of anything
	//other than letters or numbers.  Since we do lots of substr lookups on this string, we
	//might as well compute the length.
	define('SESSION_CHARACTERS','1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz');
	define('SESSION_CHARACTERS_LEN', strlen(SESSION_CHARACTERS));

	//This constant controls how long a session is allowed to remain
	//inactive before it is dropped from the system.  The time is
	//expressed in seconds.  1800 seconds is 30 minutes.  This is
	//important to protect users who walk away from their computer
	//without logging out.  Note that the code that cleans out
	//stale sessions uses a frequency probability, so sessions will
	//tend to be longer lived than this life time.
	define("SESSION_LIFETIME", 1800);

	//This constant controls how often session_sku is checked for
	//stale entries.  A value of 100 means checking once every 100
	//page requests, on average.  See the code in the init module
	//to see how this value is used.
	define("BASKET_CLEAN_FREQUENCY", 100);

	//This constant expresses how long an inactive invoice created by an
	//anonymous shopper can live before being wiped from the system.  The
	//figure is a number of seconds. Default: 24 Hours
	define("INACTIVE_INVOICE_LIFETIME", 60*60*24);

	//This constant controls how often a check is made (inside check_sid)
	//for inactive invoices created by anonymous shoppers.  It represents
	//a probability of one in so many page loads.  Default: 1 in a 1000
	define("INVOICE_CLEAN_FREQUENCY", 1000);



	/*
	** Constants the control the catalog
	*/

	//Allow items to belong to multiple departments. For instance, if you go
	//to Wal Mart, you'll find fire extinguishers in at least 3 deparments.
	define("ITEMS_IN_MULTIPLE_DEPARTMENTS", TRUE);

	//This constant controls whether a shopper must register
	//in order to checkout.
	define("SHOPPER_MUST_REGISTER", FALSE);

	//If we are providing giftwrap, this is how much to charge for it.
	define("GIFTWRAP_COST", 4.99);
	
	//This constant matches a row in the status table.
	define("INVOICE_CANCELLED", 2);

	//Web directory relative to index.php3 where images for
	//items are stored.  This path will be prefixed (with a
	//slash) to the "Graphic" field from the item table.
	define("ITEM_IMAGES_DIR", "images/items");	
	
	//Web directory relative to index.php3 where images for
	//departments are stored.  This path will be prefixed 
	//(with a slash) to the "Graphic" field from the department
	//table.
	define("DEPARTMENT_IMAGES_DIR", "images/departments");	

	//Controls whether coupons are available on the site
	define("USE_COUPONS", TRUE);
	
	//The maximum value for quantity for each line item
	define("MAX_QUANTITY", 100);
	
	
	/*
	** Constants for searching
	*/

	//This constant controls whether searches are made on screen modules.
	//Look in the search_results screen module for where this is used.  If
	//turned off, site searches will only be performed on meta tags as
	//defined in the ScreenInfo array.
	define("SEARCH_SCREENS", TRUE);

	//This constant controls whether a search of screens should use an index
	//or just search screen modules in real time.
	define("SEARCH_INDEX", TRUE);

	//these two constants control how the index is built: the smallest word to be
	//included in the index and the an upper limit on frequency.  Words that appear
	//in too many pages are probably not good to include in the index.
	define("SEARCH_MINIMUM_WORD_LENGTH", 4);
	define("SEARCH_MAXIMUM_FREQUENCY", 80);



	/*
	** Database variables
	*/
	define("DATABASE_HOST", "localhost");
	define("DATABASE_USER", "httpd");
	define("DATABASE_PASSWORD", "");
	define("DATABASE_NAME", "freetrade");


	/*
	** Colors used throughout the site
	*/
	$SiteColor["Border"] = '#CCCCCC';
	$SiteColor["BodyText"] = '#000000';
	$SiteColor["Headers"] = '#000000';
	$SiteColor["TableBackground"] = '#FFFFFF';

	//used for table backgrounds
	$SiteColor['Highlight1'] = '#CCCCCC';
	$SiteColor['Highlight2'] = '#EEEEEE';



	/*
	** Localization
	**
	** This section defines strings of text sent out
	** to the user.  These strings are stored in
	** constants that are named after the modules on
	** which they are used.
	**
	** Here we're including another module, but you
	** may wish to grab the contents and place it here
	** if you want to save a hit to the filesystem.
	** You may also wish to choose the module based on
	** the browser's reported language.
	**
	** Available modules: english
	*/
	define('LANGUAGE_DEF', 'english');
	include(APPLICATION_ROOT . "/modules/language/" . LANGUAGE_DEF);

?>
