srv.php 686 B

12345678910111213141516171819202122232425262728
  1. <?php declare(strict_types=1);
  2. $values = nsParseCommonRequirements();
  3. if (!($_POST['priority'] >= 0 AND $_POST['priority'] <= 65535))
  4. output(403, 'Wrong value for <code>priority</code>.');
  5. if (!($_POST['weight'] >= 0 AND $_POST['weight'] <= 65535))
  6. output(403, 'Wrong value for <code>weight</code>.');
  7. if (!($_POST['port'] >= 0 AND $_POST['port'] <= 65535))
  8. output(403, 'Wrong value for <code>port</code>.');
  9. $_POST['target'] = formatAbsoluteDomain($_POST['target']);
  10. rateLimit();
  11. knotcZoneExec($_POST['zone'], [
  12. $values['domain'],
  13. $values['ttl'],
  14. 'SRV',
  15. $_POST['priority'],
  16. $_POST['weight'],
  17. $_POST['port'],
  18. $_POST['target']
  19. ]);
  20. output(200, _('Modification done.'));