From 3a3855e939114c3f60997bbd31e72172701821e2 Mon Sep 17 00:00:00 2001 From: Lukas Metzger Date: Tue, 3 May 2016 17:42:34 +0200 Subject: [PATCH] Added functionality for native zones --- api/add-domain.php | 6 ++++-- domains.php | 9 ++++++++- include/custom.css | 2 ++ js/add-domain.js | 1 + js/domains.js | 2 ++ 5 files changed, 17 insertions(+), 3 deletions(-) diff --git a/api/add-domain.php b/api/add-domain.php index 3b71f20..4446e1e 100644 --- a/api/add-domain.php +++ b/api/add-domain.php @@ -23,6 +23,8 @@ require_once '../lib/soa-mail.php'; $input = json_decode(file_get_contents('php://input')); +error_log($input->type); + if(!isset($input->csrfToken) || $input->csrfToken !== $_SESSION['csrfToken']) { echo "Permission denied!"; exit(); @@ -47,8 +49,8 @@ if(isset($input->action) && $input->action == "addDomain") { $db->autocommit(false); - $stmt = $db->prepare("INSERT INTO domains(name,type) VALUES (?,'MASTER')"); - $stmt->bind_param("s", $input->name); + $stmt = $db->prepare("INSERT INTO domains(name,type) VALUES (?,?)"); + $stmt->bind_param("ss", $input->name, $input->type); $stmt->execute(); $stmt->close(); diff --git a/domains.php b/domains.php index cf6fcfd..3013f77 100644 --- a/domains.php +++ b/domains.php @@ -85,7 +85,14 @@ limitations under the License. - Add'; ?> + '; + echo 'Add MASTER'; + echo 'Add NATIVE'; + echo ''; + } + ?>