ce4c0c440a4d2a904f24d6edd8828c76f9330889
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 14 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) }
Bernd Wurst IPv6-support für DynDNS

Bernd Wurst authored 6 years ago

43) if (isset($_REQUEST['type']) && $_REQUEST['type'] == "dyndns_aaaa")
44) {
45)   $_REQUEST['type'] = 'aaaa';
46)   $dyndns = true;
47) }
48) 
bernd DNs-record-Interface ist je...

bernd authored 15 years ago

49) 
bernd git-svn-id: https://svn.sch...

bernd authored 15 years ago

50) $new = false;
51) if ($_REQUEST['id'] == 'new')
52) {
53)   $new = true;
54)   $data = blank_dns_record($_REQUEST['type']);
bernd DNs-record-Interface ist je...

bernd authored 15 years ago

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

bernd authored 14 years ago

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

bernd authored 15 years ago

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

bernd authored 15 years ago

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

bernd authored 15 years ago

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

bernd authored 15 years ago

63) }
64) 
65) if (! $new)
66) {
67)   $data = get_dns_record($_REQUEST['id']);
68)   $type = $data['type'];
bernd DNs-record-Interface ist je...

bernd authored 15 years ago

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

bernd authored 14 years ago

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

bernd authored 15 years ago

72)   if (! in_array($type, $valid_record_types))
73)     system_failure('Ungültiger Record-Typ!');
74) }
75) 
76) 
77) if ($new)
bernd Benutze überall title() sta...

bernd authored 13 years ago

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

bernd authored 15 years ago

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

bernd authored 13 years ago

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

bernd authored 15 years ago

81) 
Bernd Wurst Text für Autorecords geände...

Bernd Wurst authored 6 years ago

82) if (strtoupper($type) == 'NS') {
83)   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>');
84) }
85) 
Bernd Wurst Warnung, wenn man bei einer...

Bernd Wurst authored 11 years ago

86) if (strtoupper($type) == 'MX' && domain_is_maildomain($domain->id)) {
87)   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>');
88) }
89) 
bernd Diverse XML-Fehler behoben

bernd authored 14 years ago

90) 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 15 years ago

91) 
92) 
bernd DNs-record-Interface ist je...

bernd authored 15 years ago

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

bernd authored 15 years ago

94) 
95) $submit = 'Speichern';
96) if ($new) 
97)   $submit = 'Anlegen';
98) 
bernd DNs-record-Interface ist je...

bernd authored 15 years ago

99) $form = '';
100) 
101) if (! $dyndns && ($type == 'a' || $type == 'aaaa'))
102) {
103)   $form .= '
104) <tr><td><label for="ip">IP-Adresse:</label></td><td><input type="text" name="ip" id="ip" value="'.$data['ip'].'" /></td></tr>
105) ';
106) }
107) 
bernd Autodns ein- und ausschaltb...

bernd authored 14 years ago

108) if ($type == 'ns')
109) {
110)   $form .= '
111) <tr><td><label for="data">DNS-Server:</label></td><td><input type="text" name="data" id="data" value="'.$data['data'].'" /></td></tr>
112) ';
113) }
114) 
bernd DNs-record-Interface ist je...

bernd authored 15 years ago

115) if ($type == 'ptr' || $type == 'cname')
116) {
117)   $form .= '
118) <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

119) ';
120) }
121) 
122) if ($type == 'spf' || $type == 'txt')
123) {
124)   $form .= '
Hanno Böck fix 2 xss via txt record

Hanno Böck authored 9 years ago

125) <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 13 years ago

126) ';
127) }
128) 
129) if ($type == 'sshfp')
130) {
Hanno Böck add ecdsa and ed25519 suppo...

Hanno Böck authored 9 years ago

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

Hanno Böck authored 7 years ago

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

bernd authored 13 years ago

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

Hanno Böck authored 9 years ago

145) <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 13 years ago

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

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

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

bernd authored 15 years ago

178) 
179) 
bernd DNs-record-Interface ist je...

bernd authored 15 years ago

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

bernd authored 15 years ago

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

bernd authored 15 years ago

186) '));