a89224cdea64575bc9a281eb5dcf5422a53f7ceb
Bernd Wurst Ermögliche das Ändern eines...

Bernd Wurst authored 6 years ago

1) <?php
2) /*
3) This file belongs to the Webinterface of schokokeks.org Hosting
4) 
5) Written 2008-2018 by schokokeks.org Hosting, namely
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) */
16) 
17) require_once('inc/debug.php');
18) require_once('inc/icons.php');
19) 
20) require_once('class/domain.php');
21) require_once('domains.php');
22) 
Bernd Wurst Blende Aktionen aus, wenn d...

Bernd Wurst authored 6 years ago

23) require_role(array(ROLE_CUSTOMER, ROLE_SYSTEMUSER));
Bernd Wurst Ermögliche das Ändern eines...

Bernd Wurst authored 6 years ago

24) 
Bernd Wurst Alle Domain-Details auf ein...

Bernd Wurst authored 6 years ago

25) $dom = NULL;
26) if (isset($_REQUEST['id'])) {
27)     $dom = new Domain( (int) $_REQUEST['id']);
Bernd Wurst Erste Vorbereitungen für Do...

Bernd Wurst authored 6 years ago

28)     $_SESSION['domains_detail_domainname'] = $dom->fqdn;
29) } elseif (isset($_SESSION['domains_detail_domainname'])) {
30)     $dom = new Domain($_SESSION['domains_detail_domainname']);
Bernd Wurst Alle Domain-Details auf ein...

Bernd Wurst authored 6 years ago

31) } else {
32)     system_failure("Keine Domain angegeben");
Bernd Wurst Ermögliche das Ändern eines...

Bernd Wurst authored 6 years ago

33) }
Bernd Wurst Alle Domain-Details auf ein...

Bernd Wurst authored 6 years ago

34) if (!$dom) {
35)     system_failure("Keine Domain gewählt!");
36) }
Bernd Wurst Blende Aktionen aus, wenn d...

Bernd Wurst authored 6 years ago

37) if (have_role(ROLE_CUSTOMER)) {
38)     $dom->ensure_customerdomain();
39) } else {
40)     $dom->ensure_userdomain();
41) }
Bernd Wurst Ermögliche das Ändern eines...

Bernd Wurst authored 6 years ago

42) 
43) title("Domain {$dom->fqdn}");
44) $section = 'domains_domains';
45) 
Bernd Wurst Alle Domain-Details auf ein...

Bernd Wurst authored 6 years ago

46) // Block zuständiger Useraccount
47) 
Bernd Wurst Domain-Nutzung mit Deeplink...

Bernd Wurst authored 6 years ago

48) $is_current_user = true;
Bernd Wurst Alle Domain-Details auf ein...

Bernd Wurst authored 6 years ago

49) $useraccounts = list_useraccounts();
Bernd Wurst Blende Aktionen aus, wenn d...

Bernd Wurst authored 6 years ago

50) if (have_role(ROLE_CUSTOMER) && count($useraccounts) > 1) {
Bernd Wurst Domain-Nutzung mit Deeplink...

Bernd Wurst authored 6 years ago

51)     if ($dom->useraccount != $_SESSION['userinfo']['uid']) {
52)         $is_current_user = false;
53)     }
Bernd Wurst Alle Domain-Details auf ein...

Bernd Wurst authored 6 years ago

54)     // Mehrere User vorhanden
55)     $options = array();
56)     foreach ($useraccounts as $u) {
57)         $options[$u['uid']] = $u['username'];
58)     }
59)     if (!array_key_exists($dom->useraccount, $options)) {
60)         $options[$dom->useraccount] = $dom->useraccount;
61)     }
62)     output('<h4>Zuständiges Benutzerkonto</h4>');
63)     $form = '<p>Diese Domain nutzen im Benutzerkonto '.html_select('domainuser', $options, $dom->useraccount).' <input type="submit" name="submit" value="Änderung speichern"></p>';
64)     output(html_form('update-user', 'update', 'action=chguser&id='.$dom->id, $form));
Bernd Wurst Ermögliche das Ändern eines...

