Exemple #1
0
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);
Exemple #2
0
$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);
Exemple #3
0
//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);
    $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");
    }