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

bernd authored 16 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 git-svn-id: https://svn.sch...

bernd authored 16 years ago

13) 
14) require_once('inc/base.php');
15) require_once('inc/security.php');
16) 
17) require_once('class/domain.php');
18) 
bernd Erlaube *useraccounts* das...

bernd authored 14 years ago

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

bernd authored 16 years ago

20) 
21) require_once('dnsinclude.php');
22) 
23) $section = 'dns_dns';
24) 
Hanno Böck Codingstyle PSR12 + array s...

Hanno Böck authored 3 years ago

25) $data = [];
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

26) $type = null;
bernd git-svn-id: https://svn.sch...

bernd authored 16 years ago

27) 
bernd DNs-record-Interface ist je...

bernd authored 15 years ago

28) $dyndns = false;
Hanno Böck Codingstyle PSR12 + array s...

Hanno Böck authored 3 years ago

29) $dyndns_accounts = [];
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

30) foreach (get_dyndns_accounts() as $t) {
31)     $dyndns_accounts[$t['id']] = $t['handle'];
bernd DNs-record-Interface ist je...

bernd authored 15 years ago

32) }
33) 
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

34) if (isset($_REQUEST['type']) && $_REQUEST['type'] == "dyndns") {
35)     $_REQUEST['type'] = 'a';
36)     $dyndns = true;
bernd DNs-record-Interface ist je...

bernd authored 15 years ago

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

Hanno authored 6 years ago

38) if (isset($_REQUEST['type']) && $_REQUEST['type'] == "dyndns_aaaa") {
39)     $_REQUEST['type'] = 'aaaa';
40)     $dyndns = true;
Bernd Wurst IPv6-support für DynDNS

Bernd Wurst authored 6 years ago

41) }
42) 
bernd DNs-record-Interface ist je...

bernd authored 15 years ago

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

bernd authored 16 years ago

44) $new = false;
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

45) if ($_REQUEST['id'] == 'new') {
46)     $new = true;
47)     $data = blank_dns_record($_REQUEST['type']);
48)     $domain = new Domain((int) $_REQUEST['domain']);
49)     $domain->ensure_userdomain();
50)     $type = $_REQUEST['type'];
Hanno Böck Fix not operator (!) spaces

Hanno Böck authored 1 year ago

51)     if (!in_array($type, $valid_record_types)) {
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

52)         system_failure('Ungültiger Record-Typ!');
53)     }
54)     $data['domain'] = $domain->id;
55)     if ($dyndns) {
56)         $data['ttl'] = 120;
57)     }
58) }
59) 
Hanno Böck Fix not operator (!) spaces

Hanno Böck authored 1 year ago

60) if (!$new) {
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

61)     $data = get_dns_record($_REQUEST['id']);
62)     $type = $data['type'];
63)     $dyndns = isset($data['dyndns']);
64)     $domain = new Domain((int) $data['domain']);
65)     $domain->ensure_userdomain();
Hanno Böck Fix not operator (!) spaces

Hanno Böck authored 1 year ago

66)     if (!in_array($type, $valid_record_types)) {
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

67)         system_failure('Ungültiger Record-Typ!');
68)     }
69) }
70) 
71) 
72) if ($new) {
73)     title('DNS-Record erstellen');
74) } else {
75)     title('DNS-Record bearbeiten');
76) }
bernd git-svn-id: https://svn.sch...

bernd authored 16 years ago

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

Bernd Wurst authored 6 years ago

78) if (strtoupper($type) == 'NS') {
Hanno Böck Spaces between string conca...

Hanno Böck authored 1 year ago

79)     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>');
Bernd Wurst Text für Autorecords geände...

Bernd Wurst authored 6 years ago

80) }
81) 
Bernd Wurst Warnung, wenn man bei einer...

Bernd Wurst authored 12 years ago

82) if (strtoupper($type) == 'MX' && domain_is_maildomain($domain->id)) {
Hanno Böck Spaces between string conca...

Hanno Böck authored 1 year ago

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> 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>');
Bernd Wurst Warnung, wenn man bei einer...

Bernd Wurst authored 12 years ago

84) }
85) 
Hanno Böck Spaces between string conca...

Hanno Böck authored 1 year ago

86) 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öhnliche 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, solange 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

87) 
88) 
Hanno Böck Spaces between string conca...

Hanno Böck authored 1 year ago

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

bernd authored 16 years ago

90) 
91) $submit = 'Speichern';
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

92) if ($new) {
93)     $submit = 'Anlegen';
94) }
bernd git-svn-id: https://svn.sch...

bernd authored 16 years ago

95) 
bernd DNs-record-Interface ist je...

bernd authored 15 years ago

96) $form = '';
97) 
Hanno Böck Fix not operator (!) spaces

Hanno Böck authored 1 year ago

98) if (!$dyndns && ($type == 'a' || $type == 'aaaa')) {
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

99)     $form .= '
Hanno Böck Spaces between string conca...

Hanno Böck authored 1 year ago

100) <tr><td><label for="ip">IP-Adresse:</label></td><td><input type="text" name="ip" id="ip" value="' . $data['ip'] . '" /></td></tr>
bernd DNs-record-Interface ist je...

bernd authored 15 years ago

101) ';
102) }
103) 
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

104) if ($type == 'ns') {
105)     $form .= '
Hanno Böck Spaces between string conca...

