本文整理匯總了PHP中CHTTP::SetAuthHeader方法的典型用法代碼示例。如果您正苦於以下問題:PHP CHTTP::SetAuthHeader方法的具體用法?PHP CHTTP::SetAuthHeader怎麽用?PHP CHTTP::SetAuthHeader使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類CHTTP
的用法示例。
在下文中一共展示了CHTTP::SetAuthHeader方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: SetAuthHeader
public function SetAuthHeader()
{
$digest = true;
if (strpos($_SERVER['HTTP_USER_AGENT'], "Microsoft-WebDAV-MiniRedir") !== false) {
if (preg_match("/([^\\/]*)\\/(\\d+).(\\d+).(\\d+)/", $_SERVER['HTTP_USER_AGENT'], $matches) > 0) {
if (intval($matches[2]) < 6) {
$digest = false;
}
}
} elseif (strpos($_SERVER['HTTP_USER_AGENT'], "Microsoft Data Access Internet Publishing Provider") !== false || self::GetWindowsVersion() === 5 && strpos($_SERVER['HTTP_USER_AGENT'], "Microsoft Office Protocol Discovery") !== false) {
$digest = false;
} else {
$digest = true;
}
CHTTP::SetAuthHeader($digest);
}
示例2: define
<?php
/**
* This script requests BASIC authorization
*/
$_GET['tid'] = null;
$_GET['fid'] = null;
$_GET['TASK_ID'] = null;
if (isset($_GET['fileid']) && $_GET['fileid']) {
$_GET['fid'] = (int) $_GET['fileid'];
}
if (isset($_GET['taskid']) && $_GET['taskid']) {
$_GET['TASK_ID'] = (int) $_GET['taskid'];
}
define('NOT_CHECK_PERMISSIONS', true);
require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_before.php";
// Not authorized?
if (!(isset($USER) && is_object($USER) && method_exists($USER, 'getid') && $USER->getId())) {
// Request basic authorization
CHTTP::SetAuthHeader(false);
die;
}
require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/components/bitrix/tasks.task.detail/show_file.php";
示例3: SetAuthHeader
public static function SetAuthHeader()
{
$digest = static::isDigestEnabled();
CHTTP::SetAuthHeader($digest);
}