<?php
/*
This file belongs to the Webinterface of schokokeks.org Hosting
Written by schokokeks.org Hosting, namely
Bernd Wurst <bernd@schokokeks.org>
Hanno Böck <hanno@schokokeks.org>
This code is published under a 0BSD license.
Nevertheless, in case you use a significant part of this code, we ask (but not require, see the license) that you keep the authors' names in place and return your changes to the public. We would be especially happy if you tell us what you're going to do with this code.
*/
require_once('inc/debug.php');
function mailman_subdomains($domain)
{
if (!in_array('mailman', config('modules'))) {
return [];
}
$domain = (int) $domain;
$result = db_query("SELECT id, hostname FROM mail.mailman_domains WHERE domain=?", [$domain]);
$ret = [];
while ($line = $result->fetch()) {
$ret[] = $line;
}
return $ret;
}
function dns_in_use($domain)
{
if (!in_array('dns', config('modules'))) {
return false;
}
$domain = (int) $domain;
$result = db_query("SELECT id FROM dns.custom_records WHERE domain=?", [$domain]);
return ($result->rowCount() > 0);
}
function mail_setting($domain)
{
if (!in_array('email', config('modules'))) {
return null;
}
$domain = (int) $domain;
$result = db_query("SELECT mail FROM kundendaten.domains WHERE id=?", [$domain]);
if ($result->rowCount() < 1) {
system_failure("Domain not found");
}
$d = $result->fetch();