当前位置: 首页>>代码示例>>PHP>>正文


PHP EfrontUser::checkWebserverAuthentication方法代码示例

本文整理汇总了PHP中EfrontUser::checkWebserverAuthentication方法的典型用法代码示例。如果您正苦于以下问题:PHP EfrontUser::checkWebserverAuthentication方法的具体用法?PHP EfrontUser::checkWebserverAuthentication怎么用?PHP EfrontUser::checkWebserverAuthentication使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在EfrontUser的用法示例。


在下文中一共展示了EfrontUser::checkWebserverAuthentication方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: checkUserAccess

 public static function checkUserAccess($type = false, $forceType = false)
 {
     if ($GLOBALS['configuration']['webserver_auth']) {
         $user = EfrontUser::checkWebserverAuthentication();
     } else {
         if (isset($_SESSION['s_login']) && $_SESSION['s_password']) {
             $user = EfrontUserFactory::factory($_SESSION['s_login'], false, $forceType);
         } else {
             throw new EfrontUserException(_RESOURCEREQUESTEDREQUIRESLOGIN, EfrontUserException::USER_NOT_LOGGED_IN);
         }
     }
     if (!$user->isLoggedIn(session_id())) {
         throw new EfrontUserException(_RESOURCEREQUESTEDREQUIRESLOGIN, EfrontUserException::USER_NOT_LOGGED_IN);
     }
     if ($user->user['timezone']) {
         date_default_timezone_set($user->user['timezone']);
     }
     $user->applyRoleOptions($user->user['user_types_ID']);
     //Initialize user's role options for this lesson
     if ($type && $user->user['user_type'] != $type) {
         throw new Exception(_YOUCANNOTACCESSTHISPAGE, EfrontUserException::INVALID_TYPE);
     }
     return $user;
 }
开发者ID:kaseya-university,项目名称:efront,代码行数:24,代码来源:user.class-backup.php

示例2: catch

} else {
    /** Configuration file */
    require_once $path . "configuration.php";
}
if ($_SESSION['s_login']) {
    try {
        $currentUser = EfrontUser::checkUserAccess(false, $_SESSION['s_type']);
    } catch (Exception $e) {
        unset($_SESSION['s_login']);
        eF_redirect(basename($_SERVER['PHP_SELF']) . "?ctg=login&message=" . urlencode(_YOURSESSIONHASEXPIREDPLEASELOGINAGAIN));
        exit;
    }
}
if ($GLOBALS['configuration']['webserver_auth']) {
    eval('$usernameVar=' . $GLOBALS['configuration']['username_variable'] . ';');
    $currentUser = EfrontUser::checkWebserverAuthentication();
    $currentUser->login($currentUser->user['password'], true);
}
//@todo:temporary here, should leave
$cacheId = null;
$message = $message_type = '';
$benchmark = new EfrontBenchmark($debug_TimeStart);
$benchmark->set('init');
//Set headers in order to eliminate browser cache (especially IE's)
header("Cache-Control: no-cache, must-revalidate");
// HTTP/1.1
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
// Date in the past
header("cache-control: no-transform");
//To prevent 3G carriers from compressing the site, which will break all grids
//Delete installation directory after install/upgrade
开发者ID:bqq1986,项目名称:efront,代码行数:31,代码来源:index.php


注:本文中的EfrontUser::checkWebserverAuthentication方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。