function loadAppServices($appName = SITENAME) { if (defined("BASEPATH")) { trigger_logikserror("App <b>'" . $appName . "'</b> has already been activated", E_ERROR); } define("BASEPATH", APPS_FOLDER . $appName . "/"); define("APPROOT", ROOT . BASEPATH); define("WEBAPPROOT", SiteLocation . BASEPATH); if (!file_exists(APPROOT)) { trigger_logikserror("Site Not Found <b>'" . $appName . "'</b>", E_ERROR); } $apps_cfg = APPROOT . "apps.cfg"; if (!file_exists($apps_cfg)) { trigger_logikserror("Site <b>'" . $appName . "'</b> Has Not Yet Been Activated (missing apps.cfg).", E_ERROR); } loadConfigs($apps_cfg); loadConfigDir(APPROOT . "config/"); if (!defined("APPS_CONFIG_FOLDER")) { loadConfigs(ROOT . "config/masters/folders.cfg"); } if (defined("LINGUALIZER_DICTIONARIES")) { Lingulizer::getInstance()->loadLocaleFile(LINGUALIZER_DICTIONARIES); } if (!defined("APPS_THEME")) { define("APPS_THEME", getConfig("APPS_THEME")); } if (!defined("APPS_TEMPLATEENGINE")) { define("APPS_TEMPLATEENGINE", getConfig("APPS_TEMPLATEENGINE")); } if (!defined("APPNAME")) { define("APPNAME", SITENAME); } return true; }
$isDebug = array_key_exists('debug', $_REQUEST); if ($isDebug) { ini_set('display_errors', 1); error_reporting(1); define("MASTER_DEBUG_MODE", true); } else { ini_set('display_errors', 0); error_reporting(0); } include_once ROOT . "config/classpath.php"; include_once ROOT . "api/bootlogiks.php"; logiksRequestPreboot(); include_once SERVICE_ROOT . "ServiceAuthEngine.inc"; include_once SERVICE_ROOT . "api.php"; include_once ROOT . "api/configurator.php"; loadConfigs([ROOT . "config/basic.cfg", ROOT . "config/php.cfg", ROOT . "config/system.cfg", ROOT . "config/developer.cfg", ROOT . "config/services.cfg", ROOT . "config/errorlog.cfg", ROOT . "config/security.cfg", ROOT . "config/others.cfg", ROOT . "config/xtras.cfg", ROOT . "config/folders.cfg"]); LogiksConfig::fixPHPINIConfigs(); define('SiteLocation', 'http' . (_server('HTTPS') ? 's' : '') . '://' . "{_server('HTTP_HOST')}/" . InstallFolder); require_once ROOT . "api/libs/errorLogs/boot.php"; logiksServiceBoot(); header("X-Powered-By: Logiks [http://openlogiks.org]", false); header("SESSION-KEY:" . session_id(), false); header("Access-Control-Allow-Origin:*"); //Origin //Access-Control-Allow-Methods:OPTIONS,GET,POST,PUT,DELETE //Access-Control-Allow-Headers:Content-Type, Authorization, X-Requested-With //header("Access-Control-Allow-Headers", "access-control-allow-origin, accept, access-control-allow-methods, access-control-allow-headers, x-random-shit"); //header("X-Powered-By: ".Framework_Title." [".Framework_Site."]",false); //print_r($GLOBALS['LOGIKS']["_SERVER"]);exit(); include_once ROOT . "api/libs/logiksCache/boot.php"; include_once ROOT . "api/libs/loaders/boot.php";
echo "<h1 align=center style='color:#BF2E11'>Error In Logiks Installation Or Corrupt Installation. <br/>Please Contact Admin.</h1>"; } exit; } if (!isset($initialized)) { ob_start(); //clearstatcache(); @session_start(); $GLOBALS['LOGIKS']["_SERVER"]['REQUEST_PAGE_START'] = microtime(true); define('WEBROOT', 'http' . (isset($GLOBALS['LOGIKS']["_SERVER"]['HTTPS']) ? 's' : '') . '://' . $GLOBALS['LOGIKS']["_SERVER"]['HTTP_HOST'] . dirname($GLOBALS['LOGIKS']["_SERVER"]['SCRIPT_NAME']) . "/"); include_once ROOT . "config/classpath.php"; require_once 'bootlogiks.php'; logiksRequestPreboot(); include_once 'commons.php'; require_once 'configurator.php'; loadConfigs([ROOT . "config/basic.cfg", ROOT . "config/php.cfg", ROOT . "config/system.cfg", ROOT . "config/developer.cfg", ROOT . "config/errorlog.cfg", ROOT . "config/security.cfg", ROOT . "config/folders.cfg", ROOT . "config/others.cfg", ROOT . "config/xtras.cfg", ROOT . "config/framework.cfg", ROOT . "config/appPage.cfg"]); define('SiteLocation', 'http' . (isset($GLOBALS['LOGIKS']["_SERVER"]['HTTPS']) ? 's' : '') . '://' . "{$GLOBALS['LOGIKS']["_SERVER"]['HTTP_HOST']}/" . InstallFolder); if (PRINT_PHP_HEADERS) { header("X-Powered-By: " . Framework_Title . " [" . Framework_Site . "]", false); } require_once ROOT . "api/libs/errorLogs/boot.php"; LogiksConfig::fixPHPINIConfigs(); logiksRequestBoot(); include_once ROOT . "api/libs/logiksCache/boot.php"; include_once ROOT . "api/libs/loaders/boot.php"; include_once ROOT . "api/system.php"; include_once ROOT . "api/security.php"; include_once ROOT . "api/app.php"; include_once ROOT . "api/libs/logiksUser/boot.php"; include_once ROOT . "api/libs/logiksTemplate/boot.php"; include_once ROOT . "api/libs/logiksPages/boot.php";
} if (!isset($_POST['mauth'])) { echo "<h5>Securing Access Authentication ... </h5>"; } runHooks("preAuth"); $userid = clean($_POST['userid']); $pwd = clean($_POST['password']); //if(!isValidMd5($pwd)) $pwd=md5($pwd); if (isset($_POST['site'])) { $domain = $_POST['site']; } elseif (isset($_REQUEST['site'])) { $domain = $_REQUEST['site']; } else { $domain = SITENAME; } loadConfigs(ROOT . "config/auth.cfg"); include ROOT . "api/helpers/pwdhash.php"; //include ROOT."api/security.php"; /* CLEAR_OLD_SESSION=true @session_start(); session_destroy(); session_start(); */ $dbLink = _db(true); $dbLogLink = null; //LogDB::getInstance()->getLogDBCon(); if (!$dbLink->isAlive()) { relink("Database Connection Error", $domain); } if ($userid == '') {