} } } else { if ($USER->CanDoFileOperation('fm_view_listing', $arPath)) { $arActions[] = array("ICON" => "", "TEXT" => GetMessage('FILEMAN_N_OPEN'), "DEFAULT" => true, "ACTION" => "javascript:" . $sTableID . ".GetAdminList('fileman_admin.php?" . $addUrl . "&site=" . urlencode($site) . "&path=" . $fpathUrl . "&show_perms_for=" . IntVal($show_perms_for) . "', GALCallBack);"); } if ($USER->CanDoFileOperation('fm_edit_existent_folder', $arPath)) { $arActions[] = array("ICON" => "btn_fileman_prop", "TEXT" => GetMessage("FILEMAN_ADMIN_FOLDER_PROP"), "ACTION" => $lAdmin->ActionRedirect("fileman_folder.php?" . $addUrl . "&site=" . urlencode($site) . "&path=" . $fpathUrl . "")); } } $type = $Elem["TYPE"] == "F" ? 'file' : 'folder'; if ($logical != "Y") { if ($Elem["TYPE"] == "F" && $USER->CanDoFileOperation('fm_view_file', $arPath) && ($USER->CanDoOperation('edit_php') || $USER->CanDoFileOperation('fm_lpa', $arPath) || !(HasScriptExtension($f_NAME) || substr($Elem["NAME"], 0, 1) == ".")) || $Elem["TYPE"] == "D" && $USER->CanDoFileOperation('fm_view_listing', $arPath)) { $arActions[] = array("SEPARATOR" => true); $arActions[] = array("ICON" => "pack", "TEXT" => GetMessage("FILEMAN_ADMIN_ARC_PACK"), "ACTION" => "window.PackUnpackRun([{'path' : '" . CUtil::JSEscape($fpath) . "', 'isDir' : '" . $arrIsDir[$fpath] . "'}], true); return false;"); $is_archive = CBXArchive::IsArchive($fpath); if ($is_archive) { $arActions[] = array("ICON" => "unpack", "TEXT" => GetMessage("FILEMAN_ADMIN_ARC_UNPACK"), "ACTION" => "window.PackUnpackRun(['" . CUtil::JSEscape($fpath) . "'], false); return false;"); } } if ($USER->CanDoFileOperation('fm_rename_' . $type, $arPath)) { $arActions[] = array("SEPARATOR" => true); $arActions[] = array("ICON" => "rename", "TEXT" => GetMessage("FILEMAN_RENAME_SAVE"), "ACTION" => 'setCheckbox(\'' . addslashes($f_NAME) . '\'); if(' . $lAdmin->table_id . '.IsActionEnabled(\'edit\')){document.forms[\'form_' . $lAdmin->table_id . '\'].elements[\'action_button\'].value=\'edit\'; ' . $lAdmin->ActionPost() . '}else{document.location.href=\'fileman_rename.php?' . $addUrl . '&path=' . urlencode($path) . '&site=' . $site . '&files[]=' . CFileman::GetFileName($arPath[1]) . '\'}'); } // Copy if ($USER->CanDoFileOperation('fm_view_file', $arPath) && ($USER->CanDoOperation('edit_php') || $USER->CanDoFileOperation('fm_lpa', $arPath) || !(HasScriptExtension($f_NAME) || substr($Elem["NAME"], 0, 1) == ".")) && $Elem["TYPE"] == "F" || $Elem["TYPE"] == "D" && $USER->CanDoFileOperation('fm_view_listing', $arPath)) { $arActions[] = array("ICON" => "copy", "TEXT" => GetMessage("FILEMAN_ADM_COPY"), "ACTION" => "window.CopyMoveRun([{'path' : '" . CUtil::JSEscape($fpath) . "', 'isDir' : '" . $arrIsDir[$fpath] . "'}], true); return false;"); } // Move if ($USER->CanDoOperation('fileman_admin_folders') && $USER->CanDoFileOperation('fm_delete_' . $type, $arPath)) { if ($USER->CanDoFileOperation('fm_view_file', $arPath) && ($USER->CanDoOperation('edit_php') || $USER->CanDoFileOperation('fm_lpa', $arPath) || !(HasScriptExtension($f_NAME) || substr($Elem["NAME"], 0, 1) == ".")) && $Elem["TYPE"] == "F" || $Elem["TYPE"] == "D" && $USER->CanDoFileOperation('fm_view_listing', $arPath)) {
} set_time_limit(0); $STEP = intval($STEP); $strError = ""; if ($STEP <= 0) { $STEP = 1; } if ($_SERVER["REQUEST_METHOD"] == "POST" && strlen($backButton) > 0) { $STEP = 1; } if ($_SERVER["REQUEST_METHOD"] == "POST" && $STEP == 2 && check_bitrix_sessid()) { if (!is_array($SITE_ID) || empty($SITE_ID)) { $strError .= GetMessage("LEARNING_BAD_SITE_ID") . "<br>"; } if (strlen($URL_DATA_FILE) > 0) { if (!CBXArchive::IsArchive($_SERVER["DOCUMENT_ROOT"] . $URL_DATA_FILE)) { $strError .= GetMessage("LEARNING_NOT_TAR_GZ") . "<br>"; } } else { $strError .= GetMessage("LEARNING_DATA_FILE_NOT_FOUND"); } if (strlen($strError) <= 0) { $oArchiver = CBXArchive::GetArchive($_SERVER["DOCUMENT_ROOT"] . $URL_DATA_FILE); if ($oArchiver === false) { $strError .= GetMessage("LEARNING_NOT_TAR_GZ") . "<br>"; } } if (strlen($strError) <= 0 && $oArchiver !== false) { $tmp_dir = BX_PERSONAL_ROOT . "/tmp/learning/" . uniqid(rand()); CheckDirPath($_SERVER["DOCUMENT_ROOT"] . $tmp_dir); if ($oArchiver->Unpack($_SERVER["DOCUMENT_ROOT"] . $tmp_dir)) {