354c05a4ddd678c49bcbba458bffa7d13482139a
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) 
Hanno Böck Change license from CC0 to...

Hanno Böck authored 1 year 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 1 year 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 15 years ago

13) 
Bernd Wurst Mache manuelle NS-Records n...

Bernd Wurst authored 6 years ago

14) require_once('inc/icons.php');
bernd git-svn-id: https://svn.sch...

bernd authored 15 years ago

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

20) 
21) require_once('dnsinclude.php');
22) 
23) $section = 'dns_dns';
24) 
25) $domain = new Domain((int) $_REQUEST['dom']);
bernd Erlaube *useraccounts* das...

bernd authored 14 years ago

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

bernd authored 15 years ago

27) 
28) DEBUG($domain);
29) 
Hanno Böck Spaces between string conca...

Hanno Böck authored 6 months ago

30) title('DNS-Records für ' . filter_output_html($domain->fqdn));
31) headline('DNS-Records für <em>' . filter_output_html($domain->fqdn) . '</em>');
bernd git-svn-id: https://svn.sch...

bernd authored 15 years ago

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

Hanno authored 5 years ago

33) if ($domain->provider != 'terions' || $domain->billing != 'regular' || $domain->registrierungsdatum == null || $domain->kuendigungsdatum != null) {
Bernd Wurst Zeige Warnung für falsche/e...

Bernd Wurst authored 6 years ago

34)     $state = check_dns($domain->domainname, $domain->tld);
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

35)     if ($state !== true) {
Hanno Böck Spaces between string conca...

Hanno Böck authored 6 months ago

36)         $current = 'Momentaner DNS-Server (u.A.): ' . $state;
Bernd Wurst Zeige Warnung für falsche/e...

Bernd Wurst authored 6 years ago

37)         if ($state == 'NXDOMAIN') {
38)             $current = 'Diese Domain ist aktuell nicht registriert.';
39)         }
40)         if (substr_compare($state, config('masterdomain'), -strlen(config('masterdomain')), strlen(config('masterdomain'))) === 0) {
Hanno Böck Spaces between string conca...

Hanno Böck authored 6 months ago

41)             warning('Es werden veraltete DNS-Server benutzt: ' . $current);
Bernd Wurst Zeige Warnung für falsche/e...

Bernd Wurst authored 6 years ago

42)             warning('Bitte aktualisieren Sie diese Domain bei Ihrem Registrar auf unsere aktuellen DNS-Server-Namen, die Sie auf der Übersichtsseite finden.');
43)         } else {
Hanno Böck Spaces between string conca...

Hanno Böck authored 6 months ago

44)             warning('Lokaler DNS-Server eingeschaltet aber nicht genutzt. ' . $current);
Bernd Wurst Zeige Warnung für falsche/e...

Bernd Wurst authored 6 years ago

45)         }
46)     }
47) }
48) 
49) 
bernd git-svn-id: https://svn.sch...

bernd authored 15 years ago

50) $records = get_domain_records($domain->id);
51) $auto_records = get_domain_auto_records($domain->fqdn);
Bernd Wurst Mache manuelle NS-Records n...

Bernd Wurst authored 6 years ago

52) $cname_on_domain = false;
bernd git-svn-id: https://svn.sch...

bernd authored 15 years ago

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

bernd authored 15 years ago

54) output('<table><tr><th>Hostname</th><th>Typ</th><th>IP-Adresse/Inhalt</th><th>TTL</th><th>&#160;</th></tr>
55) ');
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

56) foreach ($records as $rec) {
57)     $editable = true;
Bernd Wurst Umstellung von filter_input...

Bernd Wurst authored 4 years ago

58)     $data = filter_output_html($rec['ip'] ? $rec['ip'] : $rec['data']);
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

59)     if ($rec['dyndns']) {
60)         if ($domain->fqdn == config('masterdomain')) {
Hanno Böck Spaces between string conca...

Hanno Böck authored 6 months ago

61)             $data = '<em>DynDNS #' . (int) $rec['dyndns'] . '</em>';
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

62)             $editable = false;
63)         } else {
64)             $dyndns = get_dyndns_account($rec['dyndns']);
65)             if ($dyndns === null) {
Hanno Böck Spaces between string conca...

Hanno Böck authored 6 months ago

66)                 $data = '<em>DynDNS #' . (int) $rec['dyndns'] . ' (nicht Ihr Account)</em>';
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

67)             } else {
Hanno Böck Spaces between string conca...

Hanno Böck authored 6 months ago

68)                 $data = internal_link('dyndns_edit', '<em>DynDNS #' . (int) $rec['dyndns'] . ' (' . filter_output_html($dyndns['handle']) . ')</em>', 'id=' . (int) $rec['dyndns']);
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

