コード例 #1
0
ファイル: index.php プロジェクト: bqq1986/efront
    //$customBlocks = eF_multiSort($customBlocks, 'title');
    foreach ($customBlocks as $key => $block) {
        $blocks[$key] = array('title' => $block['title'], 'image' => '32x32/generic.png');
    }
    if (!EfrontUser::isOptionVisible('online_users')) {
        unset($blocks['online']);
    }
    $smarty->assign("T_CUSTOM_BLOCKS", $customBlocks);
    $smarty->assign("T_BLOCKS", $blocks);
    $positions = $GLOBALS['currentTheme']->layout['positions'];
    $smarty->assign("T_POSITIONS", $positions);
    if ($GLOBALS['configuration']['lessons_directory'] == 1 && in_array('lessons', array_merge($positions['leftList'], $positions['rightList'], $positions['centerList']))) {
        if (isset($_SESSION['s_current_branch'])) {
            $branch = new EfrontBranch($_SESSION['s_current_branch']);
            $constraints = array('active' => true, 'archive' => false, 'instance' => false, 'sort' => 'name');
            $courses = $branch->getBranchCoursesIncludingParentBranches($constraints);
            $lessons = array();
        }
        $directionsTree = new EfrontDirectionsTree();
        $options = array('lessons_link' => basename($_SERVER['PHP_SELF']) . '?ctg=lesson_info&lessons_ID=', 'courses_link' => basename($_SERVER['PHP_SELF']) . '?ctg=lesson_info&courses_ID=', 'search' => true, 'catalog' => true, 'url' => $_SERVER['PHP_SELF'], 'collapse' => $GLOBALS['configuration']['collapse_catalog'], 'buy_link' => true, 'course_lessons' => false);
        include "directions_tree.php";
    }
}
/* -------------------------------------------------------Login part-------------------------------------------------------------------*/
if (isset($_GET['autologin']) && eF_checkParameter($_GET['autologin'], 'hex')) {
    try {
        $result = eF_getTableDataFlat("users", "login,autologin,password,user_type", "active=1 and autologin !=''");
        $autolinks = $result['autologin'];
        $key = array_search($_GET['autologin'], $autolinks);
        if ($key !== false) {
            $user = EfrontUserFactory::factory($result['login'][$key]);