f12aba6daa6e2848a8ed60ea57b26874d6675f52
bernd Bessere Darstellung des Dom...

bernd authored 14 years ago

1) <?php
Bernd Wurst Added license tags for CC0,...

Bernd Wurst authored 12 years ago

2) /*
3) This file belongs to the Webinterface of schokokeks.org Hosting
4) 
Bernd Wurst Updated copyright notice (2...

Bernd Wurst authored 11 years ago

5) Written 2008-2013 by schokokeks.org Hosting, namely
Bernd Wurst Added license tags for CC0,...

Bernd Wurst authored 12 years ago

6)   Bernd Wurst <bernd@schokokeks.org>
7)   Hanno Böck <hanno@schokokeks.org>
8) 
9) To the extent possible under law, the author(s) have dedicated all copyright and related and neighboring rights to this software to the public domain worldwide. This software is distributed without any warranty.
10) 
11) You should have received a copy of the CC0 Public Domain Dedication along with this software. If not, see 
12) http://creativecommons.org/publicdomain/zero/1.0/
13) 
14) 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.
15) */
bernd Bessere Darstellung des Dom...

bernd authored 14 years ago

16) 
17) require_once('inc/base.php');
18) require_once('inc/debug.php');
19) 
bernd Mailman-Domains nur auslese...

bernd authored 14 years ago

20) 
bernd Bessere Darstellung des Dom...

bernd authored 14 years ago

21) function mailman_subdomains($domain)
22) {
bernd Mailman-Domains nur auslese...

bernd authored 14 years ago

23)   if ( ! in_array('mailman', config('modules')))
24)   {
25)     return array();
26)   }
bernd Bessere Darstellung des Dom...

bernd authored 14 years ago

27)   $domain = (int) $domain;
28)   $result = db_query("SELECT id, hostname FROM mail.mailman_domains WHERE domain={$domain}");
29)   $ret = array();
30)   while ($line = mysql_fetch_assoc($result))
31)   {
32)     $ret[] = $line;
33)   }
34)   return $ret;
35) }
36) 
bernd Wirkliche nutzung der Domai...

bernd authored 14 years ago

37) function dns_in_use($domain)
38) {
39)   if ( ! in_array('dns', config('modules')))
40)     return false;
41)   $domain = (int) $domain;
42)   $result = db_query("SELECT id FROM dns.custom_records WHERE domain={$domain}");
43)   return (mysql_num_rows($result) > 0);
44) }
45) 
46) 
47) function mail_in_use($domain)
48) {
49)   if ( ! in_array('email', config('modules')))
50)   {
51)     return false;
52)   }
53)   $domain = (int) $domain;
54)   $result = db_query("SELECT mail FROM kundendaten.domains WHERE id={$domain}");
55)   if (mysql_num_rows($result) < 1)
56)     system_failure("Domain not found");
57)   $d = mysql_fetch_assoc($result);
58)   if ($d['mail'] == 'none')
59)     return false; // manually disabled
60)   $result = db_query("SELECT id FROM mail.virtual_mail_domains WHERE domain={$domain}");
61)   if (mysql_num_rows($result) < 1)
62)     return true; // .courier
63)   $result = db_query("SELECT acc.id FROM mail.vmail_accounts acc LEFT JOIN mail.virtual_mail_domains dom ON (acc.domain=dom.id) WHERE dom.domain={$domain}");
64)   return (mysql_num_rows($result) > 0);
65) }
66) 
67) function web_in_use($domain)
68) {
69)   if ( ! in_array('vhosts', config('modules')))
70)     return false;
71) 
72)   $domain = (int) $domain;
73) 
74)   $result = db_query("SELECT id FROM kundendaten.domains WHERE id={$domain} AND webserver=1");
75)   if (mysql_num_rows($result) < 1)
76)     return false;
77) 
78)   $result = db_query("SELECT id FROM vhosts.vhost WHERE domain={$domain}");
79)   $result2 = db_query("SELECT id FROM vhosts.alias WHERE domain={$domain}");
80)   return (mysql_num_rows($result) > 0 || mysql_num_rows($result2) > 0);
81) }