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

Hanno Böck authored 2 years 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 2 years 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 DNs-record-Interface ist je...

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

bernd authored 15 years ago

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

Hanno authored 6 years ago

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

bernd authored 15 years ago

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

Hanno authored 6 years ago

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

bernd authored 15 years ago

34) }
35) 
36) 
bernd SPF und TXT records

bernd authored 15 years ago

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

Hanno authored 6 years ago

38)     $sure = user_is_sure();
39)     if ($sure === null) {
40)         $domain = new Domain((int) $record['domain']);
41)         $fqdn = $domain->fqdn;
42)         if ($record['hostname']) {
43)             $fqdn = $record['hostname'].'.'.$fqdn;
44)         }
45)         are_you_sure("action=delete&id={$id}", "Möchten Sie den ".strtoupper($record['type'])."-Record für ".$fqdn." wirklich löschen?");
46)     } elseif ($sure === true) {
47)         delete_dns_record($id);
Hanno Böck Fix not operator (!) spaces

Hanno Böck authored 1 year ago

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

Hanno authored 6 years ago

49)             header("Location: dns_domain?dom=".$record['domain']);
50)         }
51)     } elseif ($sure === false) {
Hanno Böck Fix not operator (!) spaces

Hanno Böck authored 1 year ago

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

Hanno authored 6 years ago

53)             header("Location: dns_domain?dom=".$record['domain']);
54)         }
bernd DNs-record-Interface ist je...

bernd authored 15 years ago

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

Hanno authored 6 years ago

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

Hanno authored 6 years ago

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

Hanno authored 6 years ago

59)     $record['hostname'] = $_REQUEST['hostname'];
60)     $record['domain'] = (int) $_REQUEST['domain'];
Hanno Böck Codingstyle PSR12 + array s...

Hanno Böck authored 3 years ago

61)     $record['ip'] = ($_REQUEST['ip'] ?? null);
62)     $record['data'] = ($_REQUEST['data'] ?? null);
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

63)     $record['dyndns'] = (isset($_REQUEST['dyndns']) ? (int) $_REQUEST['dyndns'] : null);
64)     $record['spec'] = (isset($_REQUEST['spec']) ? (int) $_REQUEST['spec'] : null);
65)     $record['ttl'] = (int) $_REQUEST['ttl'];
Hanno remove whitespace in empty...

Hanno authored 6 years ago

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

Hanno authored 6 years ago

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

bernd authored 15 years ago

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

Hanno authored 6 years ago

69)     if (!$debugmode) {
70)         header('Location: dns_domain?dom='.$record['domain']);
71)     }