require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/prolog_admin_before.php"); require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/prolog_admin_js.php"); IncludeModuleLangFile(__FILE__); $popupWindow = new CJSPopup('', array("SUFFIX"=>($_GET['subdialog'] == 'Y'? 'subdialog':''))); if (IsModuleInstalled("fileman")) { if (!$USER->CanDoOperation('fileman_edit_existent_folders') && !$USER->CanDoOperation('fileman_admin_folders')) $popupWindow->ShowError(GetMessage("FOLDER_EDIT_ACCESS_DENIED")); } $io = CBXVirtualIo::GetInstance(); //Folder path $path = "/"; if (isset($_REQUEST["path"]) && $_REQUEST["path"] <> '') $path = $io->CombinePath("/", $_REQUEST["path"]); //Site ID $site = SITE_ID; if (isset($_REQUEST["site"]) && $_REQUEST["site"] <> '') { $obSite = CSite::GetByID($_REQUEST["site"]); if ($arSite = $obSite->Fetch()) $site = $_REQUEST["site"]; } //Document Root $documentRoot = CSite::GetSiteDocRoot($site); //Check path permissions if (!$io->FileExists($documentRoot.$path) && !$io->DirectoryExists($documentRoot.$path)) $popupWindow->ShowError(GetMessage("ACCESS_EDIT_FILE_NOT_FOUND")." (".htmlspecialcharsbx($path).")"); elseif (!$USER->CanDoFileOperation('fm_edit_existent_folder', array($site, $path))) $popupWindow->ShowError(GetMessage("FOLDER_EDIT_ACCESS_DENIED")); elseif (!$USER->CanDoFileOperation('fm_edit_permission', array($site, $path))) $popupWindow->ShowError(GetMessage("EDIT_ACCESS_TO_DENIED")." \"".htmlspecialcharsbx($path)."\""); //Lang if (!isset($_REQUEST["lang"]) || $_REQUEST["lang"] == '') $lang = LANGUAGE_ID; //BackUrl $back_url = ($_REQUEST["back_url"] ?? ""); //Is a folder? $isFolder = $io->DirectoryExists($documentRoot.$path); //Get only used user group from .access.php file $arUserGroupsID = array("*"); $assignFileName = ""; $assignFolderName = ""; $currentPath = $path; while(true) { //Cut / from the end $currentPath = rtrim($currentPath, "/"); if ($currentPath == '') { $accessFile = "/.access.php"; $name = "/"; } else { //Find file or folder name $position = mb_strrpos($currentPath, "/"); if ($position === false) break; $name = mb_substr($currentPath, $position + 1); $name = TrimUnsafe($name); //security fix: under Windows "my." == "my" //Find parent folder $currentPath = mb_substr($currentPath, 0, $position + 1); $accessFile = $currentPath.".access.php"; } $PERM = Array(); if ($io->FileExists($documentRoot.$accessFile)) include($io->GetPhysicalName($documentRoot.$accessFile)); if ($assignFileName == "") { $assignFileName = $name; $assignFolderName = ($name == "/" ? "/" : $currentPath); } if (isset($PERM[$name]) && is_array($PERM[$name])) $arUserGroupsID = array_merge($arUserGroupsID, array_keys($PERM[$name])); if ($currentPath == '') break; } foreach($arUserGroupsID as $key=>$val) if(preg_match('/^[0-9]+$/', $val)) $arUserGroupsID[$key] = "G".$val; $arUserGroupsID = array_unique($arUserGroupsID); //Get all tasks $arPermTypes = array(); $obTask = CTask::GetList(array("LETTER" => "ASC"), array("MODULE_ID" => "main", "BINDING" => "file")); while($arTask = $obTask->Fetch()) $arPermTypes[$arTask["ID"]] = CTask::GetLangTitle($arTask["NAME"], $arTask["MODULE_ID"]); //Current file/folder permissions $currentPermission = array(); if($io->FileExists($documentRoot.$assignFolderName.".access.php")) { $PERM = array(); include($io->GetPhysicalName($documentRoot.$assignFolderName.".access.php")); foreach($PERM as $file => $arPerm) foreach($arPerm as $code => $permission) $currentPermission[$file][(preg_match('/^[0-9]+$/', $code)? "G".$code : $code)] = $permission; } $strWarning = ""; //Save permissions if ($_SERVER["REQUEST_METHOD"] == "POST" && !check_bitrix_sessid()) { CUtil::JSPostUnescape(); $strWarning = GetMessage("MAIN_SESSION_EXPIRED"); } elseif ($_SERVER["REQUEST_METHOD"] == "POST" && isset($_REQUEST["save"])) { CUtil::JSPostUnescape(); $arSavePermission = array(); if (isset($_POST["REMOVE_PERMISSIONS"]) && $_POST["REMOVE_PERMISSIONS"] == "Y") { if($path != "/") { $APPLICATION->RemoveFileAccessPermission(array($site, $path)); if ($e = $APPLICATION->GetException()) $strWarning = $e->msg; } } else { if (isset($_POST["PERMISSION"]) && is_array($_POST["PERMISSION"])) { if (isset($currentPermission[$assignFileName]) && is_array($currentPermission[$assignFileName])) $arSavePermission = $currentPermission[$assignFileName]; $isAdmin = $USER->IsAdmin(); foreach ($_POST["PERMISSION"] as $groupID => $taskID) { if($groupID !== "*") { $groupID = trim($groupID); if($groupID == '') continue; } elseif (!$isAdmin) continue; // if not set task - delete permission $taskID = intval($taskID); if ($taskID <= 0) { unset($arSavePermission[$groupID]); continue; } $obTask = CTask::GetById($taskID); if ( ($arTask = $obTask->Fetch()) && $arTask["LETTER"] && $arTask["SYS"] == "Y") $permLetter = $arTask["LETTER"]; else $permLetter = "T_".$taskID; $arSavePermission[$groupID] = $permLetter; } } $APPLICATION->SetFileAccessPermission(array($site, $path), $arSavePermission); if ($e = $APPLICATION->GetException()) $strWarning = $e->msg; } //Close window if ($strWarning == "") { $popupWindow->Close($bReload=($_GET['subdialog'] <> 'Y'), $back_url); die(); } } echo CJSCore::Init(array('access'), true); //HTML output if ($isFolder) $popupWindow->ShowTitlebar(GetMessage("EDIT_ACCESS_TO_FOLDER")); else $popupWindow->ShowTitlebar(GetMessage("EDIT_ACCESS_TO_FILE")); $popupWindow->StartDescription($isFolder ? "bx-access-folder" : "bx-access-page"); if ($strWarning != "") $popupWindow->ShowValidationError($strWarning); ?>
Warning: Undefined variable $isFolder in D:\ktt\ttepla.com\public_html\bitrix\modules\main\public\access_edit.php on line 214
Fatal error: Uncaught Error: Call to undefined function GetMessage() in D:\ktt\ttepla.com\public_html\bitrix\modules\main\public\access_edit.php:214
Stack trace:
#0 {main}
thrown in D:\ktt\ttepla.com\public_html\bitrix\modules\main\public\access_edit.php on line 214