Bernd Wurst authored 6 years ago

65) }
Bernd Wurst Alle Domain-Details auf ein...

Bernd Wurst authored 6 years ago

66) 
67) 
Bernd Wurst Domain-Nutzung mit Deeplink...

Bernd Wurst authored 6 years ago

68) // Block Nutzung
69) 
70) if ($is_current_user) {
71)     output("<h4>Aktuelle Nutzung dieser Domain</h4>");
Bernd Wurst Deeplinks als Flex-Tiles

Bernd Wurst authored 6 years ago

72)     output('<div class="tile-container">');
Bernd Wurst styling der Nutzungsangaben...

Bernd Wurst authored 6 years ago

73)     $everused = false;
74)     if (have_module('dns') && $dom->dns == 1) {
75)         $used = dns_in_use($dom->id);
76)         output("<div class=\"tile usage ".($used ? "used" : "unused")."\"><p><strong>".internal_link('../dns/dns_domain', "DNS-Server", 'dom='.$dom->id)."</strong></p><p>".($used ? "Manuelle DNS-Records vorhanden." : "DNS-Records möglich")."</p></div>");
77)         $everused = true;
Bernd Wurst Domain-Nutzung mit Deeplink...

Bernd Wurst authored 6 years ago

78)     }
Bernd Wurst styling der Nutzungsangaben...

Bernd Wurst authored 6 years ago

79)     if (have_module('email') && ($dom->mail != 'none')) {
80)         $used = mail_in_use($dom->id);
Bernd Wurst Zeige Mail-Deeplink korrekt...

Bernd Wurst authored 6 years ago

81)         $vmail = count_vmail($dom->id);
Bernd Wurst styling der Nutzungsangaben...

Bernd Wurst authored 6 years ago

82)         if ($used) {
83)             if ($vmail > 0) {
84)                 output("<div class=\"tile usage used\"><p><strong>".internal_link('../email/vmail', "E-Mail", 'filter='.$dom->fqdn)."</strong></p><p>E-Mail-Postfächer unter dieser Domain: <strong>{$vmail}</strong></p></div>");
85)             } else {
86)                 output("<div class=\"tile usage unused\"><p><strong>".internal_link('../email/imap', "E-Mail")."</strong></p><p>Manuelle Mail-Konfiguration ist aktiv</p></div>");
87)             }
Bernd Wurst Zeige Mail-Deeplink korrekt...

Bernd Wurst authored 6 years ago

88)         } else {
Bernd Wurst styling der Nutzungsangaben...

Bernd Wurst authored 6 years ago

89)             output("<div class=\"tile usage unused\"><p><strong>".internal_link('../email/vmail', "E-Mail", 'filter='.$dom->fqdn)."</strong></p><p>Bisher keine E-Mail-Postfächer unter dieser Domain.</p></div>");
Bernd Wurst Zeige Mail-Deeplink korrekt...

Bernd Wurst authored 6 years ago

90)         }
Bernd Wurst styling der Nutzungsangaben...

Bernd Wurst authored 6 years ago

91)         $everused = true;
Bernd Wurst Domain-Nutzung mit Deeplink...

Bernd Wurst authored 6 years ago

92)     }
93)     if (have_module('mailman') && mailman_subdomains($dom->id)) {
Bernd Wurst Deeplink von Domain zu Mail...

Bernd Wurst authored 5 years ago

94)         $mailmanhosts = mailman_subdomains($dom->id);
95)         $hostname = $dom->fqdn;
96)         if (count($mailmanhosts) == 1) {
97)             $hostname = $mailmanhosts[0]['hostname'].'.'.$dom->fqdn;
98)         }
99)         output("<div class=\"tile usage used\"><p><strong>".internal_link('../mailman/lists', "Mailinglisten", 'filter='.$hostname)."</strong></p><p>Diese Domain wird für Mailinglisten verwendet</p></div>");
Bernd Wurst Domain-Nutzung mit Deeplink...

