828df758a7b28057a552c24fe6034a44ea344ae2
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) 
Hanno Böck Change license from CC0 to...

Hanno Böck authored 2 years ago

5) Written 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) 
Hanno Böck Change license from CC0 to...

Hanno Böck authored 2 years ago

9) This code is published under a 0BSD license.
Bernd Wurst Added license tags for CC0,...

Bernd Wurst authored 12 years ago

10) 
11) 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.
12) */
bernd Bessere Darstellung des Dom...

bernd authored 14 years ago

13) 
14) require_once('inc/debug.php');
15) 
bernd Mailman-Domains nur auslese...

bernd authored 14 years ago

16) 
bernd Bessere Darstellung des Dom...

bernd authored 14 years ago

17) function mailman_subdomains($domain)
18) {
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

19)     if (! in_array('mailman', config('modules'))) {
Hanno Böck Codingstyle PSR12 + array s...

Hanno Böck authored 3 years ago

20)         return [];
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

21)     }
22)     $domain = (int) $domain;
Hanno Böck Codingstyle PSR12 + array s...

Hanno Böck authored 3 years ago

23)     $result = db_query("SELECT id, hostname FROM mail.mailman_domains WHERE domain=?", [$domain]);
24)     $ret = [];
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

25)     while ($line = $result->fetch()) {
26)         $ret[] = $line;
27)     }
28)     return $ret;
bernd Bessere Darstellung des Dom...

bernd authored 14 years ago

29) }
30) 
bernd Wirkliche nutzung der Domai...

bernd authored 14 years ago

31) function dns_in_use($domain)
32) {
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

33)     if (! in_array('dns', config('modules'))) {
34)         return false;
35)     }
36)     $domain = (int) $domain;
Hanno Böck Codingstyle PSR12 + array s...

Hanno Böck authored 3 years ago

37)     $result = db_query("SELECT id FROM dns.custom_records WHERE domain=?", [$domain]);
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

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

bernd authored 14 years ago

39) }
40) 
Bernd Wurst email setting per domain test

Bernd Wurst authored 1 year ago

41) function mail_setting($domain)
42) {
43)     if (! in_array('email', config('modules'))) {
44)         return null;
45)     }
46)     $domain = (int) $domain;
47)     $result = db_query("SELECT mail FROM kundendaten.domains WHERE id=?", [$domain]);
48)     if ($result->rowCount() < 1) {
49)         system_failure("Domain not found");
50)     }
51)     $d = $result->fetch();
52)     if ($d['mail'] == 'none') {
53)         return 'none';
54)     } // manually disabled
55)     $result = db_query("SELECT id FROM mail.virtual_mail_domains WHERE domain=?", [$domain]);
56)     if ($result->rowCount() > 0) {
57)         return 'vmail';
58)     }
59)     return 'manual';
60) }
61) 
bernd Wirkliche nutzung der Domai...

bernd authored 14 years ago

62) 
63) function mail_in_use($domain)
64) {
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

65)     if (! in_array('email', config('modules'))) {
66)         return false;
67)     }
68)     $domain = (int) $domain;
Hanno Böck Codingstyle PSR12 + array s...

Hanno Böck authored 3 years ago

69)     $result = db_query("SELECT mail FROM kundendaten.domains WHERE id=?", [$domain]);
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

70)     if ($result->rowCount() < 1) {
71)         system_failure("Domain not found");
72)     }
73)     $d = $result->fetch();
74)     if ($d['mail'] == 'none') {
75)         return false;
76)     } // manually disabled
Hanno Böck Codingstyle PSR12 + array s...

Hanno Böck authored 3 years ago

77)     $result = db_query("SELECT id FROM mail.virtual_mail_domains WHERE domain=?", [$domain]);
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

78)     if ($result->rowCount() < 1) {
79)         return true;
80)     } // .courier
Hanno Böck Codingstyle PSR12 + array s...

Hanno Böck authored 3 years ago

81)     $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]);
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

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

bernd authored 14 years ago

83) }
84) 
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

85) function count_vmail($domain)
86) {
Bernd Wurst Zeige Mail-Deeplink korrekt...

Bernd Wurst authored 6 years ago

87)     $domain = (int) $domain;
Hanno Böck Codingstyle PSR12 + array s...

Hanno Böck authored 3 years ago

88)     $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]);
Bernd Wurst Zeige Mail-Deeplink korrekt...

