AddContent('xmlform', 'xmlform', 'login/showMessage', '', $aMessage ); G::RenderPage( 'publish' ); die; } } } else { //when we are in global pages, outside any valid workspace if ((SYS_TARGET==='sysLoginVerify') || (SYS_TARGET==='sysLogin') || (SYS_TARGET==='newSite')) { $phpFile = G::ExpandPath('methods') . SYS_COLLECTION . "/" . SYS_TARGET.'.php'; require_once($phpFile); die(); } else { require_once( PATH_METHODS . "login/sysLogin.php" ) ; die(); } } //***************** PM Paths DATA ************************** define( 'PATH_DATA_SITE', PATH_DATA . 'sites/' . SYS_SYS . '/'); define( 'PATH_DOCUMENT', PATH_DATA_SITE . 'files/' ); define( 'PATH_DYNAFORM', PATH_DATA_SITE . 'xmlForms/' ); define( 'PATH_IMAGES_ENVIRONMENT_FILES', PATH_DATA_SITE.'usersFiles'.PATH_SEP); define( 'PATH_IMAGES_ENVIRONMENT_USERS', PATH_DATA_SITE.'usersPhotographies'.PATH_SEP); //***************** Plugins ************************** // //here we are loading all plugins registered // //the singleton has a list of enabled plugins // $sSerializedFile = PATH_DATA_SITE . 'plugin.singleton'; // $oPluginRegistry = PMPluginRegistry::getSingleton(); // if ( file_exists ($sSerializedFile) ) // $oPluginRegistry->unSerializeInstance( file_get_contents ( $sSerializedFile ) ); // // $oPluginRegistry->setupPlugins(); //get and setup enabled plugins //***************** create $G_ENVIRONMENTS dependent of SYS_SYS ************************** define ( 'G_ENVIRONMENT', G_DEV_ENV ); $G_ENVIRONMENTS = array ( G_PRO_ENV => array ( 'dbfile' => PATH_DB . 'production' . PATH_SEP . 'db.php' , 'cache' => 1, 'debug' => 0, ) , G_DEV_ENV => array ( 'dbfile' => PATH_DB . SYS_SYS . PATH_SEP . 'db.php', 'datasource' => 'workflow', 'cache' => 0, 'debug' => 0, ) , G_TEST_ENV => array ( 'dbfile' => PATH_DB . 'test' . PATH_SEP . 'db.php' , 'cache' => 0, 'debug' => 0, ) ); // setup propel definitions and logging //try { require_once ( "propel/Propel.php" ); require_once ( "creole/Creole.php" ); if ( $G_ENVIRONMENTS[ G_ENVIRONMENT ]['debug'] ) { require_once ( "Log.php" ); // register debug connection decorator driver Creole::registerDriver('*', 'creole.contrib.DebugConnection'); // itialize Propel with converted config file Propel::init( PATH_CORE . "config/databases.php" ); //log file for workflow database $logFile = PATH_DATA . 'log' . PATH_SEP . 'workflow.log'; $logger = Log::singleton('file', $logFile, 'wf ' . SYS_SYS, null, PEAR_LOG_INFO); Propel::setLogger($logger); $con = Propel::getConnection('workflow'); if ($con instanceof DebugConnection) $con->setLogger($logger); //log file for rbac database $logFile = PATH_DATA . 'log' . PATH_SEP . 'rbac.log'; $logger = Log::singleton('file', $logFile, 'rbac ' . SYS_SYS, null, PEAR_LOG_INFO); Propel::setLogger($logger); $con = Propel::getConnection('rbac'); if ($con instanceof DebugConnection) $con->setLogger($logger); } else Propel::init( PATH_CORE . "config/databases.php" ); Creole::registerDriver('dbarray', 'creole.contrib.DBArrayConnection'); //***************** Session Initializations **************************/ ini_alter( 'session.auto_start', '1' ); ini_alter( 'register_globals', 'Off' ); session_start(); ob_start(); //********* Log Page Handler ************* // logPage ( $URL , SYS_CURRENT_PARMS); //*********jump to php file in methods directory ************* // if ( $oPluginRegistry->isRegisteredFolder( SYS_COLLECTION ) ) // $phpFile = PATH_PLUGINS . SYS_COLLECTION . PATH_SEP . SYS_TARGET.'.php'; // else $phpFile = G::ExpandPath('methods') . SYS_COLLECTION . PATH_SEP . SYS_TARGET.'.php'; //the index.php file, this new feature will allow automatically redirects to valid php file inside the methods directory if ( SYS_TARGET == '' ) { $phpFile = str_replace ( '.php', 'index.php', $phpFile ); $phpFile = include ( $phpFile ); } if ( substr(SYS_COLLECTION , 0,8) === 'gulliver' ) { $phpFile = PATH_GULLIVER_HOME . 'methods/' . substr( SYS_COLLECTION , 8) . SYS_TARGET.'.php'; } else { if ( ! file_exists( $phpFile ) ) { $_SESSION['phpFileNotFound'] = $phpFile; header ("location: /errors/error404.php"); die; } } // ***************** enable rbac ************************** $RBAC = RBAC::getSingleton(); $RBAC->sSystem = '{rbacProjectName}'; // ***************** Headers ************************** if ( ! defined('EXECUTE_BY_CRON') ) { header("Expires: Tue, 19 Jan 1999 04:30:00 GMT"); header("Last-Modified: Tue, 19 Jan 1999 04:30:00 GMT"); header('Cache-Control: no-cache, must-revalidate, post-check=0,pre-check=0 '); header('P3P: CP="CAO PSA OUR"'); if(isset( $_SESSION['USER_LOGGED'] )) { $RBAC->initRBAC(); $RBAC->loadUserRolePermission( $RBAC->sSystem, $_SESSION['USER_LOGGED'] ); } else { //This sentence is used when you lost the Session if ( SYS_TARGET != 'authentication' and SYS_TARGET != 'login' and SYS_TARGET != 'dbInfo' and SYS_TARGET != 'sysLoginVerify' and SYS_TARGET != 'updateTranslation' and SYS_COLLECTION != 'services' ){ header ("location: ".SYS_URI."login/login.php"); die(); } } require_once( $phpFile ); if ( defined('SKIP_HEADERS') ) { header("Expires: " . gmdate("D, d M Y H:i:s", mktime( 0,0,0,date('m'),date('d'),date('Y') + 1) ) . " GMT"); header('Cache-Control: public'); header('Pragma: '); } ob_end_flush(); } /* } catch ( Exception $e ) { $aMessage['MESSAGE'] = $e->getMessage(); $G_PUBLISH = new Publisher; $G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/showMessage', '', $aMessage ); G::RenderPage( 'publish' ); die; } */