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); }
<?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";
public static function SetAuthHeader() { $digest = static::isDigestEnabled(); CHTTP::SetAuthHeader($digest); }