69)             }
70)         }
71)     }
Bernd Wurst added support for SRV recor...

Bernd Wurst authored 4 years ago

72)     if ($rec['type'] == 'mx' || $rec['type'] == 'srv') {
Hanno Böck Spaces between string conca...

Hanno Böck authored 6 months ago

73)         $data .= ' (' . (int) $rec['spec'] . ')';
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

74)     }
75)     if ($rec['type'] == 'sshfp') {
76)         $data = (int) $rec['spec'] . ' 1 ' . $data;
77)     }
78)     if ($rec['type'] == 'caa') {
Hanno Böck Spaces between string conca...

Hanno Böck authored 6 months ago

79)         $data = $caa_properties[(int) $rec['spec']] . ' 0 "' . $data . '"';
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

80)     }
81)     $ttl = ($rec['ttl'] ? $rec['ttl'] : 3600);
82)     $link = $rec['fqdn'];
Hanno Böck Codingstyle PSR12 + array s...

Hanno Böck authored 2 years ago

83)     if (!in_array($rec['type'], ['a', 'aaaa', 'mx', 'cname', 'ns', 'txt', 'spf', 'ptr', 'sshfp', 'srv', 'caa'])) {
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

84)         $editable = false;
Bernd Wurst Erzeuge DNS-Records der For...

Bernd Wurst authored 9 years ago

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

Hanno authored 5 years ago

86)     $delete = internal_link('dns_record_save', icon_delete('Record löschen'), "id={$rec['id']}&action=delete");
Hanno Böck Fix not operator (!) spaces

Hanno Böck authored 6 months ago

87)     if ($rec['type'] == 'ns' && !$rec['hostname']) {
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

88)         $editable = false;
89)         $delete = '';
90)     }
91)     if ($editable) {
92)         $link = internal_link('dns_record_edit', $rec['fqdn'], "id={$rec['id']}");
93)     }
Hanno Böck Spaces between string conca...

Hanno Böck authored 6 months ago

94)     output("<tr><td>{$link}</td><td>" . strtoupper($rec['type']) . "</td><td>" . $data . "</td><td>{$ttl} Sek.</td><td>" . $delete . "</td></tr>\n");
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

95) }
96) foreach ($auto_records as $rec) {
Bernd Wurst Umstellung von filter_input...

Bernd Wurst authored 4 years ago

97)     $data = filter_output_html($rec['ip'] ? $rec['ip'] : $rec['data']);
Bernd Wurst added support for SRV recor...

Bernd Wurst authored 4 years ago

98)     if ($rec['type'] == 'mx' || $rec['type'] == 'srv') {
Hanno Böck Spaces between string conca...

Hanno Böck authored 6 months ago

99)         $data .= ' (' . (int) $rec['spec'] . ')';
Bernd Wurst added support for SRV recor...

Bernd Wurst authored 4 years ago

100)     }
Hanno Böck cut overly long autogenerat...

Hanno Böck authored 1 year ago

101)     if (($rec['type'] == 'txt') && (strlen($data) > 100)) {
102)         $data = substr($data, 0, 100) . "<em>[...]</em>";
103)     }
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

104)     $ttl = ($rec['ttl'] ? $rec['ttl'] : 3600);
Hanno Böck Spaces between string conca...

Hanno Böck authored 6 months ago

105)     output("<tr><td><em>{$rec['fqdn']}</em></td><td>" . strtoupper($rec['type']) . "</td><td>$data</td><td>{$ttl} Sek.</td><td>&#160;</td></tr>\n");
bernd git-svn-id: https://svn.sch...

bernd authored 15 years ago

106) }
107) 
108) 
bernd DNs-record-Interface ist je...

bernd authored 15 years ago

109) output('</table>');
bernd git-svn-id: https://svn.sch...

bernd authored 15 years ago

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

Hanno authored 5 years ago

111) if ($domain->autodns) {
112)     output('<p style="font-size: 80%;"><em>Kursive Hostnames bezeichnen automatisch erzeugte Records. Diese können nicht geändert werden.</em></p>');
113) } else {
114)     output('<p style="font-size: 80%;"><em>Für diese Domain wurde die Erzeugung automatischer Records deaktiviert.</em></p>');
115) }
bernd DNs-record-Interface ist je...

bernd authored 15 years ago

116) 
117) 
118) output('<h4>Neuen DNS-Record anlegen</h4>
119) <p>Je nach dem, welchen Eintrags-Typ Sie anlegen möchten, werden im nächsten Schritt unterschiedliche Daten abgefragt. Bitte klicken Sie auf den Eintrags-Typ, den Sie anlegen möchten. Momentan werden noch nicht alle Eintrags-Typen über dieses System bereitgestellt. Hier nicht aufgeführte Eintragsarten können Sie beim Support beantragen.</p>
120) 
121) <ul>
Hanno Böck Spaces between string conca...

