Create option to not allow a normal user to add zones

This commit is contained in:
Mark Schouten 2014-10-01 09:46:44 +02:00
parent 4881858d68
commit 00c40c047e
3 changed files with 15 additions and 6 deletions

View file

@ -227,6 +227,9 @@ if ($action == "list" or $action== "listslaves") {
usort($return, "zonesort");
jtable_respond($return);
} elseif ($action == "create") {
if (is_adminuser() !== TRUE or ($allowzoneadd !== TRUE)) {
jtable_respond(null, 'error', "You are not allowed to add zones");
}
if (_valid_label($_POST['name']) === FALSE) {
jtable_respond(null, 'error', "Please only use [a-z0-9_/.-]");
}