Bernd Wurst authored 6 years ago

89)     return $result->rowCount();
90) }
91) 
bernd Wirkliche nutzung der Domai...

bernd authored 14 years ago

92) function web_in_use($domain)
93) {
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

94)     if (! in_array('vhosts', config('modules'))) {
95)         return false;
96)     }
bernd Wirkliche nutzung der Domai...

bernd authored 14 years ago

97) 
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

98)     $domain = (int) $domain;
bernd Wirkliche nutzung der Domai...

bernd authored 14 years ago

99) 
Hanno Böck Codingstyle PSR12 + array s...

Hanno Böck authored 3 years ago

100)     $result = db_query("SELECT id FROM kundendaten.domains WHERE id=? AND webserver=1", [$domain]);
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

101)     if ($result->rowCount() < 1) {
102)         return false;
103)     }
bernd Wirkliche nutzung der Domai...

bernd authored 14 years ago

104) 
Hanno Böck Codingstyle PSR12 + array s...

Hanno Böck authored 3 years ago

105)     $result = db_query("SELECT id FROM vhosts.vhost WHERE domain=?", [$domain]);
106)     $result2 = db_query("SELECT id FROM vhosts.alias WHERE domain=?", [$domain]);
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

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

bernd authored 14 years ago

108) }
bernd Bessere Darstellung des Dom...

bernd authored 14 years ago

109) 
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

110) function domain_ownerchange($fqdn, $owner, $admin_c)
Bernd Wurst Domain-Update (Ownerchange)...

Bernd Wurst authored 6 years ago

111) {
112)     $cid = (int) $_SESSION['customerinfo']['customerno'];
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

113)     $dom = new Domain($fqdn);
Hanno Böck Codingstyle PSR12 + array s...

Hanno Böck authored 3 years ago

114)     db_query("UPDATE kundendaten.domains SET owner=?, admin_c=? WHERE id=? AND kunde=?", [$owner, $admin_c, $dom->id, $cid]);
Bernd Wurst Zuverlässigeres Logging bei...

Bernd Wurst authored 6 years ago

115)     if (update_possible($dom->id)) {
Bernd Wurst Domain-Transfer und -Regist...

Bernd Wurst authored 6 years ago

116)         require_once('domainapi.php');
Bernd Wurst Zuverlässigeres Logging bei...

Bernd Wurst authored 6 years ago

117)         DEBUG("Rufe Domain-API auf!");
118)         api_upload_domain($dom->fqdn);
Bernd Wurst Domain-Transfer und -Regist...

Bernd Wurst authored 6 years ago

119)     }
Bernd Wurst Domain-Update (Ownerchange)...

Bernd Wurst authored 6 years ago

120) }
121) 
bernd Bessere Darstellung des Dom...

bernd authored 14 years ago

122) 
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

123) function update_possible($domain)
124) {
Bernd Wurst Aktualisiere Domain- und In...

Bernd Wurst authored 6 years ago

125)     $dom = new Domain((int) $domain);
Hanno Böck codingstyle, spaces between...

Hanno Böck authored 1 year ago

126)     if ($dom->provider != 'terions' || $dom->billing == 'external') {
Bernd Wurst Aktualisiere Domain- und In...

Bernd Wurst authored 6 years ago

127)         // Domain nicht über uns verwaltet
Bernd Wurst Zuverlässigeres Logging bei...

Bernd Wurst authored 6 years ago

128)         DEBUG("Domain nicht über uns verwaltet!");
Bernd Wurst Aktualisiere Domain- und In...

Bernd Wurst authored 6 years ago

129)         return false;
130)     }
Hanno Böck Codingstyle PSR12 + array s...

Hanno Böck authored 3 years ago

131)     $result = db_query("SELECT aenderung_eigentuemer, ruecksprache FROM misc.domainpreise WHERE tld=?", [$dom->tld]);
Bernd Wurst Aktualisiere Domain- und In...

Bernd Wurst authored 6 years ago

132)     if ($result->rowCount() < 1) {
133)         // Endung nicht bei uns in der Liste erfasst
Bernd Wurst Zuverlässigeres Logging bei...

Bernd Wurst authored 6 years ago

134)         DEBUG("Endung nicht in der Preisliste!");
Bernd Wurst Aktualisiere Domain- und In...

Bernd Wurst authored 6 years ago

135)         return false;
136)     }
137)     $data = $result->fetch();
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

