9086c9ad77db90633e0629e9e86a88366265ded0
bernd Stub für dns-Admin-Interface

bernd authored 15 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) 
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

11) You should have received a copy of the CC0 Public Domain Dedication along with this software. If not, see
Bernd Wurst Added license tags for CC0,...

Bernd Wurst authored 12 years ago

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 Stub für dns-Admin-Interface

bernd authored 15 years ago

16) 
17) require_once('inc/base.php');
18) require_once('inc/debug.php');
19) global $debugmode;
20) require_once('inc/security.php');
21) 
bernd Erlaube *useraccounts* das...

bernd authored 13 years ago

22) require_role(ROLE_SYSTEMUSER);
bernd Stub für dns-Admin-Interface

bernd authored 15 years ago

23) 
24) require_once('dnsinclude.php');
25) 
26) $section = 'dns_dyndns';
27) 
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

28) $id = null;
29) if (isset($_REQUEST['id'])) {
30)     $id = (int) $_REQUEST['id'];
31) }
bernd Stub für dns-Admin-Interface

bernd authored 15 years ago

32) 
33) 
Bernd Wurst Warne, wenn bei den DNS-Ser...

Bernd Wurst authored 10 years ago

34) if (isset($_GET['type']) && $_GET['type'] == 'dyndns') {
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

35)     if ($_GET['action'] == 'delete') {
36)         $sure = user_is_sure();
37)         if ($sure === null) {
38)             are_you_sure("type=dyndns&action=delete&id={$id}", "Möchten Sie den DynDNS-Account wirklich löschen?");
39)         } elseif ($sure === true) {
40)             delete_dyndns_account($id);
41)             if (! $debugmode) {
42)                 header("Location: dyndns");
43)             }
44)         } elseif ($sure === false) {
45)             if (! $debugmode) {
46)                 header("Location: dyndns");
47)             }
48)         }
bernd Stub für dns-Admin-Interface

bernd authored 15 years ago

49)     }
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

50)     if ($_GET['action'] == 'edit') {
51)         check_form_token('dyndns_edit');
Hanno remove whitespace in empty...

Hanno authored 5 years ago

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

Hanno authored 5 years ago

53)         $newid = null;
54)         if ($id) {
55)             edit_dyndns_account($id, $_POST['handle'], $_POST['password_http'], $_POST['sshkey']);
56)         } else {
57)             $newid = create_dyndns_account($_POST['handle'], $_POST['password_http'], $_POST['sshkey']);
58)         }
Hanno remove whitespace in empty...

Hanno authored 5 years ago

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

Hanno authored 5 years ago

60)         if (! ($debugmode || we_have_an_error())) {
61)             if ($id) {
62)                 // Bearbeitung
63)                 header('Location: dyndns');
64)             } else {
65)                 // Neu angelegt
66)                 header('Location: dyndns_hostnames?id='.$newid);
67)             }
68)         }
Bernd Wurst Erzeuge nicht einen DynDNS-...

Bernd Wurst authored 7 years ago

69)     }
bernd Stub für dns-Admin-Interface

bernd authored 15 years ago

70) }
71) 
72) 
Bernd Wurst Warne, wenn bei den DNS-Ser...

Bernd Wurst authored 10 years ago

73) if (isset($_GET['dns']) && isset($_GET['dom'])) {
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

74)     $section = 'dns_dns';
75)     $domains = get_domain_list($_SESSION['customerinfo']['customerno'], $_SESSION['userinfo']['uid']);
76)     $dom = null;
77)     foreach ($domains as $d) {
78)         if ($d->id == $_GET['dom']) {
79)             $dom = $d;
80)             break;
81)         }
Bernd Wurst Warne, wenn bei den DNS-Ser...

Bernd Wurst authored 10 years ago

82)     }
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

83)     if (! $dom) {
84)         system_failure("Domain nicht gefunden!");
Bernd Wurst Warne, wenn bei den DNS-Ser...

Bernd Wurst authored 10 years ago

85)     }
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

86)     if ($_GET['dns'] == 0) {
87)         if ($dom->dns == 1) {
88)             $sure = user_is_sure();
89)             if ($sure === null) {
90)                 are_you_sure("dom={$dom->id}&dns=0", "Möchten Sie die Domain {$dom->fqdn} aus dem DNS-Server entfernen?");
91)             } elseif ($sure === true) {
92)                 remove_from_dns($dom->id);
93)                 redirect('dns');
94)             } elseif ($sure === false) {
95)                 redirect('dns');
96)             }
97)         } else {
98)             system_failure("Diese Domain ist nicht im DNS-Server eingetragen.");
99)         }
100)     }
101)     if ($_GET['dns'] == 1) {
102)         if ($dom->dns == 0) {
103)             add_to_dns($dom->id);
104)             redirect('dns');
105)         } else {
106)             system_failure("Diese Domain ist bereits im DNS-Server eingetragen.");
107)         }