Use CONF['ns']['servers'] to generate zone file

This commit is contained in:
Miraty 2022-08-30 00:48:41 +02:00
parent 1a8691f7e3
commit 6a547808e6
1 changed files with 3 additions and 3 deletions

View File

@ -24,9 +24,9 @@ $stmt->bindValue(':username', $_SESSION['username']);
$stmt->execute();
$knotZonePath = CONF['ns']['knot_zones_path'] . "/" . $_POST['domain'] . "zone";
$knotZone = $_POST['domain'] . ' 3600 SOA ns1.niver.test. admin.niver.test. 1 21600 7200 3628800 3600
' . $_POST['domain'] . ' 86400 NS ns1.niver.test.
';
$knotZone = $_POST['domain'] . ' 3600 SOA ' . CONF['ns']['servers'][0] . ' admin.niver.test. 1 21600 7200 3628800 3600' . "\n";
foreach (CONF['ns']['servers'] as $server)
$knotZone .= $_POST['domain'] . ' 86400 NS ' . $server . "\n";
if (is_int(file_put_contents($knotZonePath, $knotZone)) !== true)
serverError("Failed to write new zone file.");
if (chmod($knotZonePath, 0660) !== true)