http://78.9.97.219/ergo/"; //exit(); } include_once ("config.inc.php"); include_once(PATH_PROJECT.'externalcomponents/adodb/adodb.inc.php' ); function __autoload($class) { if(file_exists(PATH_PROJECT.'class/system/'.$class.'.class.php')) include_once(PATH_PROJECT.'class/system/'.$class.'.class.php'); elseif(file_exists(PATH_PROJECT.'class/object/'.$class.'.class.php')) include_once(PATH_PROJECT.'class/object/'.$class.'.class.php'); elseif(file_exists(PATH_PROJECT.'class/list/'.$class.'.class.php')) include_once(PATH_PROJECT.'class/list/'.$class.'.class.php'); elseif(file_exists(PATH_PROJECT.'class/interface/'.$class.'.class.php')) include_once(PATH_PROJECT.'class/interface/'.$class.'.class.php'); elseif(file_exists(PATH_PROJECT.'class/abstract/'.$class.'.class.php')) include_once(PATH_PROJECT.'class/abstract/'.$class.'.class.php'); elseif(file_exists(PATH_PROJECT.'class/DAO/'.$class.'.class.php')) include_once(PATH_PROJECT.'class/DAO/'.$class.'.class.php'); } session_start(); $page = RequestorHandler :: GetPageName() ; $action = RequestorHandler :: GetPageAction() ; if( $page == 'logout' ) { unset( $User ); unset( $_SESSION ) ; session_unset(); session_destroy(); header("Location: ".PATH_PROJECT_IN_NET); exit; } $ActiveSystemSetting = new Setting; $ActiveSystemSetting->GetValue('systemactive'); if (!is_object($_SESSION["User"])) { $_SESSION["User"] = new User(); } $User = &$_SESSION["User"]; if( !$User->IsLogged() ) { $login = RequestorHandler :: GetVariable('login') ; $password = RequestorHandler :: GetVariable('password') ; if( !$User->login( $login, $password ) ) { $page = 'login' ; } else { $Login = new Login; $Login->Create( array( 'userid' => $User->id , 'time'=>date("Y-m-d H:i:s",time() ) ) ) ; unset($Login); $page = 'customerlist' ; } } else if( $page == 'login' ) $page = 'customerlist'; if( $ActiveSystemSetting->value == 0 && $User->status != USER_STATUS_MASTER ) { unset( $User ); unset( $_SESSION ) ; session_unset(); session_destroy(); $page = 'login' ; } $language = 'pl'; $BusinessLogicCollector = new BusinessLogicCollector() ; $BusinessLogicCollector->AddConstans($page,"page"); $BusinessLogicCollector->AddConstans($action,"action"); $BusinessLogicCollector->AddConstans(USER_STATUS_MASTER,"userStatusMaster"); $BusinessLogicCollector->AddConstans(USER_STATUS_ADMIN,"userStatusAdmin"); $BusinessLogicCollector->AddConstans(USER_STATUS_BOOKKEEPER,"userStatusBookkeeper"); $BusinessLogicCollector->AddConstans(USER_STATUS_AGENT,"userStatusAgent"); $BusinessLogicCollector->AddConstans(PATH_PROJECT_IN_NET,"realpath"); $BusinessLogicCollector->AddConstans('Pl',"language"); $BusinessLogicCollector->Append($ActiveSystemSetting,'ActiveSystemSetting'); if( is_object( $User ) ) $BusinessLogicCollector->Append($User); switch( $page ) { case 'login': //include(PATH_PROJECT."controlers/index.inc.php"); break ; case 'index': include(PATH_PROJECT."controlers/customerlist.inc.php"); break ; case 'customerlist': include(PATH_PROJECT."controlers/customerlist.inc.php"); break ; case 'editcustomer': include(PATH_PROJECT."controlers/editcustomer.inc.php"); break ; case 'customernotice': include(PATH_PROJECT."controlers/customernotice.inc.php"); break ; case 'userlist': include(PATH_PROJECT."controlers/userlist.inc.php"); break ; case 'edituser': include(PATH_PROJECT."controlers/edituser.inc.php"); break ; case 'translation': include(PATH_PROJECT."controlers/translation.inc.php"); break ; default : die("Page not found!") ; } $BusinessLogicCollector->Render(); //print_r($BusinessLogicCollector); //echo $BusinessLogicCollector->GetXml(); echo $BusinessLogicCollector->DisplayPage(); ?>