Bernd Wurst authored 6 years ago

100)         $used = true;
Bernd Wurst styling der Nutzungsangaben...

Bernd Wurst authored 6 years ago

101)         $everused = true;
Bernd Wurst Domain-Nutzung mit Deeplink...

Bernd Wurst authored 6 years ago

102)     }
Bernd Wurst styling der Nutzungsangaben...

Bernd Wurst authored 6 years ago

103)     if (have_module('vhosts')) {
104)         $used = web_in_use($dom->id);
105)         output("<div class=\"tile usage ".($used ? "used" : "unused")."\"><p><strong>".internal_link('../vhosts/vhosts', "Websites", 'filter='.$dom->fqdn)."</strong></p><p>".($used ? "Es gibt Website-Einstellungen für diese Domain" : "Bisher keine Website eingerichtet")."</p></div>");
106)         $everused = true;
Bernd Wurst Domain-Nutzung mit Deeplink...

Bernd Wurst authored 6 years ago

107)     }
Bernd Wurst styling der Nutzungsangaben...

Bernd Wurst authored 6 years ago

108)     if (have_module('jabber')) {
109)         if ($dom->jabber == 1) {
110)             output("<div class=\"tile usage used\"><p><strong>".internal_link('../jabber/accounts', "Jabber/XMPP")."</strong></p><p>Diese Domain wird für Jabber verwendet</p></div>");
111)         } else {
112)             output("<div class=\"tile usage unused\"><p><strong>".internal_link('../jabber/new_domain', "Jabber/XMPP")."</strong></p><p>Diese Domain wird bisher nicht für Jabber verwendet</p></div>");
113)         }
114)         $everused = true;
Bernd Wurst Domain-Nutzung mit Deeplink...

Bernd Wurst authored 6 years ago

115)     }
Bernd Wurst Deeplinks als Flex-Tiles

Bernd Wurst authored 6 years ago

116)     output('</div>');
Bernd Wurst styling der Nutzungsangaben...

Bernd Wurst authored 6 years ago

117)     if (! $everused) {
118)         output('<p><em>Keine Nutzung dieser Domain (die hier angezeigt wird)</em></p>');
119)     }
Bernd Wurst Domain-Nutzung mit Deeplink...

Bernd Wurst authored 6 years ago

120) }
121) 
Bernd Wurst Alle Domain-Details auf ein...

Bernd Wurst authored 6 years ago

122) // Block Domain-Inhaber 
123) 
Bernd Wurst Blende Aktionen aus, wenn d...

Bernd Wurst authored 6 years ago

124) if (have_role(ROLE_CUSTOMER) && config('http.net-apikey') && $dom->provider == 'terions' && ($dom->cancel_date === NULL || $dom->cancel_date > date('Y-m-d'))) {
Bernd Wurst Alle Domain-Details auf ein...

Bernd Wurst authored 6 years ago

125)     use_module('contacts');
126)     require_once('contacts.php');
Bernd Wurst Blende Aktionen aus, wenn d...

Bernd Wurst authored 6 years ago

127)     require_once('domainapi.php');
Bernd Wurst Alle Domain-Details auf ein...

Bernd Wurst authored 6 years ago

128) 
129)     output('<h4>Inhaberwechsel der Domain</h4>');
130)     output('<p>Legen Sie hier einen neuen Inhaber für diese Domain fest.</p>');
131) 
132)     if (isset($_REQUEST['id'])) {
133)         api_download_domain($_REQUEST['id']);
Bernd Wurst Erste Vorbereitungen für Do...

Bernd Wurst authored 6 years ago

134)         $_SESSION['domains_detail_domainname'] = $dom->fqdn;
135)         $_SESSION['domains_detail_owner'] = $dom->owner;
136)         $_SESSION['domains_detail_admin_c'] = $dom->admin_c;
Bernd Wurst Alle Domain-Details auf ein...

Bernd Wurst authored 6 years ago

