<?php /* ================== CORE CONFIG =================================== */ /** * application related path */ define('OPENBIZ_APP_PATH', dirname(dirname(__FILE__))); //echo OPENBIZ_APP_PATH; //enable minify define('OPENBIZ_PAGE_MINIFY', 0); define('OPENBIZ_DEFAULT_SYSTEM_NAME', 'Cubi Platform'); define('OPENBIZ_APP_URL', get_app_url()); //echo OPENBIZ_APP_URL; //exit; /* OPENBIZ_APP_INDEX_URL is /a/b/index.php in case of http://host/a/b/index.php?... */ $indexScript = "/index.php"; // or "", or "/?" define('OPENBIZ_APP_INDEX_URL', OPENBIZ_APP_URL . $indexScript); /* define modules path */ define('OPENBIZ_APP_MODULE_PATH', OPENBIZ_APP_PATH . DIRECTORY_SEPARATOR . "modules"); /* define modules extension path that can store custom code who overrides default module logic */ //define('MODULE_EX_PATH',OPENBIZ_APP_PATH.DIRECTORY_SEPARATOR."xmodules"); /* define messages files path */ define('OPENBIZ_APP_MESSAGE_PATH', OPENBIZ_APP_PATH . DIRECTORY_SEPARATOR . "messages"); /* define themes const */ define('OPENBIZ_USE_THEME', 1); define('OPENBIZ_THEME_URL', OPENBIZ_APP_URL . "/themes"); define('OPENBIZ_THEME_PATH', OPENBIZ_APP_PATH . DIRECTORY_SEPARATOR . "themes"); // absolution path the themes define('OPENBIZ_SMARTY_CPL_PATH', OPENBIZ_APP_PATH . DIRECTORY_SEPARATOR . "files/tpl_cpl"); // smarty template compiling path
foreach ($paths as $path) { $fn = $path . DIRECTORY_SEPARATOR . $name . '.php'; if (file_exists($fn)) { //echo "Found $name at $fn\n"; include_once $fn; return; } } throw new Exception("Load {$name} failed."); }); // 加载辅助函数 include_once LIB_DIR . "/password.php"; include_once CLASSES_DIR . "/functions.php"; include_once CLASSES_DIR . "/setup_env.php"; setup_encoding(); define('BLOG_URL', get_app_url()); // load plugins foreach (glob(APP_DIR . "/plugins/*/main.php") as $filename) { include $filename; } // 全局的配置 $config = new Config(DATA_DIR . '/config.php'); setup_default_config(); // 配置完成 Hook::TriggerEvent(Hook::CONFIG_COMPLETE, array($config)); // 使用配置来设置环境 setup_env_by_config(); $postHelper = new FilePostHelper(CACHE_DIR . '/post.meta'); $tellets = new Tellets(); // 添加预定义动作 include_once CLASSES_DIR . '/predefined_hooks.php';
<?php include_once "config.inc.php"; include_once "common.inc.php"; if (isset($_GET["uportalActiveTab"])) { $activeTab = $_GET["uportalActiveTab"]; if (!tab_has_non_https_url($activeTab, isset($_GET["guest"])) && !isset($_GET["idpId"])) { // ok: let uportal display all channels $location = ent_tab_url($activeTab); } else { // gasp, there is a http:// iframe, display only one channel (nb: if the first channel is http-only, it will be displayed outside of uportal) $location = get_app_url($_GET["firstId"]); } } else { if (isset($_GET["id"])) { $location = get_app_url($_GET["id"]); } else { exit("missing 'id=xxx' parameter"); } } header("Location: {$location}"); function get_app_url($id) { global $APPS; $app = $APPS[$id]; if (!$app) { $app = array(); } // gasp, go on anyway... $idpAuthnRequest_url = isset($_GET["idpId"]) ? idpAuthnRequest_url($_GET["idpId"]) : null; $url = get_url($app, $id, isset($_GET["guest"]), !isset($_GET["login"]), $idpAuthnRequest_url);