diff --git a/dns_editor.php b/dns_editor.php index 53dbf234..56a86b4e 100644 --- a/dns_editor.php +++ b/dns_editor.php @@ -46,7 +46,7 @@ $record = isset($_POST['dns_record']) ? trim($_POST['dns_record']) : null; $type = isset($_POST['dns_type']) ? $_POST['dns_type'] : 'A'; $prio = isset($_POST['dns_mxp']) ? (int)$_POST['dns_mxp'] : null; $content = isset($_POST['dns_content']) ? trim($_POST['dns_content']) : null; -$ttl = isset($_POST['record']['ttl']) ? (int)$_POST['record']['ttl'] : 18000; +$ttl = isset($_POST['dns_ttl']) ? (int)$_POST['dns_ttl'] : 18000; // get domain-name $domain = Dns::getAllowedDomainEntry($domain_id, AREA, $userinfo); diff --git a/lib/Froxlor/Ajax/Ajax.php b/lib/Froxlor/Ajax/Ajax.php index 1f6d1290..d5aa8835 100644 --- a/lib/Froxlor/Ajax/Ajax.php +++ b/lib/Froxlor/Ajax/Ajax.php @@ -268,8 +268,7 @@ class Ajax $_check_list = $ip_list; foreach ($_check_list as $idx => $ip) { if (Validate::validate_ip2($ip, true, 'invalidip', true, true, true) == false) { - unset($ip_list[$idx]); - continue; + return $this->errorResponse('Invalid ip address', 406); } // check for cidr if (strpos($ip, '/') !== false) { diff --git a/templates/Froxlor/src/js/components/apikeys.js b/templates/Froxlor/src/js/components/apikeys.js index 41db9028..109e95fa 100644 --- a/templates/Froxlor/src/js/components/apikeys.js +++ b/templates/Froxlor/src/js/components/apikeys.js @@ -5,12 +5,12 @@ $(function () { var _this = $(this); clearTimeout(timer); timer = setTimeout(function () { - var akid = $('div[data-action="apikeys"]').data('entry'); + var akid = _this.closest('div[data-action="apikeys"]').data('entry'); $.ajax({ url: "lib/ajax.php?action=editapikey", type: "POST", dataType: "json", - data: { id: akid, allowed_from: _this.val(), valid_until: $('div[data-action="apikeys"] #valid_until').val() }, + data: { id: akid, allowed_from: _this.val(), valid_until: $('div[data-entry="' + akid + '"] #valid_until').val() }, success: function (data) { if (data.message) { _this.removeClass('is-valid'); @@ -22,7 +22,8 @@ $(function () { } }, error: function (request, status, error) { - console.log(request, status, error) + _this.removeClass('is-valid'); + _this.addClass('is-invalid'); } }); }, delay); @@ -32,12 +33,12 @@ $(function () { var _this = $(this); clearTimeout(timer); timer = setTimeout(function () { - var akid = $('div[data-action="apikeys"]').data('entry'); + var akid = _this.closest('div[data-action="apikeys"]').data('entry'); $.ajax({ url: "lib/ajax.php?action=editapikey", type: "POST", dataType: "json", - data: { id: akid, valid_until: _this.val(), allowed_from: $('div[data-action="apikeys"] #allowed_from').val() }, + data: { id: akid, valid_until: _this.val(), allowed_from: $('div[data-entry="' + akid + '"] #allowed_from').val() }, success: function (data) { if (data.message) { _this.removeClass('is-valid'); @@ -49,9 +50,11 @@ $(function () { } }, error: function (request, status, error) { - console.log(request, status, error) + _this.removeClass('is-valid'); + _this.addClass('is-invalid'); } }); }, delay); }); + });