9086c9ad77db90633e0629e9e86a88366265ded0
bernd DNs-record-Interface ist je...

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 6 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 DNs-record-Interface ist je...

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 14 years ago

22) require_role(ROLE_SYSTEMUSER);
bernd DNs-record-Interface ist je...

bernd authored 15 years ago

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

Hanno authored 6 years ago

29) $record = null;
bernd DNs-record-Interface ist je...

bernd authored 15 years ago

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

Hanno authored 6 years ago

31) $id = null;
32) if ($_REQUEST['id'] == 'new') {
33)     $record = blank_dns_record($_REQUEST['type']);
34) } else {
35)     $id = (int) $_REQUEST['id'];
36)     $record = get_dns_record($id);
bernd DNs-record-Interface ist je...

bernd authored 15 years ago

37) }
38) 
39) 
bernd SPF und TXT records

bernd authored 15 years ago

40) if (isset($_GET['action']) && ($_GET['action'] == 'delete')) {
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

41)     $sure = user_is_sure();
42)     if ($sure === null) {
43)         $domain = new Domain((int) $record['domain']);
44)         $fqdn = $domain->fqdn;
45)         if ($record['hostname']) {
46)             $fqdn = $record['hostname'].'.'.$fqdn;
47)         }
48)         are_you_sure("action=delete&id={$id}", "Möchten Sie den ".strtoupper($record['type'])."-Record für ".$fqdn." wirklich löschen?");
49)     } elseif ($sure === true) {
50)         delete_dns_record($id);
51)         if (! $debugmode) {
52)             header("Location: dns_domain?dom=".$record['domain']);
53)         }
54)     } elseif ($sure === false) {
55)         if (! $debugmode) {
56)             header("Location: dns_domain?dom=".$record['domain']);
57)         }
bernd DNs-record-Interface ist je...

bernd authored 15 years ago

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

Hanno authored 6 years ago

59) } else {
60)     // Sicherheitsprüfungen passieren im Backend
Hanno remove whitespace in empty...

Hanno authored 6 years ago

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

Hanno authored 6 years ago

62)     $record['hostname'] = $_REQUEST['hostname'];
63)     $record['domain'] = (int) $_REQUEST['domain'];
64)     $record['ip'] = (isset($_REQUEST['ip']) ? $_REQUEST['ip'] : null);
65)     $record['data'] = (isset($_REQUEST['data']) ? $_REQUEST['data'] : null);
66)     $record['dyndns'] = (isset($_REQUEST['dyndns']) ? (int) $_REQUEST['dyndns'] : null);
67)     $record['spec'] = (isset($_REQUEST['spec']) ? (int) $_REQUEST['spec'] : null);
68)     $record['ttl'] = (int) $_REQUEST['ttl'];
Hanno remove whitespace in empty...

Hanno authored 6 years ago

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

Hanno authored 6 years ago

70)     save_dns_record($id, $record);
bernd DNs-record-Interface ist je...

bernd authored 15 years ago

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

Hanno authored 6 years ago

72)     if (!$debugmode) {
73)         header('Location: dns_domain?dom='.$record['domain']);
74)     }