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 ''; + } + ?>