5cfbf6a682852c327133c5f8a38724d2ccab6499
Bernd Wurst Transfer-Freigabe und Kündi...

Bernd Wurst authored 6 years ago

1) <?php
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 1 year ago

5) Written by schokokeks.org Hosting, namely
Bernd Wurst Transfer-Freigabe und Kündi...

Bernd Wurst authored 6 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 1 year ago

9) This code is published under a 0BSD license.
Bernd Wurst Transfer-Freigabe und Kündi...

Bernd Wurst authored 6 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) */
13) 
14) require_once("class/domain.php");
15) require_once("domains.php");
16) require_once("domainapi.php");
17) require_role(ROLE_CUSTOMER);
18) 
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

19) $dom = new Domain((int) $_REQUEST['domain']);
Bernd Wurst Transfer-Freigabe und Kündi...

Bernd Wurst authored 6 years ago

20) $dom->ensure_customerdomain();
21) 
22) $domain_in_use = mailman_subdomains($dom->id) || mail_in_use($dom->id) || web_in_use($dom->id) || $dom->jabber == 1;
23) if ($_REQUEST['action'] == 'delete') {
24)     if ($domain_in_use || !($dom->status == 'prereg' || $dom->status == 'pretransfer' || $dom->status == 'transferfailed' || $dom->status == 'external')) {
25)         system_failure("Diese Domain ist noch in Benutzung. Bitte Postfächer und Websites löschen sowie Eintragungen in Mailinglisten oder Jabber-Server löschen lassen.");
26)     }
27)     $sure = user_is_sure();
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

28)     if ($sure === null) {
Bernd Wurst Transfer-Freigabe und Kündi...

Bernd Wurst authored 6 years ago

29)         are_you_sure("action=delete&domain={$dom->id}", "Möchten Sie die Domain »{$dom->fqdn}« wirklich löschen?");
30)     } elseif ($sure === true) {
31)         delete_domain($dom->id);
32)         redirect('domains');
33)     } elseif ($sure === false) {
34)         redirect('detail?id='.$dom->id);
35)     }
36) } elseif ($_REQUEST['action'] == 'cancel') {
37)     $info = api_download_domain($dom->id);
38)     $sure = user_is_sure();
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

39)     if ($sure === null) {
Bernd Wurst Formulierung für Domainkünd...

Bernd Wurst authored 5 years ago

40)         are_you_sure("action=cancel&domain={$dom->id}", "Möchten Sie die Domain »{$dom->fqdn}« wirklich kündigen?<br>Wichtig: Bei einem Umzug ist keine separate Kündigung nötig. Bitte kündigen Sie nur, wenn Sie die Domain löschen und freigeben möchten.<br>Das Kündigungsdatum wäre dann {$info['currentContractPeriodEnd']}");
Bernd Wurst Transfer-Freigabe und Kündi...

Bernd Wurst authored 6 years ago

41)     } elseif ($sure === true) {
42)         api_cancel_domain($dom->fqdn);
43)         redirect('detail?id='.$dom->id);
44)     } elseif ($sure === false) {
45)         redirect('detail?id='.$dom->id);
46)     }
47) } elseif ($_REQUEST['action'] == 'transfer') {
48)     check_form_token('domains_transfer');
49)     api_unlock_domain($dom->fqdn);
50)     redirect('detail?id='.$dom->id);
Bernd Wurst Funktion zum Löschen einer...

Bernd Wurst authored 4 years ago

51) } elseif ($_REQUEST['action'] == 'nomailman') {
52)     if (have_module('mailman')) {
53)         use_module('mailman');
54)         include('mailman.php');
55)         if (count(lists_on_domain($dom->id)) > 0) {
56)             system_failure("Es gibt noch Mailinglisten auf dieser Domain, daher kann sie nicht gelöscht werden");
57)         }
58)         $sure = user_is_sure();
59)         if ($sure === null) {
60)             are_you_sure("action=nomailman&domain={$dom->id}", "Möchten Sie die Domain »{$dom->fqdn}« wirklich aus der Mailinglisten-Konfiguration entfernen?");
61)         } elseif ($sure === true) {
62)             delete_mailman_domain($dom->id);
63)             redirect('detail?id='.$dom->id);
64)         } elseif ($sure === false) {
65)             redirect('detail?id='.$dom->id);
66)         }
67)     } else {
68)         system_failure('Das Mailman-Modul ist nicht verfügbar');
69)     }
Bernd Wurst allow conversion of transfe...

Bernd Wurst authored 1 year ago

70) } elseif ($_REQUEST['action'] == 'convertexternal') {
71)     check_form_token('domains_convertexternal');
72)     convert_domain_to_external($dom->id);
73)     redirect('detail?id='.$dom->id);