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

bernd authored 15 years ago

1) <?php
2) 
3) require_once('inc/base.php');
4) require_once('inc/security.php');
5) 
6) require_once('class/domain.php');
7) 
8) require_role(ROLE_CUSTOMER);
9) 
10) require_once('dnsinclude.php');
11) 
12) $section = 'dns_dns';
13) 
14) $data = array();
15) $type = NULL;
16) 
bernd DNs-record-Interface ist je...

bernd authored 14 years ago

17) $dyndns = false;
18) $dyndns_accounts = array();
19) foreach (get_dyndns_accounts() AS $t)
20) {
21)   $dyndns_accounts[$t['id']] = $t['handle'];
22) }
23) 
24) if ($_REQUEST['type'] == "dyndns")
25) {
26)   $_REQUEST['type'] = 'a';
27)   $dyndns = true;
28) }
29) 
bernd git-svn-id: https://svn.sch...

bernd authored 15 years ago

30) $new = false;
31) if ($_REQUEST['id'] == 'new')
32) {
33)   $new = true;
34)   $data = blank_dns_record($_REQUEST['type']);
bernd DNs-record-Interface ist je...

bernd authored 14 years ago

35)   $domain = new Domain((int) $_REQUEST['domain']);
bernd Prüfe, ob Domain wirklich d...

bernd authored 14 years ago

36)   $domain->ensure_customerdomain();
bernd DNs-record-Interface ist je...

bernd authored 14 years ago

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

bernd authored 15 years ago

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

bernd authored 14 years ago

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

bernd authored 15 years ago

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

bernd authored 14 years ago

49)   $dyndns = isset($data['dyndns']);
50)   $domain = new Domain((int) $data['domain']);
bernd Prüfe, ob Domain wirklich d...

bernd authored 14 years ago

51)   $domain->ensure_customerdomain();
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) }
55) 
56) 
57) if ($new)
bernd DNs-record-Interface ist je...

bernd authored 14 years ago

58)   output('<h3>DNS-Record erstellen</h3>');
bernd git-svn-id: https://svn.sch...

bernd authored 15 years ago

59) else
bernd DNs-record-Interface ist je...

bernd authored 14 years ago

60)   output('<h3>DNS-Record bearbeiten</h3>');
bernd git-svn-id: https://svn.sch...

bernd authored 15 years ago

61) 
bernd Nach update-request auf die...

bernd authored 14 years ago

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

63) 
64) 
bernd DNs-record-Interface ist je...

bernd authored 14 years ago

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

bernd authored 15 years ago

66) 
67) $submit = 'Speichern';
68) if ($new) 
69)   $submit = 'Anlegen';
70) 
bernd DNs-record-Interface ist je...

bernd authored 14 years ago

71) $form = '';
72) 
73) if (! $dyndns && ($type == 'a' || $type == 'aaaa'))
74) {
75)   $form .= '
76) <tr><td><label for="ip">IP-Adresse:</label></td><td><input type="text" name="ip" id="ip" value="'.$data['ip'].'" /></td></tr>
77) ';
78) }
79) 
80) if ($type == 'ptr' || $type == 'cname')
81) {
82)   $form .= '
83) <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

84) ';
85) }
86) 
87) if ($type == 'spf' || $type == 'txt')
88) {
89)   $form .= '
90) <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 14 years ago

91) ';
92) }
93) 
94) if ($dyndns)
95) {
96)   $form .= '
97) <tr><td><label for="dyndns">DynDNS-Zugang:</label></td><td>'.html_select('dyndns', $dyndns_accounts, $data['dyndns']).'</td></tr>
98) ';
99) }
100) 
101) if ($type == 'mx')
102) {
103)   $form .= '
104) <tr><td><label for="spec">Priorität:</label></td><td><input type="text" name="spec" id="spec" value="'.$data['spec'].'" /></td></tr>
105) <tr><td><label for="data">Posteingangsserver:</label></td><td><input type="text" name="data" id="data" value="'.$data['data'].'" /></td></tr>
106) ';
107) }
bernd git-svn-id: https://svn.sch...

bernd authored 15 years ago

108) 
109) 
bernd DNs-record-Interface ist je...

bernd authored 14 years ago

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

bernd authored 15 years ago

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

bernd authored 14 years ago

116) '));