Added functionality for native zones
This commit is contained in:
parent
d14c64043c
commit
3a3855e939
|
@ -23,6 +23,8 @@ require_once '../lib/soa-mail.php';
|
||||||
|
|
||||||
$input = json_decode(file_get_contents('php://input'));
|
$input = json_decode(file_get_contents('php://input'));
|
||||||
|
|
||||||
|
error_log($input->type);
|
||||||
|
|
||||||
if(!isset($input->csrfToken) || $input->csrfToken !== $_SESSION['csrfToken']) {
|
if(!isset($input->csrfToken) || $input->csrfToken !== $_SESSION['csrfToken']) {
|
||||||
echo "Permission denied!";
|
echo "Permission denied!";
|
||||||
exit();
|
exit();
|
||||||
|
@ -47,8 +49,8 @@ if(isset($input->action) && $input->action == "addDomain") {
|
||||||
|
|
||||||
$db->autocommit(false);
|
$db->autocommit(false);
|
||||||
|
|
||||||
$stmt = $db->prepare("INSERT INTO domains(name,type) VALUES (?,'MASTER')");
|
$stmt = $db->prepare("INSERT INTO domains(name,type) VALUES (?,?)");
|
||||||
$stmt->bind_param("s", $input->name);
|
$stmt->bind_param("ss", $input->name, $input->type);
|
||||||
$stmt->execute();
|
$stmt->execute();
|
||||||
$stmt->close();
|
$stmt->close();
|
||||||
|
|
||||||
|
|
|
@ -85,7 +85,14 @@ limitations under the License.
|
||||||
|
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<?php if($_SESSION['type'] == "admin") echo '<a class="btn btn-success" href="add-domain.php">Add</a>'; ?>
|
<?php
|
||||||
|
if($_SESSION['type'] == "admin") {
|
||||||
|
echo '<div class="row">';
|
||||||
|
echo '<a class="btn btn-success" href="add-domain.php#MASTER">Add MASTER</a>';
|
||||||
|
echo '<a class="btn btn-primary margin-left-20" href="add-domain.php#NATIVE">Add NATIVE</a>';
|
||||||
|
echo '</div>';
|
||||||
|
}
|
||||||
|
?>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="modal fade" id="deleteConfirm" tabindex="-1" role="dialog">
|
<div class="modal fade" id="deleteConfirm" tabindex="-1" role="dialog">
|
||||||
|
|
|
@ -9,6 +9,8 @@
|
||||||
.vspacer-100 { height: 100px; }
|
.vspacer-100 { height: 100px; }
|
||||||
.vspacer-150 { height: 150px; }
|
.vspacer-150 { height: 150px; }
|
||||||
|
|
||||||
|
.margin-left-20 { margin-left: 20px; }
|
||||||
|
|
||||||
.defaulthidden { display: none; }
|
.defaulthidden { display: none; }
|
||||||
|
|
||||||
.cursor-pointer {cursor: pointer; }
|
.cursor-pointer {cursor: pointer; }
|
||||||
|
|
|
@ -64,6 +64,7 @@ function saveData(callback) {
|
||||||
retry: $('#zone-retry').val(),
|
retry: $('#zone-retry').val(),
|
||||||
expire: $('#zone-expire').val(),
|
expire: $('#zone-expire').val(),
|
||||||
ttl: $('#zone-ttl').val(),
|
ttl: $('#zone-ttl').val(),
|
||||||
|
type: window.location.hash.substring(1),
|
||||||
action: "addDomain",
|
action: "addDomain",
|
||||||
csrfToken: $('#csrfToken').text()
|
csrfToken: $('#csrfToken').text()
|
||||||
};
|
};
|
||||||
|
|
|
@ -101,6 +101,8 @@ function recreateTable(data) {
|
||||||
|
|
||||||
if(type == 'MASTER') {
|
if(type == 'MASTER') {
|
||||||
location.assign('edit-master.php#' + id);
|
location.assign('edit-master.php#' + id);
|
||||||
|
} else if(type == 'NATIVE') {
|
||||||
|
location.assign('edit-master.php#' + id);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue