Remove leftover from copy/paste. Do not replace and check if ['serial'] exists..

This commit is contained in:
Mark Schouten 2016-08-04 13:44:39 +02:00
parent 3f3c18c21b
commit 82819bf33b
2 changed files with 3 additions and 12 deletions

View file

@ -62,7 +62,7 @@ class PdnsAPI {
unset($zonedata['url']);
unset($zonedata['rrsets']);
if (gettype($zone['serial']) != 'integer') {
if (!isset($zone['serial']) or gettype($zone['serial']) != 'integer') {
$api->method = 'POST';
$api->url = '/servers/localhost/zones';
$api->content = json_encode($zonedata);

View file

@ -233,7 +233,8 @@ case "create":
jtable_respond(null, 'error', 'Zone already owned by someone else');
}
$zone = $api->savezone($zone->export());
$api->savezone($zone->export());
$zonename = $zone->name;
if (is_adminuser() && isset($_POST['owner'])) {
@ -242,16 +243,6 @@ case "create":
add_db_zone($zonename, get_sess_user());
}
$rrset = $zone->getrrset($old_record['name'], $old_record['type']);
$rrset->deleteRecord($old_record['content']);
$zone->addrecord($_POST['name'], $_POST['type'], $_POST['content'], $_POST['disabled'], $_POST['ttl']);
$api->savezone($zone->export());
$record['id'] = json_encode($record);
jtable_respond($zone->getrecord($_POST['name'], $_POST['type'], $_POST['content']), 'single');
break;
if (isset($_POST['template']) && $_POST['template'] != 'None') {
foreach (user_template_list() as $template) {
if ($template['name'] !== $_POST['template']) continue;