137)     }
138)     if (!update_possible($dom->id)) {
139)         warning("Diese Domain verwendet eine unübliche Endung. Daher kann der Inhaber nicht auf diesem Weg verändert werden. Bitte kontaktieren Sie den Support.");
140)     } else {
141) 
Bernd Wurst Erste Vorbereitungen für Do...

Bernd Wurst authored 6 years ago

142)         if ($_SESSION['domains_detail_admin_c'] == $dom->admin_c && 
143)                 $_SESSION['domains_detail_owner'] != $dom->owner && 
144)                 (!isset($_SESSION['domains_detail_detach']) || $_SESSION['domains_detail_detach'] == 0)) {
Bernd Wurst Alle Domain-Details auf ein...

Bernd Wurst authored 6 years ago

145)             // Wenn der Owner geändert wurde, der Admin aber nicht und das detach-Flag 
146)             // nicht gesetzt ist, dann wird der Admin gleich dem Owner gesetzt
Bernd Wurst Erste Vorbereitungen für Do...

Bernd Wurst authored 6 years ago

147)             $_SESSION['domains_detail_admin_c'] = $_SESSION['domains_detail_owner'];
Bernd Wurst Ermögliche das Ändern eines...

Bernd Wurst authored 6 years ago

148)         }
Bernd Wurst Alle Domain-Details auf ein...

Bernd Wurst authored 6 years ago

149) 
150)         if (isset($_GET['admin_c']) && $_GET['admin_c'] == 'none') {
Bernd Wurst Erste Vorbereitungen für Do...

Bernd Wurst authored 6 years ago

151)             $_SESSION['domains_detail_admin_c'] = $_SESSION['domains_detail_owner'];
152)             unset($_SESSION['domains_detail_detach']);
Bernd Wurst Ermögliche das Ändern eines...

Bernd Wurst authored 6 years ago

153)         }
154) 
Bernd Wurst Erste Vorbereitungen für Do...

Bernd Wurst authored 6 years ago

155)         $owner = get_contact($_SESSION['domains_detail_owner']);
156)         $admin_c = get_contact($_SESSION['domains_detail_admin_c']);
Bernd Wurst Alle Domain-Details auf ein...

Bernd Wurst authored 6 years ago

157)         $function = 'Inhaber';
158)         if ($owner['id'] == $admin_c['id']) {
159)             $function .= ' und Verwalter';
160)         }
161)         $cssclass = '';
162)         if ($owner['id'] != $dom->owner) {
163)             $cssclass = 'modified';
164)         }
165)         output('<p><strong>'.$function.':</strong></p>'.display_contact($owner, '', $cssclass));
166)         addnew('choose', 'Neuen Inhaber wählen', "type=owner");
167)         if ($owner['id'] != $admin_c['id']) {
168)             $cssclass = '';
169)             if ($admin_c['id'] != $dom->admin_c) {
170)                 $cssclass = 'modified';
Bernd Wurst Ermögliche das Ändern eines...

Bernd Wurst authored 6 years ago

171)             }
Bernd Wurst Alle Domain-Details auf ein...

Bernd Wurst authored 6 years ago

172)             output('<p><strong>Verwalter:</strong></p>'.display_contact($admin_c, '', $cssclass));
173)             addnew('choose', 'Neuen Verwalter wählen', "type=admin_c");
Bernd Wurst Erste Vorbereitungen für Do...

Bernd Wurst authored 6 years ago

174)             output('<p class="delete">'.internal_link('', 'Keinen separaten Verwalter festlegen', 'admin_c=none').'</p>');
Bernd Wurst Alle Domain-Details auf ein...

Bernd Wurst authored 6 years ago

175)         } else {
176)             addnew('choose', 'Einen separaten Verwalter wählen', "type=admin_c&detach=1");
Bernd Wurst Ermögliche das Ändern eines...

Bernd Wurst authored 6 years ago

177)         }
178) 
179) 
Bernd Wurst Alle Domain-Details auf ein...

Bernd Wurst authored 6 years ago

