Пример #1
0
		<td><input type="checkbox" name="UF_USE_BP" id="UF_USE_BP" value="Y" <?php 
    echo $arLibrary["UF_USE_BP"] == "N" ? '' : ' checked="checked" ';
    ?>
 />&nbsp;<label for="UF_USE_BP"><?php 
    echo GetMessage("SN_BP_LABEL");
    ?>
</label> </td>
	</tr>
</table>
<?php 
    if ($USER->IsAdmin() && $object === 'group') {
        $arParams["DOCUMENT_TYPE"] = array("webdav", "CIBlockDocumentWebdavSocnet", $documentType);
        $arParams["ROOT_SECTION_ID"] = __wd_get_root_section($IBLOCK_ID, $object, $object_id);
        if ($arParams["ROOT_SECTION_ID"] === true) {
            // created new
            $arParams["ROOT_SECTION_ID"] = __wd_get_root_section($IBLOCK_ID, $object, $object_id);
        }
        $ob = new CWebDavIblock($IBLOCK_ID, '/', $arParams + array("ATTRIBUTES" => $object == "user" ? array('user_id' => $object_id) : array('group_id' => $object_id)));
        ?>
	<tr class="section">
		<td colspan="2" align="center"><b><?php 
        echo GetMessage("WD_TAB15_TITLE");
        ?>
</b></td>
	</tr>
<?php 
        $UF_ENTITY = $ob->GetUfEntity();
        $arUserField = $ob->GetUfFields();
        $backUrl = "/";
        if (isset($_REQUEST["back_url"])) {
            $backUrl = $_REQUEST["back_url"];
Пример #2
0
				Default params 
********************************************************************/
define("WEBDAV_SETTINGS_LIMIT_INCLUDE", "Y");
$file = trim(preg_replace("'[\\\\/]+'", "/", dirname(__FILE__) . "/webdav_settings.php"));
require_once $file;
/************** Path ***********************************************/
$sBaseUrl = $APPLICATION->GetCurDir();
$arParsedUrl = parse_url($_SERVER['REQUEST_URI']);
$page = $arParsedUrl ? $arParsedUrl['path'] : $_SERVER['REQUEST_URI'];
/************** Initial object *************************************/
$arParams["DOCUMENT_TYPE"] = array("webdav", "CIBlockDocumentWebdavSocnet", "iblock_" . $arParams["IBLOCK_ID"] . "_" . $object . "_" . intVal($object == "user" ? $arResult["VARIABLES"]["user_id"] : $arResult["VARIABLES"]["group_id"]));
$arBizProcParameters = array("object" => $object, "owner" => $object == "user" ? $arResult["VARIABLES"]["user_id"] : $arResult["GROUP"]["OWNER_ID"], "moderator" => strtolower($object == "user" ? SONET_RELATIONS_TYPE_NONE : SONET_ROLES_MODERATOR), "path" => $object == "user" ? $arResult["PATH_TO_USER_FILES_WEBDAV_BIZPROC_VIEW"] : $arResult["PATH_TO_GROUP_FILES_WEBDAV_BIZPROC_VIEW"], "document_type" => $ob->wfParams['DOCUMENT_TYPE'][2]);
$user_id_str = intVal($arResult["VARIABLES"]["user_id"]) > 0 ? $arResult["VARIABLES"]["user_id"] : $GLOBALS["USER"]->GetId();
$arBizProcParameters["path"] = str_replace(array("#user_id#", "#group_id#", "#element_id#"), array($user_id_str, $arResult["VARIABLES"]["group_id"], "{=Document:ID}"), $arBizProcParameters["path"]);
/************** Root Section ***************************************/
$arParams["ROOT_SECTION_ID"] = __wd_get_root_section($arParams["IBLOCK_ID"], $object, $object == 'user' ? $arResult["VARIABLES"]["user_id"] : $arResult["VARIABLES"]["group_id"]);
if ($arParams["ROOT_SECTION_ID"] === true) {
    BXClearCache(true, $ob->CACHE_PATH);
    LocalRedirect($APPLICATION->GetCurPageParam("", array("create_lib", "sessid")));
}
if ($object == "user") {
    CIBlockWebdavSocnet::CreateSharedFolder($arParams["IBLOCK_ID"], $arParams["ROOT_SECTION_ID"], $arResult["VARIABLES"]["user_id"]);
}
$arParams["OBJECT"] = $ob = new CWebDavIblock($arParams['IBLOCK_ID'], $arResult['BASE_URL'], $arParams + array("SHORT_PATH_TEMPLATE" => "/" . ($object == "user" ? $arDefaultUrlTemplates404["user_files_short"] : $arDefaultUrlTemplates404["group_files_short"]), "ATTRIBUTES" => $object == "user" ? array('user_id' => $arResult["VARIABLES"]["user_id"]) : array('group_id' => $arResult["VARIABLES"]["group_id"])));
if (!empty($ob->arError)) {
    $e = new CAdminException($ob->arError);
    $GLOBALS["APPLICATION"]->ThrowException($e);
    $res = $GLOBALS["APPLICATION"]->GetException();
    if ($res) {
        ShowError($res->GetString());
        return false;