c208bd906b3991555db11b9229846c4601ca408c
bernd git-svn-id: https://svn.sch...

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) 
5) Written 2008-2012 by schokokeks.org Hosting, namely
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 git-svn-id: https://svn.sch...

bernd authored 15 years ago

16) 
17) require_once('inc/base.php');
18) require_once('inc/security.php');
19) 
20) require_once('class/domain.php');
21) 
bernd Erlaube *useraccounts* das...

bernd authored 13 years ago

22) require_role(ROLE_SYSTEMUSER);
bernd git-svn-id: https://svn.sch...

bernd authored 15 years ago

23) 
24) require_once('dnsinclude.php');
25) 
26) $section = 'dns_dns';
27) 
28) $data = array();
29) $type = NULL;
30) 
bernd DNs-record-Interface ist je...

bernd authored 15 years ago

31) $dyndns = false;
32) $dyndns_accounts = array();
33) foreach (get_dyndns_accounts() AS $t)
34) {
35)   $dyndns_accounts[$t['id']] = $t['handle'];
36) }
37) 
bernd Autodns ein- und ausschaltb...

bernd authored 14 years ago

38) if (isset($_REQUEST['type']) && $_REQUEST['type'] == "dyndns")
bernd DNs-record-Interface ist je...

bernd authored 15 years ago

39) {
40)   $_REQUEST['type'] = 'a';
41)   $dyndns = true;
42) }
43) 
bernd git-svn-id: https://svn.sch...

bernd authored 15 years ago

44) $new = false;
45) if ($_REQUEST['id'] == 'new')
46) {
47)   $new = true;
48)   $data = blank_dns_record($_REQUEST['type']);
bernd DNs-record-Interface ist je...

bernd authored 15 years ago

49)   $domain = new Domain((int) $_REQUEST['domain']);
bernd Erlaube *useraccounts* das...

bernd authored 13 years ago

50)   $domain->ensure_userdomain();
bernd DNs-record-Interface ist je...

bernd authored 15 years ago

51)   $type = $_REQUEST['type'];
bernd git-svn-id: https://svn.sch...

bernd authored 15 years ago

52)   if (! in_array($type, $valid_record_types))
53)     system_failure('Ungültiger Record-Typ!');
54)   $data['domain'] = $domain->id;
bernd DNs-record-Interface ist je...

bernd authored 15 years ago

55)   if ($dyndns)
56)     $data['ttl'] = 120;
bernd git-svn-id: https://svn.sch...

bernd authored 15 years ago

57) }
58) 
59) if (! $new)
60) {
61)   $data = get_dns_record($_REQUEST['id']);
62)   $type = $data['type'];
bernd DNs-record-Interface ist je...

bernd authored 15 years ago

63)   $dyndns = isset($data['dyndns']);
64)   $domain = new Domain((int) $data['domain']);
bernd Erlaube *useraccounts* das...

bernd authored 13 years ago

65)   $domain->ensure_userdomain();
bernd git-svn-id: https://svn.sch...

bernd authored 15 years ago

66)   if (! in_array($type, $valid_record_types))
67)     system_failure('Ungültiger Record-Typ!');
68) }
69) 
70) 
71) if ($new)
bernd Benutze überall title() sta...

bernd authored 13 years ago

72)   title('DNS-Record erstellen');
bernd git-svn-id: https://svn.sch...

bernd authored 15 years ago

73) else
bernd Benutze überall title() sta...

bernd authored 13 years ago

74)   title('DNS-Record bearbeiten');
bernd git-svn-id: https://svn.sch...

bernd authored 15 years ago

75) 
bernd Diverse XML-Fehler behoben

bernd authored 14 years ago

76) output('<p style="border: 2px solid red; padding: 1em; padding-left: 4em;"><img src="'.$prefix.'images/warning.png" style="margin-left: -3em; float: left;" /><strong>Bitte beachten Sie:</strong> Um Ihnen auch ungewöhniche Konstellationen zu ermöglichen, erlaubt dieses Webinterface sehr großzügige Eintragungen, die eventuell nicht plausibel sind oder vom DNS-Server gar nicht so verstanden werden können. Wir können sicherheitskritische Einträge herausfiltern, jedoch nicht logische Fehler automatisch erkennen. Im Fehlerfall wird meistens Ihre gesamte Domain vom DNS-Server ausgeschlossen, so lange sich Fehler in der Konfiguration befinden. Sollten Sie hier also fehlerhafte Eintragungen machen, kann dies die Erreichbarkeit der betreffenden Domain im Ganzen stören.</p>');
bernd Prüfe, ob Domain wirklich d...