180)         if ($owner['id'] != $dom->owner || $admin_c['id'] != $dom->admin_c) {
181)             if (isset($_GET['error']) && $_GET['error'] == '1') {
182)                 input_error('Sie müssen der Übertragung explizit zustimmen!');
183)             }
184)             $form = '<p>Es sind Änderungen vorgenommen worden, die noch nicht gespeichert wurden</p>';
185)             $form .= '<p><input type="checkbox" name="accept" value="1" id="accept"><label for="accept"> Ich bestätige, dass ich die nachfolgenden Hinweise zur Kenntnis genommen habe.</p>
186)                 <p>Mit Speichern dieser Änderungen führen Sie möglicherweise einen Inhaberwechsel bei der Domain '.$dom->fqdn.' aus. Inhaberwechsel sind bei einigen Domainendungen (z.B. com/net/org) zustimmungspflichtig vom alten und vom neuen Inhaber. Die Registrierungsstelle kann nach eigenem Ermessen diese Zustimmung per separater E-Mail einfordern. Wird diese Zustimmung nicht oder verspätet erteilt, kann eine Domain gesperrt werden. Dieser Vorgang wird nicht von '.config('company_name').' kontrolliert.</p>
187)                 <p>Sie sind ferner darüber informiert, dass die Adresse des Domaininhabers öffentlich abrufbar ist.</p>';
188)             $form .= '<p><input type="submit" name="sumbit" value="Änderungen speichern und Domaininhaber ändern"></p>';
189)             output(html_form('domains_update', 'update', "action=ownerchange&id=".$dom->id, $form));
190)         } 
Bernd Wurst Ermögliche das Ändern eines...

Bernd Wurst authored 6 years ago

191)     }
192) }
Bernd Wurst Alle Domain-Details auf ein...

Bernd Wurst authored 6 years ago

193) 
194) // Block Externe Domain umziehen
195) 
Bernd Wurst Blende Aktionen aus, wenn d...

Bernd Wurst authored 6 years ago

196) if (have_role(ROLE_CUSTOMER) && config('http.net-apikey')) {
197)     if ($dom->status == 'prereg') {
198)         output('<h4>Domain-Registrierung abschließen</h4>
199)                 <p>'.internal_link('domainreg', 'Domain registrieren', "domain={$dom->fqdn}").'</p>');
200)     } elseif ($dom->status == 'pretransfer') {
201)         output('<h4>Domain zu '.config('company_name').' umziehen</h4>
202)                 <p>'.internal_link('domainreg', 'Umzugsautrag (ggf. nochmals) erteilen', "domain={$dom->fqdn}").'</p>');
203)     } elseif ($dom->provider != 'terions') {
204)         output('<h4>Domain zu '.config('company_name').' umziehen</h4>
205)                 <p>'.internal_link('domainreg', 'Domain-Transfer starten', "domain={$dom->fqdn}").'</p>');
206)     }
Bernd Wurst Alle Domain-Details auf ein...

Bernd Wurst authored 6 years ago

207) }
208) 
Bernd Wurst Transfer-Freigabe und Kündi...

Bernd Wurst authored 6 years ago

209) // Block Domain löschen/kündigen
210) 
211) $domain_in_use = mailman_subdomains($dom->id) || mail_in_use($dom->id) || web_in_use($dom->id) || $dom->jabber == 1;
212) if (!$domain_in_use && ($dom->status == 'prereg' || $dom->status == 'pretransfer' || $dom->status == 'transferfailed' || $dom->status == 'external')) {
213)     output('<h4>Domain wieder entfernen</h4>');
214)     output('<p class="delete">'.internal_link('save', 'Die Domain '.$dom->fqdn.' entfernen', 'action=delete&domain='.$dom->id).'</p>');
Bernd Wurst Biete kein Domain-Managemen...

Bernd Wurst authored 6 years ago

