Beispiel #1
0
                     if ($arUser['ACTIVE'] != 'Y') {
                         continue;
                     }
                 }
                 if (empty($arUser)) {
                     continue;
                 }
                 $iDocCount = $USER->IsAdmin() ? _getIBlockItemsCount($arParams["IBLOCK_USER_ID"], $arSection["ID"], 'user', $userID) : false;
                 //if ($iDocCount <= 0) continue;
                 $tpl = preg_replace(array("/#NOBR#/", "/#\\/NOBR#/"), array("", ""), $arParams['NAME_TEMPLATE']);
                 $name = CUser::FormatName($tpl, $arUser, false, false);
                 if ($name == ' ' || $name !== htmlspecialcharsbx($name) || empty($arUser['NAME']) && empty($arUser['SECOND_NAME'])) {
                     $name = '(' . $arUser['LOGIN'] . ')';
                 }
                 $path = $rootPath . '/' . $name;
                 $userTree[] = array('NAME' => _getName($path), 'PATH' => _getPath($path, $arParams['SEF_FOLDER']), 'DEPTH_LEVEL' => 1, 'MODE' => 'remote', 'DOCCOUNT' => $iDocCount, 'IB_MODE' => "");
             }
             if ($userCache->StartDataCache()) {
                 $userCache->EndDataCache(array('USER_TREE' => $userTree));
             }
         }
         unset($userCache);
         usort($userTree, "_wd_aggregator_sort");
         $folderTree = array_merge($folderTree, $userTree);
     }
 }
 $folderTree = array_merge(array(array('NAME' => GetMessage('WD_ROOT'), 'PATH' => _getPath($arParams['SEF_FOLDER'], $arParams['SEF_FOLDER']), 'DEPTH_LEVEL' => -1)), $folderTree);
 $ob = new CWebDavVirtual($folderTree, '/', $arParams);
 MakeDavRedirect($ob, $currentPageUrl, $baseURL, $rootPath . '', true);
 $arResult['OBJECT'] = $ob;
 $arResult['STRUCTURE'] = $folderTree;
Beispiel #2
0
                if ($userPerms["PERMISSION"] < "R") {
                    continue;
                }
                $dbUser = CUser::GetByID($userID);
                if ($arUser = $dbUser->Fetch()) {
                    if ($arUser['ACTIVE'] != 'Y') {
                        continue;
                    }
                }
                $tpl = preg_replace(array("/#NOBR#/", "/#\\/NOBR#/"), array("", ""), $arParams['NAME_TEMPLATE']);
                $name = CUser::FormatName($tpl, $arUser, false, false);
                if ($name == ' ' || $name !== htmlspecialcharsbx($name) || empty($arUser['NAME']) && empty($arUser['SECOND_NAME'])) {
                    $name = '(' . $arUser['LOGIN'] . ')';
                }
                $path = $rootPath . '/' . $name;
                $userTree[] = array('NAME' => _getName($path), 'PATH' => $path, 'DEPTH_LEVEL' => 1, 'MODE' => 'remote');
            }
            if ($userCache->StartDataCache()) {
                $userCache->EndDataCache(array('USER_TREE' => $userTree));
            }
        }
        unset($userCache);
        usort($userTree, "_wd_aggregator_sort");
        $folderTree = array_merge($folderTree, $userTree);
    }
}
?>

<?php 
$ob = new CWebDavVirtual($folderTree, '/', $arParams);
$arResult['OBJECT'] = $ob;