本文整理汇总了PHP中CFileMan::FetchFileAccessPerm方法的典型用法代码示例。如果您正苦于以下问题:PHP CFileMan::FetchFileAccessPerm方法的具体用法?PHP CFileMan::FetchFileAccessPerm怎么用?PHP CFileMan::FetchFileAccessPerm使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CFileMan
的用法示例。
在下文中一共展示了CFileMan::FetchFileAccessPerm方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
if ($_SERVER["REQUEST_METHOD"] == "POST" && isset($_REQUEST["save"]) && $strWarning == "")
{
CUtil::JSPostUnescape();
CModule::IncludeModule("fileman");
$f = $io->GetFile($absoluteFilePath);
$arUndoParams = array(
'module' => 'fileman',
'undoType' => 'delete_file',
'undoHandler' => 'CFileman::UndoFileDelete',
'arContent' => array(
'path' => $path,
'content' => $f->GetContents(),
'site' => $site,
'perm' => CFileMan::FetchFileAccessPerm(Array($site, $path)),
'SEF' => CUrlRewriter::GetList(array("PATH" => $path))
)
);
$success = BXDeleteFromSystem($absoluteFilePath, $path, $site);
if ($success)
{
if ($deleteFromMenu)
$arUndoParams['arContent']['menu'] = BXDeleteFromMenu($documentRoot, $path, $site);
if($_GET['subdialog'] == 'Y')
echo "<script>structReload('".urlencode($_REQUEST["path"])."');</script>";
$ID = CUndo::Add($arUndoParams);
示例2: preg_replace
$io = CBXVirtualIo::GetInstance();
$path = $io->CombinePath("/", $path);
$arParsedPath = CFileMan::ParsePath(array($site, $path), true, false, "", $logical == "Y");
$menufilename = $path;
$name = preg_replace("/[^a-z0-9_]/i", "", $_REQUEST["name"]);
$menufilename = $io->CombinePath($path, "." . $name . ".menu.php");
$arPath_m = array($site, $menufilename);
$abs_path = $io->CombinePath($DOC_ROOT, $menufilename);
$strWarning = "";
$module_id = "fileman";
//delete menu file
if ($_REQUEST["action"] == "delete" && check_bitrix_sessid()) {
$success = false;
if ($io->FileExists($abs_path) && $USER->CanDoFileOperation('fm_delete_file', $arPath_m)) {
$f = $io->GetFile($abs_path);
$arUndoParams = array('module' => 'fileman', 'undoType' => 'delete_menu', 'undoHandler' => 'CFileman::UndoFileDelete', 'arContent' => array('site' => $site, 'path' => $menufilename, 'content' => $f->GetContents(), 'perm' => CFileMan::FetchFileAccessPerm($arPath_m, true)));
if (COption::GetOptionInt("main", "disk_space") > 0) {
$quota = new CDiskQuota();
$quota->UpdateDiskQuota("file", $f->GetFileSize(), "delete");
}
$f->MarkWritable();
$success = $io->Delete($abs_path);
if (COption::GetOptionString($module_id, "log_menu", "Y") == "Y") {
$mt = COption::GetOptionString("fileman", "menutypes", $default_value, $site);
$mt = unserialize(str_replace("\\", "", $mt));
$res_log['menu_name'] = $mt[$name];
$res_log['path'] = substr($path, 1);
CEventLog::Log("content", "MENU_DELETE", "main", "", serialize($res_log));
}
if ($success) {
$GLOBALS["APPLICATION"]->RemoveFileAccessPermission($arPath_m);
示例3: array
//delete menu file
if($_REQUEST["action"] == "delete" && check_freetrix_sessid())
{
$success = false;
if($io->FileExists($abs_path) && $USER->CanDoFileOperation('fm_delete_file', $arPath_m))
{
$f = $io->GetFile($abs_path);
$arUndoParams = array(
'module' => 'fileman',
'undoType' => 'delete_menu',
'undoHandler' => 'CFileman::UndoFileDelete',
'arContent' => array(
'site' => $site,
'path' => $menufilename,
'content' => $f->GetContents(),
'perm' => CFileMan::FetchFileAccessPerm($arPath_m, true),
)
);
if (COption::GetOptionInt("main", "disk_space") > 0)
{
$quota = new CDiskQuota();
$quota->UpdateDiskQuota("file", $f->GetFileSize(), "delete");
}
$f->MarkWritable();
$success = $io->Delete($abs_path);
if(COption::GetOptionString($module_id, "log_menu", "Y")=="Y")
{
$mt = COption::GetOptionString("fileman", "menutypes", $default_value, $site);
示例4: isset
$deleteFromMenu = isset($_REQUEST["delete_from_menu"]) && $_REQUEST["delete_from_menu"] == "Y";
if (!check_bitrix_sessid()) {
$strWarning = GetMessage("MAIN_SESSION_EXPIRED");
}
} else {
if ($io->ExtractNameFromPath($path) == "index.php") {
$strNotice = GetMessage("PAGE_DELETE_INDEX_WARNING");
}
$deleteFromMenu = true;
}
//Delete File
if ($_SERVER["REQUEST_METHOD"] == "POST" && isset($_REQUEST["save"]) && $strWarning == "") {
CUtil::JSPostUnescape();
CModule::IncludeModule("fileman");
$f = $io->GetFile($absoluteFilePath);
$arUndoParams = array('module' => 'fileman', 'undoType' => 'delete_file', 'undoHandler' => 'CFileman::UndoFileDelete', 'arContent' => array('path' => $path, 'content' => $f->GetContents(), 'site' => $site, 'perm' => CFileMan::FetchFileAccessPerm(array($site, $path)), 'SEF' => CUrlRewriter::GetList(array("PATH" => $path))));
$success = BXDeleteFromSystem($absoluteFilePath, $path, $site);
if ($success) {
if ($deleteFromMenu) {
$arUndoParams['arContent']['menu'] = BXDeleteFromMenu($documentRoot, $path, $site);
}
if ($_GET['subdialog'] == 'Y') {
echo "<script>structReload('" . urlencode($_REQUEST["path"]) . "');</script>";
}
$ID = CUndo::Add($arUndoParams);
CUndo::ShowUndoMessage($ID);
//CUndo::Escape($ID);
$popupWindow->Close($bReload = $_GET['subdialog'] != 'Y', $back_url);
} else {
$strWarning = GetMessage("PAGE_DELETE_ERROR_OCCURED");
}