} } break; case "export_edit": $e = nas_get_export_by_id($_GET["id"]); if (nas_can_user_manage_export($e)) { export_edit_form('?page=nas&action=export_edit_save', $e); } $xtpl->sbar_add(_("Back"), '?page=nas'); break; case "export_edit_save": if ($_GET["id"] && $_POST["quota_val"] && $_POST["quota_unit"]) { $e = nas_get_export_by_id($_GET["id"]); // FIXME: control if quota is not less than used if (nas_can_user_manage_export($e)) { nas_export_update($_GET["id"], $_POST["quota_val"] * (2 << $NAS_UNITS_TR[$_POST["quota_unit"]]), $_SESSION["is_admin"] ? $_POST["user_editable"] : -1, $_SESSION["is_admin"] ? $_POST["type"] : NULL); } notify_user(_("Export Updated"), _("Export was successfully updated.")); } else { notify_user(_("Export NOT updated"), _("Export was not updated.")); } redirect('?page=nas'); break; case "export_del": if (isset($_GET["id"])) { $e = nas_get_export_by_id($_GET["id"]); $mounts = nas_get_mounts_for_export($_GET["id"]); $msg = _("All data from this export will be DELETED!") . "<br>"; $msg .= _("Current size:") . ' <strong>' . nas_size_to_humanreadable($e["export_used"]) . "</strong><br><br>"; $children = nas_get_export_children($_GET["id"]); if (count($children) > 0) {
$xtpl->perex(_("NAS settings saved"), ''); $list_nodes = true; break; case "nas_def_export_add": $xtpl->table_title(_("Add default export for new") . ' ' . ($_GET["for"] == "member" ? _("member") : _("VPS"))); export_add_form($export_add_target, true); $xtpl->sbar_add(_("Back"), '?page=cluster&action=nas_settings'); break; case "nas_def_export_edit": $e = nas_get_export_by_id($_GET["id"]); export_edit_form('?page=cluster&action=nas_def_export_save', $e); break; case "nas_def_export_save": if (isset($_POST["root_id"]) || isset($_POST["quota_val"])) { if ($_GET["id"]) { nas_export_update($_GET["id"], $_POST["quota_val"] * (2 << $NAS_UNITS_TR[$_POST["quota_unit"]]), $_POST["user_editable"], $_POST["type"]); } else { nas_export_add($_POST["member"], $_POST["root_id"], $_POST["dataset"], $_POST["path"], $_POST["quota_val"] * (2 << $NAS_UNITS_TR[$_POST["quota_unit"]]), $_POST["user_editable"], $_POST["type"], $_GET["for"]); } notify_user(_("Default export saved"), ''); redirect('?page=cluster&action=nas_settings'); } break; case "nas_def_export_del": if ($_GET["id"] && ($e = nas_get_export_by_id($_GET["id"]))) { $mounts = nas_get_mounts_for_export($_GET["id"]); $msg = ""; $children = nas_get_export_children($_GET["id"]); if (count($children) > 0) { $msg .= _("This export has following subdirectories and ALL OF THEM will be DELETED too:"); $msg .= "<br><ul>";