d9cce25da0a9c39c1f15af87fd131db01c548b82
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) 
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 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 Wurst Text für Autorecords geände...

Bernd Wurst authored 6 years ago

76) if (strtoupper($type) == 'NS') {
77)   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> Das Ändern der DNS-Server für die Stammdomain wird nicht funktionieren. Bitte geben Sie unbedingt einen Hostname ein um eine Subdomain auf einen anderen DNS-Server zu delegieren.</p>');
78) }
79) 
Bernd Wurst Warnung, wenn man bei einer...

Bernd Wurst authored 11 years ago

80) if (strtoupper($type) == 'MX' && domain_is_maildomain($domain->id)) {
81)   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> Wenn Sie die Mail-Verarbeitung auf Servern von '.$config['company_name'].' nicht nutzen möchten, sollten Sie <a href="'.$prefix.'go/email/domains">die lokale Mail-Verarbeitung für diese Domain ausschalten</a>.</p>');
82) }
83) 
bernd Diverse XML-Fehler behoben

bernd authored 14 years ago

84) 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

85) 
86) 
bernd DNs-record-Interface ist je...

bernd authored 15 years ago

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

bernd authored 15 years ago

88) 
89) $submit = 'Speichern';
90) if ($new) 
91)   $submit = 'Anlegen';
92) 
bernd DNs-record-Interface ist je...

bernd authored 15 years ago

93) $form = '';
94) 
95) if (! $dyndns && ($type == 'a' || $type == 'aaaa'))
96) {
97)   $form .= '
98) <tr><td><label for="ip">IP-Adresse:</label></td><td><input type="text" name="ip" id="ip" value="'.$data['ip'].'" /></td></tr>
99) ';
100) }
101) 
bernd Autodns ein- und ausschaltb...

bernd authored 14 years ago

102) if ($type == 'ns')
103) {
104)   $form .= '
105) <tr><td><label for="data">DNS-Server:</label></td><td><input type="text" name="data" id="data" value="'.$data['data'].'" /></td></tr>
106) ';
107) }
108) 
bernd DNs-record-Interface ist je...

bernd authored 15 years ago

109) if ($type == 'ptr' || $type == 'cname')
110) {
111)   $form .= '
112) <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

113) ';
114) }
115) 
116) if ($type == 'spf' || $type == 'txt')
117) {
118)   $form .= '
Hanno Böck fix 2 xss via txt record

Hanno Böck authored 9 years ago

119) <tr><td><label for="data">Inhalt:</label></td><td><input type="text" name="data" id="data" value="'.filter_input_general($data['data']).'" /></td></tr>
bernd SSHFP-Records (Thanks to Ma...

bernd authored 12 years ago

120) ';
121) }
122) 
123) if ($type == 'sshfp')
124) {
Hanno Böck add ecdsa and ed25519 suppo...

Hanno Böck authored 9 years ago

125)   $algs = array(
126)     1 => "RSA",
127)     2 => "DSA",
128)     3 => "ECDSA",
129)     4 => "ED25519" );
130) 
131)   $option="";
132)   foreach ($algs as $key => $alg) {
133)     $option .= '<option value="'.$key.'" ';
134)     if ($key == $data['spec']) $option .= 'selected="selected"';
135)     $option .= '>'.$alg.' ('.$key.')</option>';
136)   }
Hanno Böck add caa support

Hanno Böck authored 7 years ago

137) 
bernd SSHFP-Records (Thanks to Ma...

bernd authored 12 years ago

138)   $form .= '
Hanno Böck add ecdsa and ed25519 suppo...

Hanno Böck authored 9 years ago

139) <tr><td><label for="spec">Algorithmus:</label></td><td><select name="spec" id="spec">'.$option.'</select></td></tr>
bernd SSHFP-Records (Thanks to Ma...

bernd authored 12 years ago

140) <tr><td><label for="data">Fingerabdruck:</label></td><td><input type="text" name="data" id="data" value="'.$data['data'].'" /></td></tr>
Hanno Böck add caa support

Hanno Böck authored 7 years ago

141) ';
142) }
143) 
144) if ($type == 'caa')
145) {
146)   $option="";
147)   foreach ($caa_properties as $key => $property) {
148)     $option .= '<option value="'.$key.'" ';
149)     if ($key == $data['spec']) $option .= 'selected="selected"';
150)     $option .= '>'.$property.' ('.$key.')</option>';
151)   }
152)   $form .= '
153) <tr><td><label for="spec">Property tag:</label></td><td><select name="spec" id="spec">'.$option.'</select></td></tr>
154) <tr><td><label for="data">Inhalt:</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

155) ';
156) }
157) 
158) if ($dyndns)
159) {
160)   $form .= '
161) <tr><td><label for="dyndns">DynDNS-Zugang:</label></td><td>'.html_select('dyndns', $dyndns_accounts, $data['dyndns']).'</td></tr>
162) ';
163) }
164) 
165) if ($type == 'mx')
166) {
167)   $form .= '
168) <tr><td><label for="spec">Priorität:</label></td><td><input type="text" name="spec" id="spec" value="'.$data['spec'].'" /></td></tr>
169) <tr><td><label for="data">Posteingangsserver:</label></td><td><input type="text" name="data" id="data" value="'.$data['data'].'" /></td></tr>
170) ';
171) }
bernd git-svn-id: https://svn.sch...

bernd authored 15 years ago

172) 
173) 
bernd DNs-record-Interface ist je...

bernd authored 15 years ago

174) output(html_form('dns_record_edit', 'dns_record_save', "type={$type}&domain={$domain->id}&id={$_REQUEST['id']}", '<table>
175) <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>
176) '.$form.'
177) <tr><td><label for="ttl">TTL:</label></td><td><input type="text" name="ttl" id="ttl" value="'.$data['ttl'].'" /></td></tr>
178) </table>
bernd git-svn-id: https://svn.sch...

bernd authored 15 years ago

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

bernd authored 14 years ago

180) '));