예제 #1
0
            $site = $arSite["ID"];
            break;
        }
    }
} else {
    while ($arSite = $dbSitesList->GetNext()) {
        $dir = rtrim($arSite["DIR"], "/");
        if (substr($path, 0, strlen($dir)) == $dir) {
            $site = $arSite["ID"];
            break;
        }
    }
}
$site = CFileMan::__CheckSite($site);
$DOC_ROOT = CSite::GetSiteDocRoot($site);
$arParsedPath = CFileMan::ParsePath(array($site, $path), true, false, "", $logical == "Y");
$menufilename = $path;
$bExists = false;
$arTypes = array();
$armt = GetMenuTypes($site, "left=" . GetMessage("FILEMAN_MENU_EDIT_LEFT_MENU") . ",top=" . GetMessage("FILEMAN_MENU_EDIT_TOP_MENU"));
foreach ($armt as $key => $title) {
    if (!$USER->CanDoFileOperation('fm_edit_existent_file', array($site, $path . "/." . $key . ".menu.php"))) {
        continue;
    }
    $arTypes[] = array($key, $title);
    if ($key == $name) {
        $bExists = true;
    }
}
if (!$bExists) {
    $name = $arTypes[0][0];
예제 #2
0
                            $mt = unserialize(str_replace("\\", "", $mt));
                            $res_log['menu_name'] = $mt[$menutype];
                            $res_log['path'] = substr(dirname($path), 1);
                            CEventLog::Log("content", "MENU_EDIT", "fileman", "", serialize($res_log));
                        }
                    }
                }
                if (strlen($strWarning) <= 0 && strlen($apply) <= 0 && strlen($apply2) <= 0) {
                    LocalRedirect($url);
                } else {
                    LocalRedirect("/bitrix/admin/fileman_html_edit.php?" . $addUrl . "&site=" . Urlencode($site) . "&path=" . UrlEncode($path) . "&back_url=" . UrlEncode($back_url) . "&fullscreen=" . ($bFullScreen ? "Y" : "N") . "&tabControl_active_tab=" . urlencode($tabControl_active_tab));
                }
            }
            $filesrc_tmp = $filesrc_for_save;
            $path = $io->CombinePath("/", $path);
            $arParsedPath = CFileMan::ParsePath($path, true, false, "", $logical == "Y");
            $abs_path = $io->CombinePath($DOC_ROOT, $path);
        }
    }
}
if (strlen($propeditmore) > 0) {
    $bVarsFromForm = True;
}
$bEditProps = false;
if (!$bVarsFromForm) {
    if (!$bEdit && strlen($filename) <= 0) {
        $filename = $USER->CanDoOperation('edit_php') || $limit_php_access ? "untitled.php" : "untitled.html";
    }
    if (!$bFullPHP) {
        $res = CFileman::ParseFileContent($filesrc_tmp, true);
        $filesrc = $res["CONTENT"];
예제 #3
0
    }
    $handle_action = false;
}
// Handling actions: group and single
if (($arID = $lAdmin->GroupAction()) && ($USER->CanDoOperation('fileman_admin_files') || $USER->CanDoOperation('fileman_admin_folders')) && $handle_action) {
    if ($_REQUEST['action_target'] == 'selected') {
        $arID = array();
        if ($bSearch) {
            $searchRes = CFilemanSearch::GetSearchResult($searchSess);
            for ($i = 0, $l = count($searchRes); $i < $l; $i++) {
                $arID[] = $searchRes[$i]['path'];
            }
        } elseif (!CSite::IsDistinctDocRoots() || strlen($site) > 0 || strlen($path) > 0) {
            $DOC_ROOT = CSite::GetSiteDocRoot($site);
            $path = $io->CombinePath("/", $path);
            $arParsedPath = CFileMan::ParsePath(array($site, $path));
            $abs_path = $DOC_ROOT . $path;
            CFileMan::GetDirList(array($site, $path), $arDirs, $arFiles, $arFilter, array($by => $order), "DF", false, true);
            foreach ($arDirs as $Dir) {
                $arID[] = $Dir["NAME"];
            }
            foreach ($arFiles as $File) {
                $arID[] = $File["NAME"];
            }
        }
    }
    foreach ($arID as $ID) {
        if (strlen($ID) <= 0 || $ID == '.') {
            continue;
        }
        // For search results we have full pathes
예제 #4
0
<?php

require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_admin_before.php";
require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/fileman/prolog.php";
if (!$USER->CanDoOperation('fileman_view_file_structure')) {
    $APPLICATION->AuthForm(GetMessage("ACCESS_DENIED"));
}
require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/fileman/include.php";
$site = CFileMan::__CheckSite($site);
$DOC_ROOT = CSite::GetSiteDocRoot($site);
$strWarning = "";
$path = Rel2Abs("/", $path);
$arParsedPath = CFileMan::ParsePath($path);
$arPath = array($site, $path);
if ($type == "flash") {
    $ext = "swf,fla";
} elseif ($type == "image") {
    $ext = "gif,jpg,jpeg,bmp,png";
}
require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_popup_admin.php";
if (!$USER->CanDoFileOperation('fm_download_file', $arPath) || HasScriptExtension($path)) {
    ShowError($arParsedPath["HTML"] . '<br><br><img src="/bitrix/images/fileman/deny.gif" width="28" height="28" border="0" align="left" alt="">' . GetMessage("ACCESS_DENIED"));
} else {
    CFileMan::GetDirList(array($site, $path), $arDirs, $arFiles, array("EXTENSIONS" => $ext, "MIN_PERMISSION" => "R"), array("name" => "asc"));
    ?>
<script>
<!--
function DoEvent(str)
{
	try
	{
예제 #5
0
                        } else {
                            if ($USER->CanDoFileOperation('fm_create_new_file', $arPath) && $USER->CanDoOperation('fileman_admin_files') && $mkindex == "Y") {
                                if ($toedit == "Y") {
                                    LocalRedirect("/bitrix/admin/fileman_html_edit.php?" . $addUrl . "&site=" . $site . "&template=" . Urlencode($template) . "&path=" . UrlEncode($pathto) . "&filename=index.php&new=Y" . (strlen($back_url) <= 0 ? "" : "&back_url=" . UrlEncode($back_url)) . (strlen($gotonewpage) <= 0 ? "" : "&gotonewpage=" . UrlEncode($gotonewpage)) . (strlen($backnewurl) <= 0 ? "" : "&backnewurl=" . UrlEncode($backnewurl)));
                                } else {
                                    $APPLICATION->SaveFileContent($DOC_ROOT . $pathto . "/index.php", CFileman::GetTemplateContent($template));
                                }
                            }
                        }
                        if ($e = $APPLICATION->GetException()) {
                            $strNotice = $e->msg;
                        } elseif (strlen($apply) <= 0 && $strNotice == '') {
                            if (strlen($back_url) > 0) {
                                LocalRedirect("/" . ltrim($back_url, "/"));
                            } else {
                                $arPathtoParsed = CFileMan::ParsePath(array($site, $pathto), false, false, "", $logical == "Y");
                                LocalRedirect("/bitrix/admin/fileman_admin.php?" . $addUrl . "&site=" . $site . "&path=" . UrlEncode($arPathtoParsed["PREV"]));
                            }
                        }
                    }
                }
            }
        } else {
            $mkindex = "Y";
            $toedit = "Y";
        }
    }
}
foreach ($arParsedPath["AR_PATH"] as $chainLevel) {
    $adminChain->AddItem(array("TEXT" => htmlspecialcharsex($chainLevel["TITLE"]), "LINK" => strlen($chainLevel["LINK"]) > 0 ? $chainLevel["LINK"] : ""));
}
예제 #6
0
require_once($_SERVER["DOCUMENT_ROOT"]."/freetrix/modules/fileman/prolog.php");
$FM_RIGHT = $APPLICATION->GetGroupRight("fileman");
if (!($USER->CanDoOperation('fileman_admin_files') || $USER->CanDoOperation('fileman_edit_existent_files')))
	$APPLICATION->AuthForm(GetMessage("ACCESS_DENIED"));

require_once($_SERVER["DOCUMENT_ROOT"]."/freetrix/modules/fileman/include.php");

require_once($_SERVER["DOCUMENT_ROOT"]."/freetrix/modules/main/include/prolog_popup_admin.php");

$io = CBXVirtualIo::GetInstance();

$site = CFileMan::__CheckSite($site);
$DOC_ROOT = CSite::GetSiteDocRoot($site);

$path = $io->CombinePath("/", $path);
$arParsedPath = CFileMan::ParsePath(Array($site, $path), true);
$abs_path = $DOC_ROOT.$path;
$arPath = Array($site, $path);
$bUploaded = false;
$file_name = "";
$strWarning = "";
if($REQUEST_METHOD=="POST" && strlen($saveimg)>0 && check_freetrix_sessid())
{
	if(!$USER->CanDoOperation('fileman_edit_existent_files') ||
	!$USER->CanDoFileOperation('fm_edit_existent_file',$arPath))
	{
		$strWarning = GetMessage('FILEMAN_CAN_NOT_WRITE')."<br>";
	}
	else
	{
		$file_name = CFileman::GetFileName($newfilename);