3ef995c2108fe77d22c0b556fb9717cb848bc48f
bernd Stub für dns-Admin-Interface

bernd authored 17 years ago

1) <?php
Hanno Böck Add newlines before comment...

Hanno Böck authored 10 months ago

2) 
Bernd Wurst Added license tags for CC0,...

Bernd Wurst authored 13 years ago

3) /*
4) This file belongs to the Webinterface of schokokeks.org Hosting
5) 
Hanno Böck Change license from CC0 to...

Hanno Böck authored 3 years ago

6) Written by schokokeks.org Hosting, namely
Bernd Wurst Added license tags for CC0,...

Bernd Wurst authored 13 years ago

7)   Bernd Wurst <bernd@schokokeks.org>
8)   Hanno Böck <hanno@schokokeks.org>
9) 
Hanno Böck Change license from CC0 to...

Hanno Böck authored 3 years ago

10) This code is published under a 0BSD license.
Bernd Wurst Added license tags for CC0,...

Bernd Wurst authored 13 years ago

11) 
12) 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.
13) */
bernd Stub für dns-Admin-Interface

bernd authored 17 years ago

14) 
15) require_once('inc/base.php');
Bernd Wurst Warne, wenn bei den DNS-Ser...

Bernd Wurst authored 11 years ago

16) require_once('inc/icons.php');
bernd Stub für dns-Admin-Interface

bernd authored 17 years ago

17) require_once('inc/security.php');
18) 
bernd erfordere Kunden- UND Benut...

bernd authored 16 years ago

19) require_role(ROLE_SYSTEMUSER);
bernd Stub für dns-Admin-Interface

bernd authored 17 years ago

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

Hanno Böck authored 4 years ago

24) $domains = get_domain_list(($_SESSION['customerinfo']['customerno'] ?? null), $_SESSION['userinfo']['uid']);
bernd Stub für dns-Admin-Interface

bernd authored 17 years ago

25) 
bernd Benutze überall title() sta...

bernd authored 15 years ago

26) title('DNS-Records');
27) output('<p>Hier sehen Sie eine Übersicht über die angelegten DNS-records zu Ihren Domains.</p>');
bernd Stub für dns-Admin-Interface

bernd authored 17 years ago

28) 
29) //$output .= '<table><tr><th>Hostname</th><th>Typ</th><th>IP-Adresse/Inhalt</th><th>TTL</th><th>&#160;</th></tr>
30) //';
31) 
Hanno Böck Remove some unneeded whites...

Hanno Böck authored 2 years ago

32) $output .= '<table><tr><th>Domainname</th><th>Manuelle records</th><th>Automatische records</th><th>Status</th></tr>';
bernd Stub für dns-Admin-Interface

bernd authored 17 years ago

33) 
34) DEBUG($domains);
35) 
Hanno Fix coding style with php-c...

Hanno authored 7 years ago

36) $external_domains = false;
37) $unused_dns = false;
38) foreach ($domains as $dom) {
39)     if ($dom->provider != 'terions') {
40)         $external_domains = true;
Bernd Wurst Warne, wenn bei den DNS-Ser...

Bernd Wurst authored 11 years ago

41)     }
Hanno Böck codingstyle, spaces between...

Hanno Böck authored 2 years ago

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

Hanno authored 7 years ago

43)     if ($dom->dns == 0) {
44)         if (strstr($dom->domainname, '.')) {
Hanno Böck Spaces between string conca...

Hanno Böck authored 2 years ago

45)             $output .= '<tr style="color: #999;"><td>' . $dom->fqdn . '</td><td>---</td><td>---</td><td>Subdomain ohne eigene DNS-Zone</td></tr>';
Hanno Fix coding style with php-c...

Hanno authored 7 years ago

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

Hanno Böck authored 2 years ago

47)             $output .= '<tr style="color: #999;"><td>' . $dom->fqdn . '</td><td>---</td><td>---</td><td>' . icon_disabled('DNS-Server ausgeschaltet') . ' Es wird ein externer DNS-Server benutzt<br />' . internal_link('save', icon_add() . ' Lokalen DNS-Server aktivieren', "dom={$dom->id}&dns=1") . '</td></tr>';
Hanno Fix coding style with php-c...

Hanno authored 7 years ago

48)         }
Bernd Wurst Warne, wenn bei den DNS-Ser...

Bernd Wurst authored 11 years ago

49)         continue;
50)     }
Hanno Fix coding style with php-c...

Hanno authored 7 years ago

51)     $records = get_domain_records($dom->id);
52) 
53)     $autorec = ($dom->autodns == 1 ? 'Ja' : 'Nein');
54)     if ($dom->provider != 'terions' || $dom->billing != 'regular' || $dom->registrierungsdatum == null || $dom->kuendigungsdatum != null) {
55)         $state = check_dns($dom->domainname, $dom->tld);
56)         if ($state !== true) {
Hanno Böck Spaces between string conca...

Hanno Böck authored 2 years ago

57)             $current = 'Momentaner DNS-Server (u.A.): ' . $state;
Hanno Fix coding style with php-c...

Hanno authored 7 years ago

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

Hanno Böck authored 2 years ago