Hanno Böck authored 1 year ago

106) <tr><td><label for="data">DNS-Server:</label></td><td><input type="text" name="data" id="data" value="' . $data['data'] . '" /></td></tr>
bernd Autodns ein- und ausschaltb...

bernd authored 15 years ago

107) ';
108) }
109) 
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

110) if ($type == 'ptr' || $type == 'cname') {
111)     $form .= '
Hanno Böck Spaces between string conca...

Hanno Böck authored 1 year ago

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

113) ';
114) }
115) 
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

116) if ($type == 'spf' || $type == 'txt') {
117)     $form .= '
Hanno Böck Spaces between string conca...

Hanno Böck authored 1 year ago

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

bernd authored 13 years ago

119) ';
120) }
121) 
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

122) if ($type == 'sshfp') {
Hanno Böck Codingstyle PSR12 + array s...

Hanno Böck authored 3 years ago

123)     $algs = [
Hanno Böck Neue codingstyle-rule array...

Hanno Böck authored 7 months ago

124)         1 => "RSA",
125)         2 => "DSA",
126)         3 => "ECDSA",
127)         4 => "ED25519", ];
Hanno Böck add ecdsa and ed25519 suppo...

Hanno Böck authored 10 years ago

128) 
Hanno Böck codingstyle, spaces between...

Hanno Böck authored 1 year ago

129)     $option = "";
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

130)     foreach ($algs as $key => $alg) {
Hanno Böck Spaces between string conca...

Hanno Böck authored 1 year ago

131)         $option .= '<option value="' . $key . '" ';
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

132)         if ($key == $data['spec']) {
133)             $option .= 'selected="selected"';
134)         }
Hanno Böck Spaces between string conca...

Hanno Böck authored 1 year ago

135)         $option .= '>' . $alg . ' (' . $key . ')</option>';
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

136)     }
Hanno Böck add caa support

Hanno Böck authored 7 years ago

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

Hanno authored 6 years ago

138)     $form .= '
Hanno Böck Spaces between string conca...

Hanno Böck authored 1 year ago

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

Hanno Böck authored 7 years ago

141) ';
142) }
143) 
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

144) if ($type == 'caa') {
Hanno Böck codingstyle, spaces between...

Hanno Böck authored 1 year ago

145)     $option = "";
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

146)     foreach ($caa_properties as $key => $property) {
Hanno Böck Spaces between string conca...

Hanno Böck authored 1 year ago

147)         $option .= '<option value="' . $key . '" ';
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

148)         if ($key == $data['spec']) {
149)             $option .= 'selected="selected"';
150)         }
Hanno Böck Spaces between string conca...

Hanno Böck authored 1 year ago

151)         $option .= '>' . $property . ' (' . $key . ')</option>';
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

152)     }
153)     $form .= '
Hanno Böck Spaces between string conca...

Hanno Böck authored 1 year ago

154) <tr><td><label for="spec">Property tag:</label></td><td><select name="spec" id="spec">' . $option . '</select></td></tr>
155) <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

156) ';
157) }
158) 
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

159) if ($dyndns) {
160)     $form .= '
Hanno Böck Spaces between string conca...

Hanno Böck authored 1 year ago

161) <tr><td><label for="dyndns">DynDNS-Zugang:</label></td><td>' . html_select('dyndns', $dyndns_accounts, $data['dyndns']) . '</td></tr>
bernd DNs-record-Interface ist je...

bernd authored 15 years ago

162) ';
163) }
164) 
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

165) if ($type == 'mx') {
166)     $form .= '
Hanno Böck Spaces between string conca...

Hanno Böck authored 1 year ago

167) <tr><td><label for="spec">Priorität:</label></td><td><input type="text" name="spec" id="spec" value="' . $data['spec'] . '" /></td></tr>
168) <tr><td><label for="data">Posteingangsserver:</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

169) ';
170) }
bernd git-svn-id: https://svn.sch...

bernd authored 16 years ago

171) 
172) 
Bernd Wurst added support for SRV recor...

Bernd Wurst authored 4 years ago

173) if ($type == 'srv') {
174)     $form .= '
Hanno Böck Spaces between string conca...

Hanno Böck authored 1 year ago

175) <tr><td><label for="spec">Priorität:</label></td><td><input type="text" name="spec" id="spec" value="' . $data['spec'] . '" /></td></tr>
176) <tr><td><label for="data">Ziel (Server:Port):</label></td><td><input type="text" name="data" id="data" value="' . $data['data'] . '" /></td></tr>
Bernd Wurst added support for SRV recor...

Bernd Wurst authored 4 years ago

177) ';
178) }
179) 
180) 
bernd DNs-record-Interface ist je...

bernd authored 15 years ago

181) output(html_form('dns_record_edit', 'dns_record_save', "type={$type}&domain={$domain->id}&id={$_REQUEST['id']}", '<table>
Hanno Böck Spaces between string conca...

Hanno Böck authored 1 year ago

182) <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>
183) ' . $form . '
184) <tr><td><label for="ttl">TTL:</label></td><td><input type="text" name="ttl" id="ttl" value="' . $data['ttl'] . '" /></td></tr>
bernd DNs-record-Interface ist je...

bernd authored 15 years ago

185) </table>
Hanno Böck Spaces between string conca...

Hanno Böck authored 1 year ago

186) <p><input type="submit" value="' . $submit . '" /></p>