當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。