87c687d2f83f37e43379c3725774f03b0022015b
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 Copyright year update

Bernd Wurst authored 6 years ago

5) Written 2008-2018 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/debug.php');
18) 
bernd Mailman-Domains nur auslese...

bernd authored 14 years ago

19) 
bernd Bessere Darstellung des Dom...

bernd authored 14 years ago

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

bernd authored 14 years ago

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

bernd authored 14 years ago

26)   $domain = (int) $domain;
Bernd Wurst Einige Statements auf Prepa...

Bernd Wurst authored 10 years ago

27)   $result = db_query("SELECT id, hostname FROM mail.mailman_domains WHERE domain=?", array($domain));
bernd Bessere Darstellung des Dom...

bernd authored 14 years ago

28)   $ret = array();
Bernd Wurst Umstellung auf PDO-Datenban...

Bernd Wurst authored 10 years ago

29)   while ($line = $result->fetch())
bernd Bessere Darstellung des Dom...

bernd authored 14 years ago

30)   {
31)     $ret[] = $line;
32)   }
33)   return $ret;
34) }
35) 
bernd Wirkliche nutzung der Domai...

bernd authored 14 years ago

36) function dns_in_use($domain)
37) {
38)   if ( ! in_array('dns', config('modules')))
39)     return false;
40)   $domain = (int) $domain;
Bernd Wurst Einige Statements auf Prepa...

Bernd Wurst authored 10 years ago

41)   $result = db_query("SELECT id FROM dns.custom_records WHERE domain=?", array($domain));
Bernd Wurst Umstellung auf PDO-Datenban...

Bernd Wurst authored 10 years ago

42)   return ($result->rowCount() > 0);
bernd Wirkliche nutzung der Domai...

bernd authored 14 years ago

43) }
44) 
45) 
46) function mail_in_use($domain)
47) {
48)   if ( ! in_array('email', config('modules')))
49)   {
50)     return false;
51)   }
52)   $domain = (int) $domain;
Bernd Wurst Einige Statements auf Prepa...

Bernd Wurst authored 10 years ago

53)   $result = db_query("SELECT mail FROM kundendaten.domains WHERE id=?", array($domain));
Bernd Wurst Umstellung auf PDO-Datenban...

Bernd Wurst authored 10 years ago

54)   if ($result->rowCount() < 1)
bernd Wirkliche nutzung der Domai...

bernd authored 14 years ago

55)     system_failure("Domain not found");
Bernd Wurst Umstellung auf PDO-Datenban...

Bernd Wurst authored 10 years ago

56)   $d = $result->fetch();
bernd Wirkliche nutzung der Domai...

bernd authored 14 years ago

57)   if ($d['mail'] == 'none')
58)     return false; // manually disabled
Bernd Wurst Einige Statements auf Prepa...

Bernd Wurst authored 10 years ago

59)   $result = db_query("SELECT id FROM mail.virtual_mail_domains WHERE domain=?", array($domain));
Bernd Wurst Umstellung auf PDO-Datenban...

Bernd Wurst authored 10 years ago

60)   if ($result->rowCount() < 1)
bernd Wirkliche nutzung der Domai...

bernd authored 14 years ago

61)     return true; // .courier
Bernd Wurst Einige Statements auf Prepa...

Bernd Wurst authored 10 years ago

62)   $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=?", array($domain));
Bernd Wurst Umstellung auf PDO-Datenban...

Bernd Wurst authored 10 years ago

63)   return ($result->rowCount() > 0);
bernd Wirkliche nutzung der Domai...

bernd authored 14 years ago

64) }
65) 
66) function web_in_use($domain)
67) {
68)   if ( ! in_array('vhosts', config('modules')))
69)     return false;
70) 
71)   $domain = (int) $domain;
72) 
Bernd Wurst Einige Statements auf Prepa...

Bernd Wurst authored 10 years ago

73)   $result = db_query("SELECT id FROM kundendaten.domains WHERE id=? AND webserver=1", array($domain));
Bernd Wurst Umstellung auf PDO-Datenban...

Bernd Wurst authored 10 years ago

74)   if ($result->rowCount() < 1)
bernd Wirkliche nutzung der Domai...

bernd authored 14 years ago

75)     return false;
76) 
Bernd Wurst Einige Statements auf Prepa...

Bernd Wurst authored 10 years ago

77)   $result = db_query("SELECT id FROM vhosts.vhost WHERE domain=?", array($domain));
78)   $result2 = db_query("SELECT id FROM vhosts.alias WHERE domain=?", array($domain));
Bernd Wurst Umstellung auf PDO-Datenban...

Bernd Wurst authored 10 years ago

79)   return ($result->rowCount() > 0 || $result2->rowCount() > 0);
bernd Wirkliche nutzung der Domai...

bernd authored 14 years ago

80) }
bernd Bessere Darstellung des Dom...

bernd authored 14 years ago

81) 
Bernd Wurst Domain-Update (Ownerchange)...

Bernd Wurst authored 6 years ago

82) function domain_ownerchange($fqdn, $owner, $admin_c) 
83) {
Bernd Wurst Abhängigkeit von contacts-M...

Bernd Wurst authored 6 years ago

84)     require_once('domainapi.php');
Bernd Wurst Domain-Update (Ownerchange)...

Bernd Wurst authored 6 years ago

85)     $cid = (int) $_SESSION['customerinfo']['customerno'];
86)     db_query("UPDATE kundendaten.domains SET owner=?, admin_c=? WHERE CONCAT_WS('.', domainname, tld)=? AND kunde=?", array($owner, $admin_c, $fqdn, $cid));
87)     api_upload_domain($fqdn);
88) }
89) 
bernd Bessere Darstellung des Dom...

bernd authored 14 years ago

90)