当前位置: 首页>>代码示例>>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;未经允许,请勿转载。