3ef995c2108fe77d22c0b556fb9717cb848bc48f
bernd Stub für dns-Admin-Interface

bernd authored 16 years ago

1) <?php
Hanno Böck Add newlines before comment...

Hanno Böck authored 1 week ago

2) 
Bernd Wurst Added license tags for CC0,...

Bernd Wurst authored 13 years ago

3) /*
4) This file belongs to the Webinterface of schokokeks.org Hosting
5) 
Hanno Böck Change license from CC0 to...

Hanno Böck authored 2 years ago

6) Written by schokokeks.org Hosting, namely
Bernd Wurst Added license tags for CC0,...

Bernd Wurst authored 13 years ago

7)   Bernd Wurst <bernd@schokokeks.org>
8)   Hanno Böck <hanno@schokokeks.org>
9) 
Hanno Böck Change license from CC0 to...

Hanno Böck authored 2 years ago

10) This code is published under a 0BSD license.
Bernd Wurst Added license tags for CC0,...

Bernd Wurst authored 13 years ago

11) 
12) 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.
13) */
bernd Stub für dns-Admin-Interface

bernd authored 16 years ago

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

bernd authored 14 years ago

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

bernd authored 16 years ago

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

Hanno authored 6 years ago

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

bernd authored 16 years ago

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

Bernd Wurst authored 10 years ago

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

Hanno authored 6 years ago

33)     if ($_GET['action'] == 'delete') {
34)         $sure = user_is_sure();
35)         if ($sure === null) {
36)             are_you_sure("type=dyndns&action=delete&id={$id}", "Möchten Sie den DynDNS-Account wirklich löschen?");
37)         } elseif ($sure === true) {
38)             delete_dyndns_account($id);
Hanno Böck Fix not operator (!) spaces

Hanno Böck authored 1 year ago

39)             if (!$debugmode) {
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

40)                 header("Location: dyndns");
41)             }
42)         } elseif ($sure === false) {
Hanno Böck Fix not operator (!) spaces

Hanno Böck authored 1 year ago

43)             if (!$debugmode) {
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

44)                 header("Location: dyndns");
45)             }
46)         }
bernd Stub für dns-Admin-Interface

bernd authored 16 years ago

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

Hanno authored 6 years ago

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

Hanno authored 6 years ago

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

Hanno authored 6 years ago

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

Hanno authored 6 years ago

57) 
Hanno Böck Fix not operator (!) spaces

Hanno Böck authored 1 year ago

58)         if (!($debugmode || we_have_an_error())) {
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

59)             if ($id) {
60)                 // Bearbeitung
61)                 header('Location: dyndns');
62)             } else {
63)                 // Neu angelegt
Hanno Böck Spaces between string conca...

Hanno Böck authored 1 year ago

64)                 header('Location: dyndns_hostnames?id=' . $newid);
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

65)             }
66)         }
Bernd Wurst Erzeuge nicht einen DynDNS-...

Bernd Wurst authored 8 years ago

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

bernd authored 16 years ago

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

Bernd Wurst authored 10 years ago

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

Hanno authored 6 years ago

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

Bernd Wurst authored 10 years ago

80)     }
Hanno Böck Fix not operator (!) spaces

Hanno Böck authored 1 year ago

81)     if (!$dom) {
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

82)         system_failure("Domain nicht gefunden!");
Bernd Wurst Warne, wenn bei den DNS-Ser...

Bernd Wurst authored 10 years ago

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

Hanno authored 6 years ago

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