bernd authored 14 years ago

77) 
78) 
bernd DNs-record-Interface ist je...

bernd authored 15 years ago

79) output('<p>Record-Typ: '.strtoupper($type).'</p>');
bernd git-svn-id: https://svn.sch...

bernd authored 15 years ago

80) 
81) $submit = 'Speichern';
82) if ($new) 
83)   $submit = 'Anlegen';
84) 
bernd DNs-record-Interface ist je...

bernd authored 15 years ago

85) $form = '';
86) 
87) if (! $dyndns && ($type == 'a' || $type == 'aaaa'))
88) {
89)   $form .= '
90) <tr><td><label for="ip">IP-Adresse:</label></td><td><input type="text" name="ip" id="ip" value="'.$data['ip'].'" /></td></tr>
91) ';
92) }
93) 
bernd Autodns ein- und ausschaltb...

bernd authored 14 years ago

94) if ($type == 'ns')
95) {
96)   $form .= '
97) <tr><td><label for="data">DNS-Server:</label></td><td><input type="text" name="data" id="data" value="'.$data['data'].'" /></td></tr>
98) ';
99) }
100) 
bernd DNs-record-Interface ist je...

bernd authored 15 years ago

101) if ($type == 'ptr' || $type == 'cname')
102) {
103)   $form .= '
104) <tr><td><label for="data">Ziel:</label></td><td><input type="text" name="data" id="data" value="'.$data['data'].'" /></td></tr>
bernd SPF und TXT records

bernd authored 14 years ago

105) ';
106) }
107) 
108) if ($type == 'spf' || $type == 'txt')
109) {
110)   $form .= '
111) <tr><td><label for="data">Inhalt:</label></td><td><input type="text" name="data" id="data" value="'.$data['data'].'" /></td></tr>
bernd SSHFP-Records (Thanks to Ma...

bernd authored 12 years ago

112) ';
113) }
114) 
115) if ($type == 'sshfp')
116) {
117)   $rsadefault = ($data['spec'] == 1) ? ' selected="selected"' : '';
118)   $dsadefault = ($data['spec'] == 2) ? ' selected="selected"' : '';
119)   $form .= '
120) <tr><td><label for="spec">Algorithmus:</label></td><td><select name="spec" id="spec"><option value="1"'.$rsadefault.'>RSA (1)</option><option value="2"'.$dsadefault.'>DSS (2)</option></select></td></tr>
121) <tr><td><label for="data">Fingerabdruck:</label></td><td><input type="text" name="data" id="data" value="'.$data['data'].'" /></td></tr>
bernd DNs-record-Interface ist je...

bernd authored 15 years ago

122) ';
123) }
124) 
125) if ($dyndns)
126) {
127)   $form .= '
128) <tr><td><label for="dyndns">DynDNS-Zugang:</label></td><td>'.html_select('dyndns', $dyndns_accounts, $data['dyndns']).'</td></tr>
129) ';
130) }
131) 
132) if ($type == 'mx')
133) {
134)   $form .= '
135) <tr><td><label for="spec">Priorität:</label></td><td><input type="text" name="spec" id="spec" value="'.$data['spec'].'" /></td></tr>
136) <tr><td><label for="data">Posteingangsserver:</label></td><td><input type="text" name="data" id="data" value="'.$data['data'].'" /></td></tr>
137) ';
138) }
bernd git-svn-id: https://svn.sch...

bernd authored 15 years ago

139) 
140) 
bernd DNs-record-Interface ist je...

bernd authored 15 years ago

141) output(html_form('dns_record_edit', 'dns_record_save', "type={$type}&domain={$domain->id}&id={$_REQUEST['id']}", '<table>
142) <tr><td><label for="hostname">Hostname:</label></td><td><input type="text" name="hostname" id="hostname" value="'.$data['hostname'].'" />&#160;<strong>.'.$domain->fqdn.'</strong></td></tr>
143) '.$form.'
144) <tr><td><label for="ttl">TTL:</label></td><td><input type="text" name="ttl" id="ttl" value="'.$data['ttl'].'" /></td></tr>
145) </table>
bernd git-svn-id: https://svn.sch...

bernd authored 15 years ago

146) <p><input type="submit" value="'.$submit.'" /></p>
bernd Einige Dummheiten repariert...

bernd authored 14 years ago

147) '));