Project import generated by Copybara.
GitOrigin-RevId: 63746295f1a5ab5a619056791995793d65529e62
diff --git a/src/doeditcategory.php b/src/doeditcategory.php
new file mode 100644
index 0000000..3d68e02
--- /dev/null
+++ b/src/doeditcategory.php
@@ -0,0 +1,23 @@
+<?php
+require_once("core.php");
+security::checkType(security::ADMIN);
+
+if (!security::checkParams("POST", [
+ ["id", security::PARAM_NEMPTY],
+ ["name", security::PARAM_NEMPTY],
+ ["emails", security::PARAM_ISSET],
+ ["parent", security::PARAM_ISSET]
+])) {
+ security::go("categories.php?msg=empty");
+}
+
+$id = (int)$_POST["id"];
+$name = $_POST["name"];
+$emails = $_POST["emails"];
+$parent = (int)$_POST["parent"];
+
+if (categories::edit($id, $name, $emails, $parent)) {
+ security::go("categories.php?msg=modified");
+} else {
+ security::go("categories.php?msg=unexpected");
+}