outsource some dns functions to own files; allow opening of dns-editor only for domains that belong to the user (or the user has permission to edit as admin/reseller)

Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann (d00p)
2016-05-13 19:40:37 +02:00
parent 11eb08e031
commit 86dc57c2cc
6 changed files with 139 additions and 80 deletions

View File

@@ -29,15 +29,7 @@ $content = isset($_POST['record']['content']) ? trim($_POST['record']['content']
$ttl = isset($_POST['record']['ttl']) ? (int) $_POST['record']['ttl'] : 18000;
// get domain-name
$dom_stmt = Database::prepare("SELECT domain, isbinddomain FROM `" . TABLE_PANEL_DOMAINS . "` WHERE id = :did");
$domain = Database::pexecute_first($dom_stmt, array(
'did' => $domain_id
));
if ($domain['isbinddomain'] != '1') {
standard_error('dns_domain_nodns');
}
$domain = $idna_convert->decode($domain['domain']);
$domain = getAllowedDomainEntry($domain_id, AREA, $userinfo, $idna_convert);
// select all entries
$sel_stmt = Database::prepare("SELECT * FROM `" . TABLE_DOMAIN_DNS . "` WHERE domain_id = :did");