本文整理汇总了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;
}
示例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