mirror of
https://github.com/tuxis-ie/nsedit.git
synced 2025-04-27 21:09:43 +03:00
Remove leftover from copy/paste. Do not replace and check if ['serial'] exists..
This commit is contained in:
parent
3f3c18c21b
commit
82819bf33b
2 changed files with 3 additions and 12 deletions
|
@ -62,7 +62,7 @@ class PdnsAPI {
|
||||||
unset($zonedata['url']);
|
unset($zonedata['url']);
|
||||||
unset($zonedata['rrsets']);
|
unset($zonedata['rrsets']);
|
||||||
|
|
||||||
if (gettype($zone['serial']) != 'integer') {
|
if (!isset($zone['serial']) or gettype($zone['serial']) != 'integer') {
|
||||||
$api->method = 'POST';
|
$api->method = 'POST';
|
||||||
$api->url = '/servers/localhost/zones';
|
$api->url = '/servers/localhost/zones';
|
||||||
$api->content = json_encode($zonedata);
|
$api->content = json_encode($zonedata);
|
||||||
|
|
13
zones.php
13
zones.php
|
@ -233,7 +233,8 @@ case "create":
|
||||||
jtable_respond(null, 'error', 'Zone already owned by someone else');
|
jtable_respond(null, 'error', 'Zone already owned by someone else');
|
||||||
}
|
}
|
||||||
|
|
||||||
$zone = $api->savezone($zone->export());
|
$api->savezone($zone->export());
|
||||||
|
|
||||||
$zonename = $zone->name;
|
$zonename = $zone->name;
|
||||||
|
|
||||||
if (is_adminuser() && isset($_POST['owner'])) {
|
if (is_adminuser() && isset($_POST['owner'])) {
|
||||||
|
@ -242,16 +243,6 @@ case "create":
|
||||||
add_db_zone($zonename, get_sess_user());
|
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') {
|
if (isset($_POST['template']) && $_POST['template'] != 'None') {
|
||||||
foreach (user_template_list() as $template) {
|
foreach (user_template_list() as $template) {
|
||||||
if ($template['name'] !== $_POST['template']) continue;
|
if ($template['name'] !== $_POST['template']) continue;
|
||||||
|
|
Loading…
Add table
Reference in a new issue