138)     if ($data['aenderung_eigentuemer'] != null || $data['ruecksprache'] == 'Y') {
Bernd Wurst Zuverlässigeres Logging bei...

Bernd Wurst authored 6 years ago

139)         DEBUG("Endung hat Eigenheiten (ruecksprache=Y)");
Bernd Wurst Aktualisiere Domain- und In...

Bernd Wurst authored 6 years ago

140)         // Endung mit speziellen Eigenheiten
141)         return false;
142)     }
Bernd Wurst Zuverlässigeres Logging bei...

Bernd Wurst authored 6 years ago

143)     DEBUG("Änderungen sollten möglich sein: {$dom->fqdn}");
Bernd Wurst Aktualisiere Domain- und In...

Bernd Wurst authored 6 years ago

144)     return true;
145) }
146) 
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

147) function unset_mailserver_lock($dom)
148) {
Bernd Wurst verify-Funktion um via DNS-...

Bernd Wurst authored 6 years ago

149)     $id = $dom->id;
Hanno Böck Codingstyle PSR12 + array s...

Hanno Böck authored 3 years ago

150)     db_query("UPDATE kundendaten.domains SET secret=NULL, mailserver_lock=0 WHERE id=?", [$id]);
Bernd Wurst verify-Funktion um via DNS-...

Bernd Wurst authored 6 years ago

151) }
152) 
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

153) function create_domain_secret($dom)
154) {
Bernd Wurst verify-Funktion um via DNS-...

Bernd Wurst authored 6 years ago

155)     $id = $dom->id;
156)     $secret = md5(random_string(20));
Hanno Böck Codingstyle PSR12 + array s...

Hanno Böck authored 3 years ago

157)     db_query("UPDATE kundendaten.domains SET secret=? WHERE id=?", [$secret, $id]);
Bernd Wurst verify-Funktion um via DNS-...

Bernd Wurst authored 6 years ago

158)     $dom->secret = $secret;
159)     return $secret;
160) }
161) 
Bernd Wurst Bestätige eine Domain ohne...

Bernd Wurst authored 6 years ago

162) 
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

163) function get_auth_dns($domainname, $tld)
164) {
Hanno Böck codingstyle, spaces between...

Hanno Böck authored 1 year ago

165)     $domain = idn_to_ascii($domainname.".".$tld, 0, INTL_IDNA_VARIANT_UTS46);
Bernd Wurst verify-Funktion um via DNS-...

Bernd Wurst authored 6 years ago

166) 
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

167)     $resp = shell_exec('dig @a.root-servers.net. +noall +authority -t ns '.$tld.'.');
168)     $line = explode("\n", $resp, 2)[0];
169)     $NS = preg_replace("/^.*\\sIN\\s+NS\\s+(\\S+)$/", '\1', $line);
Bernd Wurst verify-Funktion um via DNS-...

Bernd Wurst authored 6 years ago

170) 
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

171)     $resp = shell_exec('dig @'.$NS.' -t ns '.$domain.'.');
172)     $lines = explode("\n", $resp);
Hanno remove whitespace in empty...

Hanno authored 6 years ago

173) 
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

174)     $NS = null;
175)     $NS_IP = null;
176)     $sec = null;
177)     foreach ($lines as $l) {
178)         if (preg_match("/;; AUTHORITY SECTION:.*/", $l)) {
179)             $sec = 'auth';
180)         } elseif (preg_match("/;; ADDITIONAL SECTION:.*/", $l)) {
181)             $sec = 'add';
182)         }
183)         if ($sec == 'auth' && preg_match("/^.*\\sIN\\s+NS\\s+\\S+$/", $l)) {
184)             $NS = preg_replace("/^.*\\sIN\\s+NS\\s+(\\S+)\\.$/", '\1', $l);
185)         }
186)         if ($sec == 'add' && $NS && preg_match("/^.*\\sIN\\s+A\\s+\\S+$/", $l)) {
187)             $NS_IP = preg_replace("/^.*\\sIN\\s+A\\s+(\\S+)$/", '\1', $l);
188)         }
189)     }
Hanno Böck Codingstyle PSR12 + array s...

Hanno Böck authored 3 years ago

190)     return ["$NS" => $NS_IP];
Bernd Wurst Bestätige eine Domain ohne...

Bernd Wurst authored 6 years ago

191) }
192) 
Bernd Wurst verify-Funktion um via DNS-...