215) } elseif (have_role(ROLE_CUSTOMER) && config('http.net-apikey') && $dom->provider == 'terions' && (!$dom->cancel_date || ($dom->cancel_date > date('Y-m-d')))) {
Bernd Wurst Blende Aktionen aus, wenn d...

Bernd Wurst authored 6 years ago

216)     require_once('domainapi.php');
Bernd Wurst Transfer-Freigabe und Kündi...

Bernd Wurst authored 6 years ago

217)     output('<h4>Domain kündigen</h4>');
218)     $info = api_download_domain($dom->id);
219)     if ($info['authInfo']) {
220)         output('<p>Das Auth-Info für diese Domain lautet: <strong>'.$info['authInfo'].'</strong></p>');
221)         output('<p>Wenden Sie sich an den Support, wenn Sie den Domainumzug wieder sperren möchten.</p>');
222)     } else {
223)         output('<p>Hier können Sie die Domain zum Umzug freigeben.</p>');
224)         $form = '<p><input type="hidden" name="domain" value="'.$dom->id.'"><input type="submit" name="submit" value="Die Domain '.$dom->fqdn.' zum Umzug freigeben"></p>';
225)         output(html_form('domains_transfer', 'save', 'action=transfer', $form));
226)     }
227)     output('<p>Die aktuelle Laufzeit der Domain dauert noch bis '.$info['currentContractPeriodEnd'].'</p>');
228)     if ($info['deletionDate']) {
229)         output('<p>Es liegt aktuell eine Kündigung vor auf <strong>'.$info['deletionDate'].'</strong></p><p>Um die Kündigung aufzuheben, wenden Sie sich bitte an den Support.</p>');
230)     } else {
Bernd Wurst Hinweis auf automatische Ve...

Bernd Wurst authored 6 years ago

231)         output('<p>Die Laufzeit wird automatisch um ein weiteres Jahr verlängert, sofern Sie keine Kündigung auslösen.</p>');
Bernd Wurst Transfer-Freigabe und Kündi...

Bernd Wurst authored 6 years ago

232)         output('<p class="delete">'.internal_link('save', 'Die Domain '.$dom->fqdn.' kündigen', 'action=cancel&domain='.$dom->id).'</p>');
233)     }
234) }
235) 
236) 
Bernd Wurst Alle Domain-Details auf ein...

Bernd Wurst authored 6 years ago

237) // Block Domain bestätigen
238) 
Bernd Wurst Erste Vorbereitungen für Do...

Bernd Wurst authored 6 years ago

239) if ($dom->mailserver_lock == 1 && $dom->status != 'prereg') {
Bernd Wurst Alle Domain-Details auf ein...

Bernd Wurst authored 6 years ago

240)     if (has_own_ns($dom->domainname, $dom->tld)) {
241)         unset_mailserver_lock($dom);
242)         success_msg("Die Domain {$dom->fqdn} wurde erfolgreich bestätigt und kann nun in vollem Umfang verwendet werden.");
243)         redirect("");
244)     }
245)     output('<h3>Mailserver-Sperre aktiv</h3>
246)             <p>Bisher ist für diese Domain die Nutzung als Mail-Domain eingeschränkt, da wir noch keine Gewissheit haben, ob Sie der rechtmäßige Nutzer der Domain sind. Eine Domain, die für E-Mail-Aktivität genutzt werden soll, muss entweder die DNS-Server von '.config('company_name').' verwenden oder die Inhaberschaft muss durch einen passend gesetzten DNS-Record nachgewiesen werden. Nachfolgend werden die Möglichkeiten im Detail vorgestellt.</p>');
247)     if (!$dom->secret) {
248)         create_domain_secret($dom);
249)     }
250) 
251)     $TXT = get_txt_record('_schokokeks', $dom->domainname, $dom->tld);
252)     if ($TXT == $dom->secret) {
253)         unset_mailserver_lock($dom);
254)         success_msg("Die Domain {$dom->fqdn} wurde erfolgreich bestätigt und kann nun in vollem Umfang verwendet werden.");
Bernd Wurst Lasse die API bestimmen was...

Bernd Wurst authored 6 years ago

255)         redirect("");