a9a63251f38453583387b6159cdef665ed92ef2f
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 Lizenzinfos in eigenes Modu...

Bernd Wurst authored 10 years ago

5) Written 2008-2014 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 14 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 14 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 14 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 14 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 14 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 14 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 Warnung, wenn man bei einer...

Bernd Wurst authored 11 years ago

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

bernd authored 14 years ago

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

81) 
82) 
bernd DNs-record-Interface ist je...

bernd authored 14 years ago

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

bernd authored 15 years ago

84) 
85) $submit = 'Speichern';
86) if ($new) 
87)   $submit = 'Anlegen';
88) 
bernd DNs-record-Interface ist je...

bernd authored 14 years ago

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

bernd authored 14 years ago

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

bernd authored 14 years ago

105) if ($type == 'ptr' || $type == 'cname')
106) {
107)   $form .= '
108) <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

109) ';
110) }
111) 
112) if ($type == 'spf' || $type == 'txt')
113) {
114)   $form .= '
Hanno Böck fix 2 xss via txt record

Hanno Böck authored 9 years ago

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

116) ';
117) }
118) 
119) if ($type == 'sshfp')
120) {
Hanno Böck add ecdsa and ed25519 suppo...

Hanno Böck authored 9 years ago

121)   $algs = array(
122)     1 => "RSA",
123)     2 => "DSA",
124)     3 => "ECDSA",
125)     4 => "ED25519" );
126) 
127)   $option="";
128)   foreach ($algs as $key => $alg) {
129)     $option .= '<option value="'.$key.'" ';
130)     if ($key == $data['spec']) $option .= 'selected="selected"';
131)     $option .= '>'.$alg.' ('.$key.')</option>';
132)   }
133)  
bernd SSHFP-Records (Thanks to Ma...

bernd authored 12 years ago

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

Hanno Böck authored 9 years ago

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

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

137) ';
138) }
139) 
140) if ($dyndns)
141) {
142)   $form .= '
143) <tr><td><label for="dyndns">DynDNS-Zugang:</label></td><td>'.html_select('dyndns', $dyndns_accounts, $data['dyndns']).'</td></tr>
144) ';
145) }
146) 
147) if ($type == 'mx')
148) {
149)   $form .= '
150) <tr><td><label for="spec">Priorität:</label></td><td><input type="text" name="spec" id="spec" value="'.$data['spec'].'" /></td></tr>
151) <tr><td><label for="data">Posteingangsserver:</label></td><td><input type="text" name="data" id="data" value="'.$data['data'].'" /></td></tr>
152) ';
153) }
bernd git-svn-id: https://svn.sch...

bernd authored 15 years ago

154) 
155) 
bernd DNs-record-Interface ist je...

bernd authored 14 years ago

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

bernd authored 15 years ago

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

bernd authored 14 years ago

162) '));