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 '';
+ }
+ ?>
diff --git a/include/custom.css b/include/custom.css
index da49fc9..9b27f22 100644
--- a/include/custom.css
+++ b/include/custom.css
@@ -9,6 +9,8 @@
.vspacer-100 { height: 100px; }
.vspacer-150 { height: 150px; }
+.margin-left-20 { margin-left: 20px; }
+
.defaulthidden { display: none; }
.cursor-pointer {cursor: pointer; }
diff --git a/js/add-domain.js b/js/add-domain.js
index ef5a0a4..d6d767e 100644
--- a/js/add-domain.js
+++ b/js/add-domain.js
@@ -64,6 +64,7 @@ function saveData(callback) {
retry: $('#zone-retry').val(),
expire: $('#zone-expire').val(),
ttl: $('#zone-ttl').val(),
+ type: window.location.hash.substring(1),
action: "addDomain",
csrfToken: $('#csrfToken').text()
};
diff --git a/js/domains.js b/js/domains.js
index 697b32d..b487f2e 100644
--- a/js/domains.js
+++ b/js/domains.js
@@ -101,6 +101,8 @@ function recreateTable(data) {
if(type == 'MASTER') {
location.assign('edit-master.php#' + id);
+ } else if(type == 'NATIVE') {
+ location.assign('edit-master.php#' + id);
}
});