예제 #1
0
파일: index.php 프로젝트: vasvlad/majordomo
    if (file_exists(ROOT . 'cached/' . $cache_filename)) {
        if (time() - filemtime(ROOT . 'cached/' . $cache_filename) <= $cache_expire) {
            $cached_result = LoadFile(ROOT . 'cached/' . $cache_filename);
        } else {
            unlink(ROOT . 'cached/' . $cache_filename);
        }
    }
}
if ($cached_result == '') {
    if (!file_exists(DIR_MODULES . 'control_modules/installed')) {
        include_once DIR_MODULES . "control_modules/control_modules.class.php";
        $ctl = new control_modules();
    }
    $app = new application();
    if ($md != $app->name) {
        $app->restoreParams();
    } else {
        $app->getParams();
    }
    if ($app->action != '' && $app->action != 'docs') {
        $fake_doc = '';
    }
    if ($app->action == '' && $fake_doc != "" && file_exists(DIR_MODULES . 'cms_docs/cms_docs.class.php')) {
        $tmp = SQLSelectOne("SELECT ID FROM cms_docs WHERE NAME='" . DBSafe($fake_doc) . "'");
        if (isset($tmp['ID'])) {
            $app->action = "docs";
            $app->doc = $tmp['ID'];
        } elseif (file_exists(DIR_TEMPLATES . $fake_doc . ".html")) {
            $app->action = $fake_doc;
        } else {
            //$tmp1=SQLSelectOne("SELECT ID FROM cms_docs WHERE NAME='404'");