servnest/pg-act/ns/caa.php
2023-05-02 18:02:08 +02:00

25 lines
561 B
PHP

<?php
$values = nsParseCommonRequirements();
if (!($_POST['flag'] >= 0 AND $_POST['flag'] <= 255))
output(403, 'Wrong value for <code>flag</code>.');
if (!(preg_match('/^[a-z]{1,127}$/D', $_POST['tag'])))
output(403, 'Wrong value for <code>tag</code>.');
if (!(preg_match('/^[a-z0-9.-]{1,255}$/D', $_POST['value'])))
output(403, 'Wrong value for <code>value</code>.');
rateLimit();
knotcZoneExec($_POST['zone'], [
$values['domain'],
$values['ttl'],
'CAA',
$_POST['flag'],
$_POST['tag'],
$_POST['value']
]);
output(200, _('Modification done.'));