blob: 2f706d36cc34b075a8178aeb3365756111a35e37 [file] [log] [blame]
<?php
require_once("core.php");
security::checkType(security::ADMIN);
if (!security::checkParams("POST", [
["name", security::PARAM_NEMPTY],
["emails", security::PARAM_ISSET],
["parent", security::PARAM_ISSET]
])) {
security::go("categories.php?msg=empty");
}
$name = $_POST["name"];
$emails = $_POST["emails"];
$parent = (int)$_POST["parent"];
if (categories::add($name, $emails, $parent)) {
security::go("categories.php?msg=added");
} else {
security::go("categories.php?msg=unexpected");
}