當前位置: 首頁>>代碼示例>>PHP>>正文


PHP EfrontUser::checkUserAccess方法代碼示例

本文整理匯總了PHP中EfrontUser::checkUserAccess方法的典型用法代碼示例。如果您正苦於以下問題:PHP EfrontUser::checkUserAccess方法的具體用法?PHP EfrontUser::checkUserAccess怎麽用?PHP EfrontUser::checkUserAccess使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在EfrontUser的用法示例。


在下文中一共展示了EfrontUser::checkUserAccess方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: session_cache_limiter

/**
 * Set positions of control panel elements
 *
 * This page is used to store the positions of the users' control panel elements
 *
 * @package eFront
 * @version 1.0
 */
session_cache_limiter('none');
session_start();
$path = "../libraries/";
/** Configuration file.*/
include_once $path . "configuration.php";
try {
    $currentUser = EfrontUser::checkUserAccess();
} catch (Exception $e) {
    echo "<script>parent.location = 'index.php?logout=true&message=" . urlencode($e->getMessage() . ' (' . $e->getCode() . ')') . "&message_type=failure'</script>";
    //This way the frameset will revert back to single frame, and the annoying effect of 2 index.php, one in each frame, will not happen
    exit;
}
try {
    if ($_SESSION['s_lessons_ID']) {
        $currentLesson = new EfrontLesson($_SESSION['s_lessons_ID']);
    } elseif ($_POST['lessons_ID']) {
        $currentLesson = new EfrontLesson($_POST['lessons_ID']);
    }
    if (isset($currentUser->coreAccess['settings']) && $currentUser->coreAccess['settings'] != 'change') {
        throw new Exception();
    }
} catch (Exception $e) {
開發者ID:bqq1986,項目名稱:efront,代碼行數:30,代碼來源:set_positions.php

示例2: header

// Date in the past
header("cache-control: no-transform");
//To prevent 3G carriers from compressing the site, which will break all grids
//If the page is shown as a popup, make sure it remains in such mode
if (!isset($_GET['reset_popup']) && (isset($_GET['popup']) || isset($_POST['popup']) || isset($_SERVER['HTTP_REFERER']) && strpos(strtolower($_SERVER['HTTP_REFERER']), 'popup') !== false && strpos(strtolower($_SERVER['HTTP_REFERER']), 'reset_popup') === false)) {
    output_add_rewrite_var('popup', 1);
    $smarty->assign("T_POPUP_MODE", true);
    $popup = 1;
}
setcookie("parent_sid", session_id(), time() + 3600, "/");
//We use this for the editor, in order to work with branch urls. See also browse.php, image.php on how it's used
$message = '';
$message_type = '';
//Initialize messages, because if register_globals is turned on, some messages will be displayed twice
try {
    $currentUser = EfrontUser::checkUserAccess(false, 'professor');
    if ($currentUser->user['user_type'] == 'administrator') {
        throw new Exception(_ADMINISTRATORCANNOTACCESSLESSONPAGE, EfrontUserException::RESTRICTED_USER_TYPE);
    }
    $smarty->assign("T_CURRENT_USER", $currentUser);
} catch (Exception $e) {
    if ($e->getCode() == EfrontUserException::USER_NOT_LOGGED_IN && !isset($_GET['ajax'])) {
        setcookie('c_request', htmlspecialchars_decode(basename($_SERVER['REQUEST_URI'])), time() + 300, false, false, false, true);
    }
    eF_redirect("index.php?ctg=expired");
    exit;
}
if (isset($_SESSION['s_index_comply'])) {
    eF_redirect("index.php?ctg=" . $_SESSION['s_index_comply']);
    exit;
}
開發者ID:kaseya-university,項目名稱:efront,代碼行數:31,代碼來源:professor.php

示例3: output_add_rewrite_var

//If the page is shown as a popup, make sure it remains in such mode
if (!isset($_GET['reset_popup']) && (isset($_GET['popup']) || isset($_POST['popup']) || isset($_SERVER['HTTP_REFERER']) && strpos(strtolower($_SERVER['HTTP_REFERER']), 'popup') !== false && strpos(strtolower($_SERVER['HTTP_REFERER']), 'reset_popup') === false)) {
    output_add_rewrite_var('popup', 1);
    $smarty->assign("T_POPUP_MODE", true);
    $popup = 1;
}
$search_message = $message = $message_type = '';
//Initialize messages, because if register_globals is turned on, some messages will be displayed twice
$load_editor = false;
$loadScripts = array();
try {
    if ($_GET['student']) {
        $currentUser = EfrontUserFactory::factory('student', false, 'student');
        $currentUser->login($currentUser->user['password'], true);
    } else {
        $currentUser = EfrontUser::checkUserAccess(false, 'student');
    }
    if ($currentUser->user['user_type'] == 'administrator') {
        throw new Exception(_ADMINISTRATORCANNOTACCESSLESSONPAGE, EfrontUserException::RESTRICTED_USER_TYPE);
    }
    $smarty->assign("T_CURRENT_USER", $currentUser);
} catch (Exception $e) {
    if ($e->getCode() == EfrontUserException::USER_NOT_LOGGED_IN && !isset($_GET['ajax'])) {
        setcookie('c_request', htmlspecialchars_decode(basename($_SERVER['REQUEST_URI'])), time() + 300);
    }
    eF_redirect("index.php?ctg=expired");
    exit;
}
if (isset($_SESSION['s_index_comply'])) {
    eF_redirect("index.php?ctg=" . $_SESSION['s_index_comply']);
    exit;
開發者ID:kaseya-university,項目名稱:efront,代碼行數:31,代碼來源:student.php

示例4: output_add_rewrite_var

//To prevent 3G carriers from compressing the site, which will break all grids
//pr($_SESSION);
//If the page is shown as a popup, make sure it remains in such mode
if (!isset($_GET['reset_popup']) && (isset($_GET['popup']) || isset($_POST['popup']) || isset($_SERVER['HTTP_REFERER']) && strpos(strtolower($_SERVER['HTTP_REFERER']), 'popup') !== false && strpos(strtolower($_SERVER['HTTP_REFERER']), 'reset_popup') === false && !strpos(strtolower($_SERVER['HTTP_REFERER']), 'evaluation'))) {
    output_add_rewrite_var('popup', 1);
    $smarty->assign("T_POPUP_MODE", true);
    $popup = 1;
}
setcookie("parent_sid", session_id(), time() + 3600, "/");
//We use this for the editor, in order to work with branch urls. See also browse.php, image.php on how it's used
$message = $message_type = $search_message = '';
//Initialize messages, because if register_globals is turned on, some messages will be displayed twice
$load_editor = false;
$loadScripts = array();
try {
    $currentUser = EfrontUser::checkUserAccess('administrator');
    $smarty->assign("T_CURRENT_USER", $currentUser);
} catch (Exception $e) {
    if ($e->getCode() == EfrontUserException::USER_NOT_LOGGED_IN && !isset($_GET['ajax'])) {
        setcookie('c_request', htmlspecialchars_decode(basename($_SERVER['REQUEST_URI'])), time() + 300, false, false, false, true);
    }
    eF_redirect("index.php?ctg=expired");
    exit;
}
if (isset($_SESSION['s_index_comply'])) {
    eF_redirect("index.php?ctg=" . $_SESSION['s_index_comply']);
    exit;
}
if (!isset($_GET['ajax']) && !isset($_GET['postAjaxRequest']) && !isset($popup) && !isset($_GET['tabberajax'])) {
    $_SESSION['previousMainUrl'] = $_SERVER['REQUEST_URI'];
}
開發者ID:bqq1986,項目名稱:efront,代碼行數:31,代碼來源:administrator.php


注:本文中的EfrontUser::checkUserAccess方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。