Beispiel #1
0
    $e = new CAdminException($ob->arError);
    $GLOBALS["APPLICATION"]->ThrowException($e);
    $res = $GLOBALS["APPLICATION"]->GetException();
    if ($res) {
        ShowError($res->GetString());
        return false;
    }
} elseif ($ob->permission <= "D") {
    ShowError(GetMessage("WD_ACCESS_DENIED"));
    return false;
}
$ob->file_prop = $arParams["NAME_FILE_PROPERTY"];
$ob->replace_symbols = $arParams["REPLACE_SYMBOLS"] == "Y" ? true : false;
$arParams['WORKFLOW'] = $ob->workflow;
$arResult['CURRENT_PATH'] = $ob->_path;
$res = $ob->SetRootSection($arParams["ROOT_SECTION_ID"]);
/********************************************************************
				/
********************************************************************/
if (($_SERVER['REQUEST_METHOD'] == 'POST' || $_SERVER['REQUEST_METHOD'] == 'GET') && !$ob->IsDavHeaders()) {
    if ($componentPage == "user_files" || $componentPage == "group_files") {
        $arResult["VARIABLES"]["SECTION_ID"] = 0;
        if ($arParams["SEF_MODE"] != "Y") {
            $res = explode("/", urldecode($_REQUEST["path"]));
            $result = array();
            foreach ($res as $r) {
                $result[] = urlencode($APPLICATION->ConvertCharset($r, SITE_CHARSET, 'UTF-8'));
            }
            $arResult["VARIABLES"]["PATH"] = implode("/", $result);
            $ob->SetPath("/" . $arResult["VARIABLES"]["PATH"]);
        }
Beispiel #2
0
             } else {
                 ShowError(GetMessage("WD_USER_NOT_FOUND"));
                 return 0;
             }
             $_SERVER['HTTP_DESTINATION'] = str_replace($destName, $destLogin, $_SERVER['HTTP_DESTINATION']);
             $arLocalPath[0] = $destLogin;
         }
     }
     $userPerms = CIBlockWebdavSocnet::GetUserMaxPermission('user', $userID, $currentUserID, $arParams['IBLOCK_USER_ID']);
     foreach (array('PERMISSION', 'CHECK_CREATOR') as $propName) {
         $arParams[$propName] = $userPerms[$propName];
     }
     $arParams["DOCUMENT_TYPE"] = array("webdav", "CIBlockDocumentWebdavSocnet", "iblock_" . $arParams['IBLOCK_USER_ID'] . "_user_" . intVal($userID));
     $basementPath = $rootPath . '/' . $arLocalPath[0];
     $obGroup = new CWebDavIblock($arParams['IBLOCK_USER_ID'], $basementPath, $arParams);
     $obGroup->SetRootSection($sectionID);
     $currentPageUrl = str_replace(array('#USER_ID#', '#PATH#'), array($userID, ''), $arParams["USER_FILE_PATH"]);
     MakeDavRedirect($obGroup, $currentPageUrl, $rootPath . '/' . $arLocalPath[0], '/' . implode('/', array_slice($arLocalPath, 1)) . '/', false);
 } else {
     // user list
     $userTree = array();
     $CACHE_ID = SITE_ID . '|' . $requestURL . '|' . $currentUserID . '|' . (CWebDavBase::IsDavHeaders('check_all') ? 'D' : 'W') . '|USERLIST';
     $userCache = new CPHPCache();
     if ($userCache->InitCache($arParams["CACHE_TIME"], $CACHE_ID, $cachePath)) {
         $vars = $userCache->GetVars();
         $userTree = $vars['USER_TREE'];
     } else {
         $arFilter = array("IBLOCK_ID" => $arParams["IBLOCK_USER_ID"], "SOCNET_GROUP_ID" => false, "CHECK_PERMISSIONS" => "N", "SECTION_ID" => 0);
         $dbSection = CIBlockSection::GetList(array(), $arFilter);
         while ($arSection = $dbSection->Fetch()) {
             $userID = $arSection['CREATED_BY'];