/**
  *	Init Now
  *
  *	@return	void
  */
 public static function initNow()
 {
     require_once CTM_ROOT_PATH . "cache/server_cache/db_php/core_sources/installation_info.php";
     $_SERVER['REQUEST_URI'] = str_replace("&ajaxLoadSet", "/&ajaxLoadSet", CTM_URLEngine::URIString());
     CTM_Controller::PHPErrors();
     CTM_LoadTime::startTime();
     date_default_timezone_set("America/Sao_Paulo");
     if ($installation['is_installed'] == false) {
         if (CTM_ROOT_AREA == "admin") {
             header("Location: " . CTM_URLEngine::URLBase() . "installer/?app=install");
             exit;
         } else {
             CTM_Error::kernelError("The board is not installed");
         }
     } elseif (EW_THIS_VERSION > str_pad($installation['current_version'], 5, 0, STR_PAD_RIGHT)) {
         if (CTM_ROOT_AREA == "admin") {
             header("Location: " . CTM_URLEngine::URLBase() . "installer/?app=upgrade");
             exit;
         } else {
             CTM_Error::kernelError("The board is in update process");
         }
     }
     CTM_Cookies::$cookiePath = COOKIE_PATH;
     CTM_Cookies::$cookieDomain = COOKIE_DOMAIN;
     CTM_Registry::init();
     CTM_Command::instance()->registry();
     CTM_Registry::fetchDriver()->settings['mssql']['hostname'] = MSSQL_HOSTNAME;
     CTM_Registry::fetchDriver()->settings['mssql']['hostport'] = MSSQL_HOSTPORT;
     CTM_Registry::fetchDriver()->settings['mssql']['username'] = MSSQL_USERNAME;
     CTM_Registry::fetchDriver()->settings['mssql']['password'] = MSSQL_PASSWORD;
     CTM_Registry::fetchDriver()->settings['mssql']['database'] = CTMEW_CORE;
     CTM_Registry::fetchDriver()->settings['mssql']['persistent'] = MSSQL_PERSISTENT;
     CTM_Registry::fetchDriver()->settings['mssql']['debug'] = in_array("mssql", explode(",", CTM_SQL_DEBUG_MODE));
     CTM_Registry::fetchDriver()->settings['mssql']['log_folder'] = "MSSQL";
     CTM_Registry::fetchDriver()->Connect("mssql");
     if (CTM_Command::instance()->settings['CRONJOB']['ENABLE'] == TRUE) {
         $CronJob = new CronJob();
         $CronJob->Start(CTM_Command::instance()->settings['CRONJOB']['DEBUG']);
         $CronJob->RunAllTasks();
         $CronJob->Finish();
     }
     Authentication::init();
     CTM_Controller::Setup();
     CTM_Dashboard::init();
     CTM_Registry::setSetup("application", CTM_Dashboard::$application);
     if (CTM_ROOT_AREA == "public") {
         print self::GetContent();
         print "\r\n<!-- Effect Web " . EW_PUBLIC_VERSION . " / Powered by Erick-Master & Litlle / (c) 2012 -->";
     } else {
         CTM_ACPBoard::init(ACP_LOAD_MODULE);
     }
     exit;
 }
Example #2
0
 /**
  *	Init Application
  *
  *	@return	void
  */
 public function init($section = "*DEFAULT*")
 {
     if ($this->checkPermission("applications", "effectweb", true)) {
         global $appsCache;
         if ($_GET['module'] && !CTM_Dashboard::APP_ModuleExists($_GET['module'])) {
             return $this->output->setContent("module_failed");
         } elseif ($_GET['module']) {
             $controller = $_GET['module'];
         } elseif ($section != "*DEFAULT*") {
             $controller = $section;
         } else {
             $controller = $appsCache['effectweb']['section'];
         }
         CTM_Dashboard::LoadAPPModule($controller);
     }
 }
Example #3
0
 /**
  *	Init Application
  *
  *	@return	void
  */
 public function init($section = "*DEFAULT*", $load = "app_section.php")
 {
     global $appsCache;
     self::loadSources();
     $CTM_EWGeneral = new CTM_EWGeneral();
     $EW_Modules = new EW_Modules();
     $EW_Modules->loadPublicModules();
     $page = $_POST['pag'] ? $_GET['pag'] : $_GET['module'];
     if ($page && !CTM_Dashboard::APP_ModuleExists($page)) {
         return $this->output->loadSkinCache("server", "404_error");
     } elseif ($_GET['ajax']) {
         $controller = "Ajax";
     } elseif ($page) {
         $controller = $page;
     } elseif ($section != "*DEFAULT*") {
         $controller = $section;
     } else {
         $controller = $appsCache['core']['section'];
     }
     $CTM_EWGeneral->init();
     CTM_Dashboard::LoadAPPModule($controller, $load);
 }
 /**
  *	Load Application
  *
  *	@param	string	Application
  *	@param	string	Module
  *	@return	void
  */
 public static function LoadApplication($application, $section = "*DEFAULT*", $load = "app_section.php")
 {
     if (!self::$application || self::$application != $application) {
         $section = eregi_replace("[^a-zA-Z0-9_]", NULL, $section);
         self::$application = $application;
         require_once CTM_APPLICATION_PATH . "apps_ctm/" . strtolower($application) . "/" . (CTM_ROOT_AREA == "admin" ? "admin/" : NULL) . "application.php";
         $application = str_replace(array(".", "-"), "_", $application) . (CTM_ROOT_AREA == "admin" ? "_Admin" : NULL);
         $application = new $application();
         self::$inApplication = TRUE;
         define("THIS_APPLICATION_PATH", CTM_APPLICATION_PATH . "apps_ctm/" . strtolower(self::$application) . "/");
         define("CTM_BOARD_APP", self::$application);
         $application->registry();
         $application->init($section, $load);
     }
 }
Example #5
0
 /**
  *	Private: Start AdminCP
  *
  *	@return	void
  */
 private static function start($core_module = "*DEFAULT*")
 {
     self::instance()->lang->loadLanguageFile("global", "Core");
     if (!ACP_SESSION_LOGGED) {
         CTM_Dashboard::LoadAPPModule("global");
     } elseif (CTM_BOARD_APP == "Core") {
         global $appsCache;
         if ($_GET['ajax']) {
             $controller = "Ajax";
         } elseif ($_GET['module']) {
             $controller = $_GET['module'];
         } elseif ($core_module != "*DEFAULT*" && $core_module) {
             $controller = $core_module;
         } else {
             $controller = $appsCache['core']['module'];
         }
         CTM_Dashboard::LoadAPPModule($controller);
     } else {
         CTM_Dashboard::LoadApplication(CTM_BOARD_APP, ACP_LOAD_MODULE);
         if (file_exists(THIS_APPLICATION_PATH . "admin/variables/acp_modules_name.php")) {
             require_once THIS_APPLICATION_PATH . "admin/variables/acp_modules_name.php";
             $GLOBALS['acp_modules_name'] = array_merge($GLOBALS['acp_modules_name'], $_acp_modules_name);
         }
     }
 }