2022-12-20 20:17:03 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
$values = nsParseCommonRequirements();
|
|
|
|
|
|
|
|
if (!($_POST['priority'] >= 0 AND $_POST['priority'] <= 65535))
|
|
|
|
output(403, 'Wrong value for <code>priority</code>.');
|
|
|
|
|
|
|
|
if (!($_POST['weight'] >= 0 AND $_POST['weight'] <= 65535))
|
|
|
|
output(403, 'Wrong value for <code>weight</code>.');
|
|
|
|
|
|
|
|
if (!($_POST['port'] >= 0 AND $_POST['port'] <= 65535))
|
|
|
|
output(403, 'Wrong value for <code>port</code>.');
|
|
|
|
|
|
|
|
$_POST['target'] = formatAbsoluteDomain($_POST['target']);
|
|
|
|
|
2023-04-28 13:39:05 +00:00
|
|
|
rateLimit();
|
|
|
|
|
2022-12-20 20:17:03 +00:00
|
|
|
knotcZoneExec($_POST['zone'], [
|
|
|
|
$values['domain'],
|
|
|
|
$values['ttl'],
|
|
|
|
'SRV',
|
|
|
|
$_POST['priority'],
|
|
|
|
$_POST['weight'],
|
|
|
|
$_POST['port'],
|
|
|
|
$_POST['target']
|
|
|
|
]);
|
|
|
|
|
2023-01-21 00:27:52 +00:00
|
|
|
output(200, _('Modification done.'));
|