Beispiel #1
0
 $bNeedInclude = true;
 if ($_SERVER["REQUEST_METHOD"] == "HEAD") {
     $res = strtolower($_SERVER["HTTP_USER_AGENT"]);
     if (strpos($res, "microsoft") === false && strlen($_SERVER["REAL_FILE_PATH"]) <= 0 && substr($_SERVER['REQUEST_URI'], -1, 1) == '/') {
         $bNeedInclude = false;
         $res = CUrlRewriter::GetList(array("QUERY" => $_SERVER['REQUEST_URI']));
         foreach ($res as $res_detail) {
             if (strpos($res_detail["ID"], "webdav") !== false || strpos($res_detail["ID"], "disk") !== false || strpos($res_detail["ID"], "socialnetwork") !== false) {
                 $bNeedInclude = true;
                 break;
             }
         }
     }
 }
 if (__webdavIsDavHeaders() && $bNeedInclude) {
     if (CModule::includeModule('ldap') && CLdapUtil::isBitrixVMAuthSupported()) {
         CLdapUtil::bitrixVMAuthorize();
     }
     if (!$_SERVER['PHP_AUTH_USER'] || !$_SERVER['PHP_AUTH_USER']) {
         $res = !empty($_SERVER['REDIRECT_REMOTE_USER']) ? $_SERVER['REDIRECT_REMOTE_USER'] : $_SERVER['REMOTE_USER'];
         if (!empty($res) && preg_match('/(?<=(basic\\s))(.*)$/is', $res, $matches)) {
             $res = trim($matches[0]);
             list($_SERVER["PHP_AUTH_USER"], $_SERVER["PHP_AUTH_PW"]) = explode(':', base64_decode($res));
         }
     }
     if (!is_array($GLOBALS["APPLICATION"]->arComponentMatch)) {
         $GLOBALS["APPLICATION"]->arComponentMatch = array();
     }
     $GLOBALS["APPLICATION"]->arComponentMatch[] = 'dav';
     $GLOBALS["APPLICATION"]->arComponentMatch[] = 'disk';
     $GLOBALS["APPLICATION"]->arComponentMatch[] = 'socialnetwork';