Bernd Wurst authored 6 years ago

193) 
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

194) function own_ns()
195) {
Bernd Wurst Zeige die Optionen zur Prüf...

Bernd Wurst authored 6 years ago

196)     $auth = dns_get_record(config('masterdomain'), DNS_NS);
Hanno Böck Codingstyle PSR12 + array s...

Hanno Böck authored 3 years ago

197)     $own_ns = [];
Bernd Wurst Zeige die Optionen zur Prüf...

Bernd Wurst authored 6 years ago

198)     foreach ($auth as $ns) {
199)         $own_ns[] = $ns['target'];
200)     }
201) 
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

202)     return $own_ns;
Bernd Wurst Zeige die Optionen zur Prüf...

Bernd Wurst authored 6 years ago

203) }
204) 
205) 
206) 
207) 
Bernd Wurst Bestätige eine Domain ohne...

Bernd Wurst authored 6 years ago

208) function has_own_ns($domainname, $tld)
209) {
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

210)     $nsdata = get_auth_dns($domainname, $tld);
211)     $NS = null;
212)     foreach ($nsdata as $host => $ip) {
Hanno Böck codingstyle, spaces between...

Hanno Böck authored 1 year ago

213)         $NS = $host;
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

214)     }
215)     if (in_array($NS, own_ns())) {
216)         DEBUG('Domain hat unsere DNS-Server!');
217)         return true;
218)     }
219)     return false;
Bernd Wurst Bestätige eine Domain ohne...

Bernd Wurst authored 6 years ago

220) }
221) 
Bernd Wurst verify-Funktion um via DNS-...

Bernd Wurst authored 6 years ago

222) 
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

223) function get_txt_record($hostname, $domainname, $tld)
224) {
Hanno Böck codingstyle, spaces between...

Hanno Böck authored 1 year ago

225)     $domain = idn_to_ascii($domainname.".".$tld, 0, INTL_IDNA_VARIANT_UTS46);
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

226)     $nsdata = get_auth_dns($domainname, $tld);
227)     $NS = null;
228)     foreach ($nsdata as $host => $ip) {
229)         $NS = $host;
230)         if ($ip) {
231)             $NS = $ip;
232)         }
233)     }
234)     DEBUG('dig @'.$NS.' +short -t txt '.$hostname.'.'.$domain.'.');
235)     $resp = shell_exec('dig @'.$NS.' +short -t txt '.$hostname.'.'.$domain.'.');
236)     $TXT = trim($resp, "\n \"");
237)     DEBUG($TXT);
238)     return $TXT;
Bernd Wurst verify-Funktion um via DNS-...

Bernd Wurst authored 6 years ago

239) }
240) 
241) 
Bernd Wurst Ermögliche das Hinzufügen e...

Bernd Wurst authored 6 years ago

242) function list_useraccounts()
243) {
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

244)     $customerno = (int) $_SESSION['customerinfo']['customerno'];
Hanno Böck Codingstyle PSR12 + array s...

Hanno Böck authored 3 years ago

245)     $result = db_query("SELECT uid,username,name FROM system.useraccounts WHERE kunde=?", [$customerno]);
246)     $ret = [];
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

247)     while ($item = $result->fetch()) {
248)         $ret[] = $item;
249)     }
250)     DEBUG($ret);
251)     return $ret;
Bernd Wurst Ermögliche das Hinzufügen e...

Bernd Wurst authored 6 years ago

252) }
253) 
254) 
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

255) function change_user($domain, $uid)
Bernd Wurst Änderung des betreffenden U...

Bernd Wurst authored 6 years ago

256) {
257)     $domain = new Domain($domain);
258)     $domain->ensure_customerdomain();
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

259)     $targetuser = null;
Bernd Wurst Änderung des betreffenden U...

Bernd Wurst authored 6 years ago

260)     $useraccounts = list_useraccounts();
261)     foreach ($useraccounts as $u) {
262)         if ($u['uid'] == $uid) {
263)             $targetuser = $u['uid'];
264)             break;
265)         }
266)     }
267)     if (! $targetuser) {
268)         system_failure("Ungültiger Useraccount!");
269)     }
Hanno Böck Codingstyle PSR12 + array s...

Hanno Böck authored 3 years ago

270)     db_query("UPDATE kundendaten.domains SET useraccount=? WHERE id=?", [$targetuser, $domain->id]);
Bernd Wurst Änderung des betreffenden U...

