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

Hanno Böck authored 1 year 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 1 year 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 Stub für dns-Admin-Interface

bernd authored 15 years ago

13) 
14) require_once('inc/base.php');
15) require_once('inc/debug.php');
16) global $debugmode;
17) require_once('inc/security.php');
18) 
bernd Erlaube *useraccounts* das...

bernd authored 14 years ago

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

bernd authored 15 years ago

20) 
21) require_once('dnsinclude.php');
22) 
23) $section = 'dns_dyndns';
24) 
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

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

bernd authored 15 years ago

29) 
30) 
Bernd Wurst Warne, wenn bei den DNS-Ser...

Bernd Wurst authored 10 years ago

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

Hanno authored 5 years ago

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

bernd authored 15 years ago

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

Hanno authored 5 years ago

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

Hanno authored 5 years ago

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

Hanno authored 5 years ago

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

Hanno authored 5 years ago

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

Hanno authored 5 years ago

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

Bernd Wurst authored 7 years ago

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

bernd authored 15 years ago

67) }
68) 
69) 
Bernd Wurst Warne, wenn bei den DNS-Ser...

Bernd Wurst authored 10 years ago

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

Hanno authored 5 years ago

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

Bernd Wurst authored 10 years ago

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

Hanno authored 5 years ago

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