/**************************************************************************/ /* File: index.php */ /* */ /* Description: Main script used for all website operations. */ /* */ /* Author: Robin Lynch. */ /* */ /* Mods: Robin Jan 1, 2013 Created. */ /* */ /**************************************************************************/ // turn trace on (1) or off (0) define("API_CALL","N/A"); define("TRACE_MODE",0); define("TRACE_ID",time().sprintf("%05s",mt_rand(1,99999))); if (TRACE_MODE == 1) { $jData=array(); $jData1=array(); $jData2=array(); $jData3=array(); foreach ($_SERVER as $postVar => $postValue) { $jData1[$postVar]=$postValue; } foreach ($_POST as $postVar => $postValue) { $jData2[$postVar]=$postValue; } foreach ($_GET as $postVar => $postValue) { $jData3[$postVar]=$postValue; } $jData['SERVER']=$jData1; $jData['POST']=$jData2; $jData['GET']=$jData3; $vars = base64_encode(json_encode($jData)); date_default_timezone_set('America/Toronto'); $fh = fopen("logs/trace.log","a"); fputs($fh,TRACE_ID."-> "."IN : ".date("H:i:s")." : ".$vars."\n"); fclose($fh); } // include all necessary application config files include_once("conf/ttm.inc"); if (TRACE_MODE == 1) { $fh = fopen("logs/trace.log","a"); fputs($fh,TRACE_ID."-> "."OUT : ".date("H:i:s")." : ".$vars."\n"); fclose($fh); } // determine if we should be using SSL connection if ( (ENFORCE_SSL) && ($_SERVER["HTTPS"] != "on") ) { print "
\n"; } else { // set account if necessary $ttmAppSecurity = AppSecurity::get_instance(); $ttmAppSecurity->setPortalAccount(); // process application business logic based on page ID $ttmVarRegistry = VarRegistry::get_instance(); $ttmUI = AppUserInterface::get_instance(); $ttmUI->prepareCommand($ttmVarRegistry->getVar($ttmUI->parameters['PARAM_COMMAND'])); // log transaction $ttmLogger = AppLogger::get_instance(); $ttmLogger->LogTransation(); // produce output back to client $ttmUI->returnWebPage($ttmUI->webPageType); } ?>