Hanno Böck authored 6 months ago

122) <li>' . internal_link('dns_record_edit', 'DynDNS (Hostname für einen DynDNS-Account setzen)', 'id=new&type=dyndns&domain=' . $domain->id) . '</li>
123) <li>' . internal_link('dns_record_edit', 'DynDNS/AAAA (Hostname für einen DynDNS-Account setzen, als IPv6-Adresse)', 'id=new&type=dyndns_aaaa&domain=' . $domain->id) . '</li>
124) <li>' . internal_link('dns_record_edit', 'A (normaler Hostname/normale Subdomain)', 'id=new&type=a&domain=' . $domain->id) . '</li>
125) <li>' . internal_link('dns_record_edit', 'MX (Posteingangsserver)', 'id=new&type=mx&domain=' . $domain->id) . '</li>
bernd DNs-record-Interface ist je...

bernd authored 15 years ago

126) </ul>
127) <ul>
Hanno Böck Spaces between string conca...

Hanno Böck authored 6 months ago

128) <li>' . internal_link('dns_record_edit', 'AAAA (IPv6-Adresse)', 'id=new&type=aaaa&domain=' . $domain->id) . '</li>
129) <li>' . internal_link('dns_record_edit', 'CNAME (Aliasnamen)', 'id=new&type=cname&domain=' . $domain->id) . '</li>
130) <li>' . internal_link('dns_record_edit', 'NS (Nameserver, NUR FÜR SUBDOMAINS!)', 'id=new&type=ns&domain=' . $domain->id) . '</li>
131) <li>' . internal_link('dns_record_edit', 'TXT', 'id=new&type=txt&domain=' . $domain->id) . '</li>
132) <li>' . internal_link('dns_record_edit', 'SSHFP', 'id=new&type=sshfp&domain=' . $domain->id) . '</li>
133) <li>' . internal_link('dns_record_edit', 'CAA', 'id=new&type=caa&domain=' . $domain->id) . '</li>
134) <li>' . internal_link('dns_record_edit', 'SRV', 'id=new&type=srv&domain=' . $domain->id) . '</li>
bernd DNs-record-Interface ist je...

bernd authored 15 years ago

135) </ul>
bernd Autodns ein- und ausschaltb...

bernd authored 14 years ago

136) 
137) <h4>Automatische DNS-Records</h4>
bernd DNs-record-Interface ist je...

bernd authored 15 years ago

138) ');
bernd git-svn-id: https://svn.sch...

bernd authored 15 years ago

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

Hanno authored 5 years ago

140) if ($domain->autodns) {
141)     output("<p>Für extrem ungewöhnliche Konfigurationen können Sie die Erzeugung von automatischen DNS-Records unter dieser Domain komplett abschalten. Dies ist i.d.R. falsch und wird zu Fehlfunktion führen. Nutzen Sie diese Einstellung auf eigene Gefahr.</p>
Bernd Wurst Text für Autorecords geände...

Bernd Wurst authored 6 years ago

142)   <p>Möchten Sie einzelne DNS-Einträge abweichend setzen, so legen Sie einfach oben den jeweils gewünschten Record an. Falls es gleichlautende automatische Einträge gibt, werden diese anschließend unterdrückt.</p>
143)   <p>Warten Sie nach Änderung dieser Einstellung eine Minute und laden Sie danach die Seite neu.</p>
Hanno Böck Spaces between string conca...

Hanno Böck authored 6 months ago

144) <p>" . internal_link('dns_save', 'Automatisch erzeugte Einträge umwandeln', "type=autodns&action=disable&dom={$domain->id}") . "</p>");
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

145) } else {
146)     output("<p>Sie verwalten Ihre DNS-Einträge selbst. Wenn Sie möchten, können Sie die DNS-Einträge auch automatisch anhand der angelegten Webserver-VHosts und anderer Einstellungen festlegen lassen. Diese Eintäge können Sie dann nicht direkt ändern. Ihre bestehenden Einträge bleiben unberührt und zusätzlich erhalten. Bitte löschen Sie dadurch entstehende Duplikate!</p>
Bernd Wurst Text für Autorecords geände...

Bernd Wurst authored 6 years ago

147)   <p>Warten Sie nach Änderung dieser Einstellung eine Minute und laden Sie danach die Seite neu.</p>
Hanno Böck Spaces between string conca...

Hanno Böck authored 6 months ago

148) <p>" . internal_link('dns_save', 'Automatisch erzeugte Einträge aktivieren', "type=autodns&action=enable&dom={$domain->id}") . "</p>");