8eb67e000e8075d99163e3354d159ce1b556efdc
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 Lizenzinfos in eigenes Modu...

Bernd Wurst authored 10 years ago

5) Written 2008-2014 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');
54)     
55)     if ($id) {
56)       edit_dyndns_account($id, $_POST['handle'], $_POST['password_http'], $_POST['sshkey']);
57)     } else {
58)       create_dyndns_account($_POST['handle'], $_POST['password_http'], $_POST['sshkey']);
59)     }
60)   
61)     if (! ($debugmode || we_have_an_error()))
bernd eliminate .php extensions f...

bernd authored 15 years ago

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

bernd authored 15 years ago

63)   }
64) }
65) 
66) 
Bernd Wurst Warne, wenn bei den DNS-Ser...

Bernd Wurst authored 10 years ago

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