blob: 3d68e022eacbc486b6d4a7270badf28b23f307b9 [file] [log] [blame]
Copybara botbe50d492023-11-30 00:16:42 +01001<?php
2require_once("core.php");
3security::checkType(security::ADMIN);
4
5if (!security::checkParams("POST", [
6 ["id", security::PARAM_NEMPTY],
7 ["name", security::PARAM_NEMPTY],
8 ["emails", security::PARAM_ISSET],
9 ["parent", security::PARAM_ISSET]
10])) {
11 security::go("categories.php?msg=empty");
12}
13
14$id = (int)$_POST["id"];
15$name = $_POST["name"];
16$emails = $_POST["emails"];
17$parent = (int)$_POST["parent"];
18
19if (categories::edit($id, $name, $emails, $parent)) {
20 security::go("categories.php?msg=modified");
21} else {
22 security::go("categories.php?msg=unexpected");
23}