Bernd Wurst authored 6 years ago

271) }
272) 
Bernd Wurst Wenn die E-Mail-Funktion ko...

Bernd Wurst authored 6 years ago

273) 
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

274) function get_domain_offer($tld)
Bernd Wurst Ermögliche das Hinzufügen e...

Bernd Wurst authored 6 years ago

275) {
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

276)     $tld = filter_input_hostname($tld);
277)     $cid = (int) $_SESSION['customerinfo']['customerno'];
Bernd Wurst Ermögliche das Hinzufügen e...

Bernd Wurst authored 6 years ago

278) 
Hanno Böck Codingstyle PSR12 + array s...

Hanno Böck authored 3 years ago

279)     $data = ["tld" => $tld];
Bernd Wurst Ermögliche das Hinzufügen e...

Bernd Wurst authored 6 years ago

280) 
Hanno Böck Codingstyle PSR12 + array s...

Hanno Böck authored 3 years ago

281)     $result = db_query("SELECT tld, gebuehr, `interval`, setup FROM misc.domainpreise_kunde WHERE kunde=:cid AND tld=:tld AND ruecksprache='N'", [":cid" => $cid, ":tld" => $tld]);
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

282)     if ($result->rowCount() != 1) {
Hanno Böck Codingstyle PSR12 + array s...

Hanno Böck authored 3 years ago

283)         $result = db_query("SELECT tld, gebuehr, `interval`, setup FROM misc.domainpreise WHERE tld=:tld AND ruecksprache='N'", [":tld" => $tld]);
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

284)     }
285)     if ($result->rowCount() != 1) {
286)         return false;
287)     }
288)     $temp = $result->fetch();
289)     $data["gebuehr"] = $temp["gebuehr"];
290)     $data["interval"] = $temp["interval"];
291)     $data["setup"] = ($temp["setup"] ? $temp["setup"] : 0.0);
Hanno remove whitespace in empty...

Hanno authored 6 years ago

292) 
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

293)     return $data;
Bernd Wurst Ermögliche das Hinzufügen e...

Bernd Wurst authored 6 years ago

294) }
295) 
Bernd Wurst Erste Vorbereitungen für Do...

Bernd Wurst authored 6 years ago

296) function set_domain_pretransfer($domain)
297) {
298)     $cid = (int) $_SESSION['customerinfo']['customerno'];
299)     $uid = (int) $_SESSION['userinfo']['uid'];
300)     $domain = (int) $domain;
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

301)     db_query(
302)         "UPDATE kundendaten.domains SET status='pretransfer', dns=1 WHERE id=? AND kunde=?",
Hanno Böck Codingstyle PSR12 + array s...

Hanno Böck authored 3 years ago

303)         [$domain, $cid]
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

304)     );
Bernd Wurst Erste Vorbereitungen für Do...

Bernd Wurst authored 6 years ago

305) }
306) 
Bernd Wurst Ermögliche das Hinzufügen e...

Bernd Wurst authored 6 years ago

307) 
Bernd Wurst Erste Vorbereitungen für Do...

Bernd Wurst authored 6 years ago

308) 
309) function set_domain_prereg($domain)
Bernd Wurst Wenn die E-Mail-Funktion ko...

Bernd Wurst authored 6 years ago

310) {
311)     $cid = (int) $_SESSION['customerinfo']['customerno'];
312)     $uid = (int) $_SESSION['userinfo']['uid'];
Bernd Wurst Erste Vorbereitungen für Do...

Bernd Wurst authored 6 years ago

313)     $domain = (int) $domain;
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

314)     db_query(
315)         "UPDATE kundendaten.domains SET status='prereg', dns=1 WHERE id=? AND kunde=?",
Hanno Böck Codingstyle PSR12 + array s...

Hanno Böck authored 3 years ago

316)         [$domain, $cid]
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

317)     );
Bernd Wurst Wenn die E-Mail-Funktion ko...

Bernd Wurst authored 6 years ago

318) }
319) 
320) 
321) function insert_domain_external($domain, $dns = false, $mail = true)
Bernd Wurst Ermögliche das Hinzufügen e...

Bernd Wurst authored 6 years ago

322) {
323)     $cid = (int) $_SESSION['customerinfo']['customerno'];
Bernd Wurst Zeige die Optionen zur Prüf...

Bernd Wurst authored 6 years ago

