cf54502a10b16c985ea28db17885d377226b6145
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) 
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) */
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) 
28) $id = NULL;
bernd Warnings eliminiert und Plu...

bernd authored 14 years ago

29) if (isset($_REQUEST['id']))
bernd Stub für dns-Admin-Interface

bernd authored 15 years ago

30)   $id = (int) $_REQUEST['id'];
31) 
32) 
Bernd Wurst Warne, wenn bei den DNS-Ser...

Bernd Wurst authored 10 years ago

33) if (isset($_GET['type']) && $_GET['type'] == 'dyndns') {
bernd Stub für dns-Admin-Interface

bernd authored 15 years ago

34)   if ($_GET['action'] == 'delete') {
35)     $sure = user_is_sure();
36)     if ($sure === NULL)
37)     {
bernd * alle internen Links sinnv...

bernd authored 15 years ago

38)       are_you_sure("type=dyndns&action=delete&id={$id}", "Möchten Sie den DynDNS-Account wirklich löschen?");
bernd Stub für dns-Admin-Interface

bernd authored 15 years ago

39)     }
40)     elseif ($sure === true)
41)     {
42)       delete_dyndns_account($id);
43)       if (! $debugmode)
bernd eliminate .php extensions f...

bernd authored 15 years ago

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

bernd authored 15 years ago

45)     }
46)     elseif ($sure === false)
47)     {
48)       if (! $debugmode)
bernd eliminate .php extensions f...

bernd authored 15 years ago

49)         header("Location: dyndns");
bernd Stub für dns-Admin-Interface

bernd authored 15 years ago

50)     }
51)   }
52)   if ($_GET['action'] == 'edit') {
53)     check_form_token('dyndns_edit');
Bernd Wurst Erzeuge nicht einen DynDNS-...

Bernd Wurst authored 7 years ago

54)       
55)     $newid = NULL;
bernd Stub für dns-Admin-Interface

bernd authored 15 years ago

56)     if ($id) {
57)       edit_dyndns_account($id, $_POST['handle'], $_POST['password_http'], $_POST['sshkey']);
58)     } else {
Bernd Wurst Erzeuge nicht einen DynDNS-...

Bernd Wurst authored 7 years ago

59)       $newid = create_dyndns_account($_POST['handle'], $_POST['password_http'], $_POST['sshkey']);
bernd Stub für dns-Admin-Interface

bernd authored 15 years ago

60)     }
61)   
Bernd Wurst Erzeuge nicht einen DynDNS-...

Bernd Wurst authored 7 years ago

62)     if (! ($debugmode || we_have_an_error())) {
63)       if ($id) { 
64)         // Bearbeitung
65)         header('Location: dyndns');
66)       } else {
67)         // Neu angelegt
68)         header('Location: dyndns_hostnames?id='.$newid);
69)       }
70)     }
bernd Stub für dns-Admin-Interface

bernd authored 15 years ago

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

Bernd Wurst authored 10 years ago

75) if (isset($_GET['dns']) && isset($_GET['dom'])) {
76)   $section = 'dns_dns';
77)   $domains = get_domain_list($_SESSION['customerinfo']['customerno'], $_SESSION['userinfo']['uid']);
78)   $dom = NULL;
79)   foreach ($domains as $d) {
80)     if ($d->id == $_GET['dom']) {
81)       $dom = $d;
82)       break;
83)     }
84)   }
85)   if (! $dom) {
86)     system_failure("Domain nicht gefunden!");
87)   }
88)   if ($_GET['dns'] == 0) {
89)     if ($dom->dns == 1) {
90)       $sure = user_is_sure();
91)       if ($sure === NULL)
92)       {
93)         are_you_sure("dom={$dom->id}&dns=0", "Möchten Sie die Domain {$dom->fqdn} aus dem DNS-Server entfernen?");
94)       }
95)       elseif ($sure === true)
96)       {
97)         remove_from_dns($dom->id);
98)         redirect('dns');
99)       }
100)       elseif ($sure === false)
101)       {
102)         redirect('dns');
103)       }      
104)     } else {
105)       system_failure("Diese Domain ist nicht im DNS-Server eingetragen.");
106)     }
107)   }
108)   if ($_GET['dns'] == 1) {
109)     if ($dom->dns == 0) {
110)       add_to_dns($dom->id);
111)       redirect('dns');
112)     } else {
113)       system_failure("Diese Domain ist bereits im DNS-Server eingetragen.");
114)     }
115)   }
116)   
117) }
118)