62)                 $output .= '<tr><td>' . internal_link('dns_domain', $dom->fqdn, "dom={$dom->id}") . '</td><td>' . count($records) . '</td><td>' . $autorec . '</td><td>' . icon_enabled('DNS-Server aktiv') . '<br />' . icon_warning() . 'Es werden veraltete DNS-Server benutzt<br />' . $current . '</td></tr>';
Hanno Fix coding style with php-c...

Hanno authored 7 years ago

63)                 continue;
64)             } else {
Hanno Böck Spaces between string conca...

Hanno Böck authored 2 years ago

65)                 $output .= '<tr><td>' . internal_link('dns_domain', $dom->fqdn, "dom={$dom->id}") . '</td><td>' . count($records) . '</td><td>' . $autorec . '</td><td>' . icon_enabled('DNS-Server aktiv') . '<br />' . icon_warning() . ' Lokaler DNS-Server eingeschaltet aber nicht genutzt<br />' . $current . '<br />' . internal_link('save', icon_delete() . ' Lokalen DNS-Server abschalten', "dom={$dom->id}&dns=0") . '</td></tr>';
Hanno Fix coding style with php-c...

Hanno authored 7 years ago

66)                 $unused_dns = true;
67)                 continue;
68)             }
69)         }
bernd Stub für dns-Admin-Interface

bernd authored 17 years ago

70)     }
Hanno Böck Spaces between string conca...

Hanno Böck authored 2 years ago

71)     $output .= '<tr><td>' . internal_link('dns_domain', $dom->fqdn, "dom={$dom->id}") . '</td><td>' . count($records) . '</td><td>' . $autorec . '</td><td>' . icon_enabled('DNS-Server aktiv') . '</td></tr>';
Hanno Fix coding style with php-c...

Hanno authored 7 years ago

72) 
73)     /*  if ($records)
74)       {
75)         #$output .= '<h4>'.$dom->fqdn.'</h4>';
76)         #$output .= '<table><tr><th>Hostname</th><th>Typ</th><th>IP-Adresse/Inhalt</th><th>TTL</th><th>&#160;</th></tr>
77)         #';
78)         foreach ($records AS $rec)
79)         {
80)           $data = ( $rec['ip'] ? $rec['ip'] : $rec['data'] );
81)           if ($rec['dyndns'])
82)             $data = '<em>DynDNS #'.$rec['dyndns'].'</em>';
83)           $output .= "<tr><td>".internal_link('dns_edit', $rec['fqdn'], "id={$rec['id']}")."</td><td>".strtoupper($rec['type'])."</td><td>$data</td><td>{$rec['ttl']} Sek.</td><td>".internal_link('save', '<img src="'.$prefix.'images/delete.png" width="16" height="16" alt="löschen" title="Account löschen" />', "id={$rec['id']}&type=dns&action=delete")."</td></tr>\n";
84)         }
85)         #$output .= '</table><br />';
Hanno verbleibende syntaxfehler u...

Hanno authored 7 years ago

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

Hanno authored 7 years ago

87)       }*/
bernd Stub für dns-Admin-Interface

bernd authored 17 years ago

88) }
89) 
90) $output .= '</table><br />';
91) 
Bernd Wurst Warne, wenn bei den DNS-Ser...

Bernd Wurst authored 11 years ago

92) if ($external_domains) {
Hanno Fix coding style with php-c...

Hanno authored 7 years ago

93)     $own_ns = own_ns();
94)     asort($own_ns);
Hanno Böck codingstyle, spaces between...

Hanno Böck authored 2 years ago

95)     $output .= '<h4>Hinweis zu extern registrierten Domains</h4>
Bernd Wurst Warne, wenn bei den DNS-Ser...

Bernd Wurst authored 11 years ago

96) <p>Wenn Sie Ihre Domains bei einem anderen Provider registrieren und dennoch unsere DNS-Server nutzen möchten, dann stellen Sie bitte sicher, dass der DNS-Server oben eingeschaltet ist und stellen Sie dann folgende DNS-Server ein:<p>
97) <ul>';
Hanno Fix coding style with php-c...

Hanno authored 7 years ago

98)     foreach ($own_ns as $ns) {
Hanno Böck Spaces between string conca...

Hanno Böck authored 2 years ago

99)         $output .= '<li>' . $ns . '</li>';
Hanno Fix coding style with php-c...

Hanno authored 7 years ago

100)     }
Hanno Böck codingstyle, spaces between...

Hanno Böck authored 2 years ago

101)     $output .= '</ul>';
Bernd Wurst Warne, wenn bei den DNS-Ser...

Bernd Wurst authored 11 years ago

102) }
103) if ($unused_dns) {
Hanno Böck codingstyle, spaces between...

Hanno Böck authored 2 years ago

104)     $output .= '<h4>Wichtiger Hinweis</h4>
Bernd Wurst Prüfe auch Domains die "bal...

Bernd Wurst authored 11 years ago

105) <p>In der obigen Liste befinden sich Domains, bei denen unser DNS-Server aktiviert ist aber die Domain momentan auf einen anderen DNS-Server eingerichtet ist. <strong>Dies ist normal bei bevorstehenden Domain-Transfers zu uns</strong>, sollte aber nicht dauerhaft so bleiben.<p>