324)     $uid = (int) $_SESSION['userinfo']['uid'];
Bernd Wurst Lasse die API bestimmen was...

Bernd Wurst authored 6 years ago

325)     require_once("domainapi.php");
326)     $info = api_domain_available($domain);
Hanno Böck Codingstyle PSR12 + array s...

Hanno Böck authored 3 years ago

327)     if (in_array($info['status'], ['nameContainsForbiddenCharacter', 'suffixDoesNotExist'])) {
Bernd Wurst Lasse die API bestimmen was...

Bernd Wurst authored 6 years ago

328)         system_failure("Diese Domain scheint ungültig zu sein!");
Bernd Wurst Ermögliche das Hinzufügen e...

Bernd Wurst authored 6 years ago

329)     }
Bernd Wurst Lasse die API bestimmen was...

Bernd Wurst authored 6 years ago

330)     $tld = $info['domainSuffix'];
331)     $domainname = str_replace(".$tld", "", $info['domainNameUnicode']);
Bernd Wurst Logging beim Eintragen und...

Bernd Wurst authored 6 years ago

332)     logger(LOG_WARNING, 'modules/domains/include/domains', 'domains', 'Inserting external domain '.$info['domainNameUnicode']." DNS:{$dns} / Mail:{$mail}");
Hanno remove whitespace in empty...

Hanno authored 6 years ago

333) 
Bernd Wurst Wenn die E-Mail-Funktion ko...

Bernd Wurst authored 6 years ago

334)     db_query("INSERT INTO kundendaten.domains (status, kunde, useraccount, domainname, tld, billing, provider, dns, mail, mailserver_lock) VALUES 
Hanno Böck Codingstyle PSR12 + array s...

Hanno Böck authored 3 years ago

335)         ('external', ?, ?, ?, ?, 'external', 'other', 0, ?, 1)", [$cid, $uid, $domainname, $tld, ($mail ? 'auto' : 'none')]);
Bernd Wurst Ermögliche das Hinzufügen e...

Bernd Wurst authored 6 years ago

336)     $id = db_insert_id();
337)     if ($dns) {
Hanno Böck Codingstyle PSR12 + array s...

Hanno Böck authored 3 years ago

338)         db_query("UPDATE kundendaten.domains SET dns=1 WHERE id=?", [$id]);
Bernd Wurst Ermögliche das Hinzufügen e...

Bernd Wurst authored 6 years ago

339)     }
Bernd Wurst Wenn die E-Mail-Funktion ko...

Bernd Wurst authored 6 years ago

340)     if ($mail) {
341)         $vmailserver = (int) $_SESSION['userinfo']['server'];
Hanno Böck Codingstyle PSR12 + array s...

Hanno Böck authored 3 years ago

342)         db_query("INSERT INTO mail.virtual_mail_domains (domain, server) VALUES (?, ?)", [$id, $vmailserver]);
Bernd Wurst Wenn die E-Mail-Funktion ko...

Bernd Wurst authored 6 years ago

343)     }
Bernd Wurst Ermögliche das Hinzufügen e...

Bernd Wurst authored 6 years ago

344)     return $id;
345) }
346) 
Bernd Wurst allow conversion of transfe...

Bernd Wurst authored 1 year ago

347) 
348) function convert_domain_to_external($domain)
349) {
Hanno Böck codingstyle

Hanno Böck authored 1 year ago

350)     db_query(
351)         "UPDATE kundendaten.domains SET status='external', billing='external', provider='other', kuendigungsdatum=NULL, registrierungsdatum=NULL, betrag=NULL WHERE id=? AND status='transferout' AND abgerechnet_bis >= kuendigungsdatum",
352)         [$domain,]
353)     );
Bernd Wurst allow conversion of transfe...

Bernd Wurst authored 1 year ago

354) }
355) 
Bernd Wurst Transfer-Freigabe und Kündi...

Bernd Wurst authored 6 years ago

356) function delete_domain($id)
357) {
358)     $cid = (int) $_SESSION['customerinfo']['customerno'];
Bernd Wurst Logging beim Eintragen und...

Bernd Wurst authored 6 years ago

359)     logger(LOG_WARNING, 'modules/domains/include/domains', 'domains', 'Deleting domain '.$id);
Hanno Böck Codingstyle PSR12 + array s...

Hanno Böck authored 3 years ago

360)     db_query("DELETE FROM kundendaten.domains WHERE id=? AND kunde=?", [$id, $cid]);