Ermögliche das Ändern eines...
Bernd Wurst authored 8 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)
|
Blende Aktionen aus, wenn d...
Bernd Wurst authored 8 years ago
|
23) require_role(array(ROLE_CUSTOMER, ROLE_SYSTEMUSER));
|
Ermögliche das Ändern eines...
Bernd Wurst authored 8 years ago
|
24)
|
Alle Domain-Details auf ein...
Bernd Wurst authored 8 years ago
|
25) $dom = NULL;
26) if (isset($_REQUEST['id'])) {
27) $dom = new Domain( (int) $_REQUEST['id']);
|
Erste Vorbereitungen für Do...
Bernd Wurst authored 8 years ago
|
28) $_SESSION['domains_detail_domainname'] = $dom->fqdn;
29) } elseif (isset($_SESSION['domains_detail_domainname'])) {
30) $dom = new Domain($_SESSION['domains_detail_domainname']);
|
Alle Domain-Details auf ein...
Bernd Wurst authored 8 years ago
|
31) } else {
32) system_failure("Keine Domain angegeben");
|
Ermögliche das Ändern eines...
Bernd Wurst authored 8 years ago
|
33) }
|
Alle Domain-Details auf ein...
Bernd Wurst authored 8 years ago
|
34) if (!$dom) {
35) system_failure("Keine Domain gewählt!");
36) }
|
Blende Aktionen aus, wenn d...
Bernd Wurst authored 8 years ago
|
37) if (have_role(ROLE_CUSTOMER)) {
38) $dom->ensure_customerdomain();
39) } else {
40) $dom->ensure_userdomain();
41) }
|
Ermögliche das Ändern eines...
Bernd Wurst authored 8 years ago
|
42)
43) title("Domain {$dom->fqdn}");
44) $section = 'domains_domains';
45)
|
Alle Domain-Details auf ein...
Bernd Wurst authored 8 years ago
|
46) // Block zuständiger Useraccount
47)
|
Domain-Nutzung mit Deeplink...
Bernd Wurst authored 8 years ago
|
48) $is_current_user = true;
|
Alle Domain-Details auf ein...
Bernd Wurst authored 8 years ago
|
49) $useraccounts = list_useraccounts();
|
Blende Aktionen aus, wenn d...
Bernd Wurst authored 8 years ago
|
50) if (have_role(ROLE_CUSTOMER) && count($useraccounts) > 1) {
|
Domain-Nutzung mit Deeplink...
Bernd Wurst authored 8 years ago
|
51) if ($dom->useraccount != $_SESSION['userinfo']['uid']) {
52) $is_current_user = false;
53) }
|
Alle Domain-Details auf ein...
Bernd Wurst authored 8 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));
|
Ermögliche das Ändern eines...
Bernd Wurst authored 8 years ago
|
65) }
|
Alle Domain-Details auf ein...
Bernd Wurst authored 8 years ago
|
66)
67)
|
Domain-Nutzung mit Deeplink...
Bernd Wurst authored 8 years ago
|
68) // Block Nutzung
69)
70) if ($is_current_user) {
71) $used = false;
72) output("<h4>Aktuelle Nutzung dieser Domain</h4>");
73) if (have_module('dns') && $dom->dns == 1 && dns_in_use($dom->id)) {
74) output("<p>Es sind manuell gesetzte DNS-Einträge unter dieser Domain aktiv. ".internal_link('../dns/dns_domain', '→ Bearbeiten', 'dom='.$dom->id)."</p>");
75) $used = true;
76) }
77) if (have_module('email') && mail_in_use($dom->id)) {
|
Filter-Funktion für vmail-A...
Bernd Wurst authored 8 years ago
|
78) output("<p>Es gibt E-Mail-Postfächer unter dieser Domain ".internal_link('../email/vmail', '→ Bearbeiten', 'filter='.$dom->fqdn)."</p>");
|
Domain-Nutzung mit Deeplink...
Bernd Wurst authored 8 years ago
|
79) $used = true;
80) }
81) if (have_module('mailman') && mailman_subdomains($dom->id)) {
82) output("<p>Diese Domain wird für Mailinglisten verwendet ".internal_link('../mailman/lists', '→ Bearbeiten')."</p>");
83) $used = true;
84) }
85) if (have_module('vhosts') && web_in_use($dom->id)) {
86) output("<p>Es gibt Website-Einstellungen für diese Domain ".internal_link('../vhosts/vhosts', '→ Bearbeiten', 'filter='.$dom->fqdn)."</p>");
87) $used = true;
88) }
89) if (have_module('jabber') && $dom->jabber == 1) {
90) output("<p>Diese Domain wird für Jabber verwendet ".internal_link('../jabber/accounts', '→ Bearbeiten')."</p>");
91) $used = true;
92) }
93) if (! $used) {
94) output('<p><em>Aktuell wird diese Domain nicht verwendet!</em></p>');
95) }
96) }
97)
|
Alle Domain-Details auf ein...
Bernd Wurst authored 8 years ago
|
98) // Block Domain-Inhaber
99)
|
Blende Aktionen aus, wenn d...
Bernd Wurst authored 8 years ago
|
100) if (have_role(ROLE_CUSTOMER) && config('http.net-apikey') && $dom->provider == 'terions' && ($dom->cancel_date === NULL || $dom->cancel_date > date('Y-m-d'))) {
|
Alle Domain-Details auf ein...
Bernd Wurst authored 8 years ago
|
101) use_module('contacts');
102) require_once('contacts.php');
|
Blende Aktionen aus, wenn d...
Bernd Wurst authored 8 years ago
|
103) require_once('domainapi.php');
|
Alle Domain-Details auf ein...
Bernd Wurst authored 8 years ago
|
104)
105) output('<h4>Inhaberwechsel der Domain</h4>');
106) output('<p>Legen Sie hier einen neuen Inhaber für diese Domain fest.</p>');
107)
108) if (isset($_REQUEST['id'])) {
109) api_download_domain($_REQUEST['id']);
|
Erste Vorbereitungen für Do...
Bernd Wurst authored 8 years ago
|
110) $_SESSION['domains_detail_domainname'] = $dom->fqdn;
111) $_SESSION['domains_detail_owner'] = $dom->owner;
112) $_SESSION['domains_detail_admin_c'] = $dom->admin_c;
|
Alle Domain-Details auf ein...
Bernd Wurst authored 8 years ago
|
113) }
114) if (!update_possible($dom->id)) {
115) warning("Diese Domain verwendet eine unübliche Endung. Daher kann der Inhaber nicht auf diesem Weg verändert werden. Bitte kontaktieren Sie den Support.");
116) } else {
117)
|
Erste Vorbereitungen für Do...
Bernd Wurst authored 8 years ago
|
118) if ($_SESSION['domains_detail_admin_c'] == $dom->admin_c &&
119) $_SESSION['domains_detail_owner'] != $dom->owner &&
120) (!isset($_SESSION['domains_detail_detach']) || $_SESSION['domains_detail_detach'] == 0)) {
|
Alle Domain-Details auf ein...
Bernd Wurst authored 8 years ago
|
121) // Wenn der Owner geändert wurde, der Admin aber nicht und das detach-Flag
122) // nicht gesetzt ist, dann wird der Admin gleich dem Owner gesetzt
|
Erste Vorbereitungen für Do...
Bernd Wurst authored 8 years ago
|
123) $_SESSION['domains_detail_admin_c'] = $_SESSION['domains_detail_owner'];
|
Ermögliche das Ändern eines...
Bernd Wurst authored 8 years ago
|
124) }
|
Alle Domain-Details auf ein...
Bernd Wurst authored 8 years ago
|
125)
126) if (isset($_GET['admin_c']) && $_GET['admin_c'] == 'none') {
|
Erste Vorbereitungen für Do...
Bernd Wurst authored 8 years ago
|
127) $_SESSION['domains_detail_admin_c'] = $_SESSION['domains_detail_owner'];
128) unset($_SESSION['domains_detail_detach']);
|
Ermögliche das Ändern eines...
Bernd Wurst authored 8 years ago
|
129) }
130)
|
Erste Vorbereitungen für Do...
Bernd Wurst authored 8 years ago
|
131) $owner = get_contact($_SESSION['domains_detail_owner']);
132) $admin_c = get_contact($_SESSION['domains_detail_admin_c']);
|
Alle Domain-Details auf ein...
Bernd Wurst authored 8 years ago
|
133) $function = 'Inhaber';
134) if ($owner['id'] == $admin_c['id']) {
135) $function .= ' und Verwalter';
136) }
137) $cssclass = '';
138) if ($owner['id'] != $dom->owner) {
139) $cssclass = 'modified';
140) }
141) output('<p><strong>'.$function.':</strong></p>'.display_contact($owner, '', $cssclass));
142) addnew('choose', 'Neuen Inhaber wählen', "type=owner");
143) if ($owner['id'] != $admin_c['id']) {
144) $cssclass = '';
145) if ($admin_c['id'] != $dom->admin_c) {
146) $cssclass = 'modified';
|
Ermögliche das Ändern eines...
Bernd Wurst authored 8 years ago
|
147) }
|
Alle Domain-Details auf ein...
Bernd Wurst authored 8 years ago
|
148) output('<p><strong>Verwalter:</strong></p>'.display_contact($admin_c, '', $cssclass));
149) addnew('choose', 'Neuen Verwalter wählen', "type=admin_c");
|
Erste Vorbereitungen für Do...
Bernd Wurst authored 8 years ago
|
150) output('<p class="delete">'.internal_link('', 'Keinen separaten Verwalter festlegen', 'admin_c=none').'</p>');
|
Alle Domain-Details auf ein...
Bernd Wurst authored 8 years ago
|
151) } else {
152) addnew('choose', 'Einen separaten Verwalter wählen', "type=admin_c&detach=1");
|
Ermögliche das Ändern eines...
Bernd Wurst authored 8 years ago
|
153) }
154)
155)
|
Alle Domain-Details auf ein...
Bernd Wurst authored 8 years ago
|
156) if ($owner['id'] != $dom->owner || $admin_c['id'] != $dom->admin_c) {
157) if (isset($_GET['error']) && $_GET['error'] == '1') {
158) input_error('Sie müssen der Übertragung explizit zustimmen!');
159) }
160) $form = '<p>Es sind Änderungen vorgenommen worden, die noch nicht gespeichert wurden</p>';
161) $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>
162) <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>
163) <p>Sie sind ferner darüber informiert, dass die Adresse des Domaininhabers öffentlich abrufbar ist.</p>';
164) $form .= '<p><input type="submit" name="sumbit" value="Änderungen speichern und Domaininhaber ändern"></p>';
165) output(html_form('domains_update', 'update', "action=ownerchange&id=".$dom->id, $form));
166) }
|
Ermögliche das Ändern eines...
Bernd Wurst authored 8 years ago
|
167) }
168) }
|
Alle Domain-Details auf ein...
Bernd Wurst authored 8 years ago
|
169)
170) // Block Externe Domain umziehen
171)
|
Blende Aktionen aus, wenn d...
Bernd Wurst authored 8 years ago
|
172) if (have_role(ROLE_CUSTOMER) && config('http.net-apikey')) {
173) if ($dom->status == 'prereg') {
174) output('<h4>Domain-Registrierung abschließen</h4>
175) <p>'.internal_link('domainreg', 'Domain registrieren', "domain={$dom->fqdn}").'</p>');
176) } elseif ($dom->status == 'pretransfer') {
177) output('<h4>Domain zu '.config('company_name').' umziehen</h4>
178) <p>'.internal_link('domainreg', 'Umzugsautrag (ggf. nochmals) erteilen', "domain={$dom->fqdn}").'</p>');
179) } elseif ($dom->provider != 'terions') {
180) output('<h4>Domain zu '.config('company_name').' umziehen</h4>
181) <p>'.internal_link('domainreg', 'Domain-Transfer starten', "domain={$dom->fqdn}").'</p>');
182) }
|
Alle Domain-Details auf ein...
Bernd Wurst authored 8 years ago
|
183) }
184)
|
Transfer-Freigabe und Kündi...
Bernd Wurst authored 8 years ago
|
185) // Block Domain löschen/kündigen
186)
187) $domain_in_use = mailman_subdomains($dom->id) || mail_in_use($dom->id) || web_in_use($dom->id) || $dom->jabber == 1;
188) if (!$domain_in_use && ($dom->status == 'prereg' || $dom->status == 'pretransfer' || $dom->status == 'transferfailed' || $dom->status == 'external')) {
189) output('<h4>Domain wieder entfernen</h4>');
190) output('<p class="delete">'.internal_link('save', 'Die Domain '.$dom->fqdn.' entfernen', 'action=delete&domain='.$dom->id).'</p>');
|
Biete kein Domain-Managemen...
Bernd Wurst authored 8 years ago
|
191) } elseif (have_role(ROLE_CUSTOMER) && config('http.net-apikey') && $dom->provider == 'terions' && (!$dom->cancel_date || ($dom->cancel_date > date('Y-m-d')))) {
|
Blende Aktionen aus, wenn d...
Bernd Wurst authored 8 years ago
|
192) require_once('domainapi.php');
|
Transfer-Freigabe und Kündi...
Bernd Wurst authored 8 years ago
|
193) output('<h4>Domain kündigen</h4>');
194) $info = api_download_domain($dom->id);
195) if ($info['authInfo']) {
196) output('<p>Das Auth-Info für diese Domain lautet: <strong>'.$info['authInfo'].'</strong></p>');
197) output('<p>Wenden Sie sich an den Support, wenn Sie den Domainumzug wieder sperren möchten.</p>');
198) } else {
199) output('<p>Hier können Sie die Domain zum Umzug freigeben.</p>');
200) $form = '<p><input type="hidden" name="domain" value="'.$dom->id.'"><input type="submit" name="submit" value="Die Domain '.$dom->fqdn.' zum Umzug freigeben"></p>';
201) output(html_form('domains_transfer', 'save', 'action=transfer', $form));
202) }
203) output('<p>Die aktuelle Laufzeit der Domain dauert noch bis '.$info['currentContractPeriodEnd'].'</p>');
204) if ($info['deletionDate']) {
205) 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>');
206) } else {
207) output('<p class="delete">'.internal_link('save', 'Die Domain '.$dom->fqdn.' kündigen', 'action=cancel&domain='.$dom->id).'</p>');
208) }
209) }
210)
211)
|
Alle Domain-Details auf ein...
Bernd Wurst authored 8 years ago
|
212) // Block Domain bestätigen
213)
|
Erste Vorbereitungen für Do...
Bernd Wurst authored 8 years ago
|
214) if ($dom->mailserver_lock == 1 && $dom->status != 'prereg') {
|
Alle Domain-Details auf ein...
Bernd Wurst authored 8 years ago
|
215) if (has_own_ns($dom->domainname, $dom->tld)) {
216) unset_mailserver_lock($dom);
217) success_msg("Die Domain {$dom->fqdn} wurde erfolgreich bestätigt und kann nun in vollem Umfang verwendet werden.");
218) redirect("");
219) }
220) output('<h3>Mailserver-Sperre aktiv</h3>
221) <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>');
222) if (!$dom->secret) {
223) create_domain_secret($dom);
224) }
225)
226) $TXT = get_txt_record('_schokokeks', $dom->domainname, $dom->tld);
227) if ($TXT == $dom->secret) {
228) unset_mailserver_lock($dom);
229) success_msg("Die Domain {$dom->fqdn} wurde erfolgreich bestätigt und kann nun in vollem Umfang verwendet werden.");
|
Lasse die API bestimmen was...
Bernd Wurst authored 8 years ago
|
230) redirect("");
|