dcc202fb249a446ac15c7cf413b9f1b4a3f31b58
bernd Stub für dns-Admin-Interface

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 Stub für dns-Admin-Interface

bernd authored 15 years ago

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

Bernd Wurst authored 10 years ago

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

bernd authored 15 years ago

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

bernd authored 14 years ago

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

bernd authored 15 years ago

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

Hanno Böck authored 2 years ago

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

bernd authored 15 years ago

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

bernd authored 13 years ago

25) title('DNS-Records');
26) 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 15 years ago

27) 
28) //$output .= '<table><tr><th>Hostname</th><th>Typ</th><th>IP-Adresse/Inhalt</th><th>TTL</th><th>&#160;</th></tr>
29) //';
30) 
Bernd Wurst Warne, wenn bei den DNS-Ser...

Bernd Wurst authored 10 years ago

31) $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 15 years ago

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

Hanno authored 5 years ago

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

Bernd Wurst authored 10 years ago

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

Hanno authored 5 years ago

41)     $style="";
42)     if ($dom->dns == 0) {
43)         if (strstr($dom->domainname, '.')) {
44)             $output .= '<tr style="color: #999;"><td>'.$dom->fqdn.'</td><td>---</td><td>---</td><td>Subdomain ohne eigene DNS-Zone</td></tr>';
45)         } else {
46)             $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>';
47)         }
Bernd Wurst Warne, wenn bei den DNS-Ser...

Bernd Wurst authored 10 years ago

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

Hanno authored 5 years ago

50)     $records = get_domain_records($dom->id);
51) 
52)     $autorec = ($dom->autodns == 1 ? 'Ja' : 'Nein');
53)     if ($dom->provider != 'terions' || $dom->billing != 'regular' || $dom->registrierungsdatum == null || $dom->kuendigungsdatum != null) {
54)         $state = check_dns($dom->domainname, $dom->tld);
55)         if ($state !== true) {
56)             $current = 'Momentaner DNS-Server (u.A.): '.$state;
57)             if ($state == 'NXDOMAIN') {
58)                 $current = 'Diese Domain ist aktuell nicht registriert.';
59)             }
60)             if (substr_compare($state, config('masterdomain'), -strlen(config('masterdomain')), strlen(config('masterdomain'))) === 0) {
61)                 $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>';
62)                 continue;
63)             } else {
64)                 $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>';
65)                 $unused_dns = true;
66)                 continue;
67)             }
68)         }
bernd Stub für dns-Admin-Interface

bernd authored 15 years ago

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

Hanno authored 5 years ago

70)     $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>';
71) 
72)     /*  if ($records)
73)       {
74)         #$output .= '<h4>'.$dom->fqdn.'</h4>';
75)         #$output .= '<table><tr><th>Hostname</th><th>Typ</th><th>IP-Adresse/Inhalt</th><th>TTL</th><th>&#160;</th></tr>
76)         #';
77)         foreach ($records AS $rec)
78)         {
79)           $data = ( $rec['ip'] ? $rec['ip'] : $rec['data'] );
80)           if ($rec['dyndns'])
81)             $data = '<em>DynDNS #'.$rec['dyndns'].'</em>';
82)           $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";
83)         }
84)         #$output .= '</table><br />';
Hanno verbleibende syntaxfehler u...

Hanno authored 5 years ago

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

Hanno authored 5 years ago

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

bernd authored 15 years ago

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

Bernd Wurst authored 10 years ago

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

Hanno authored 5 years ago

92)     $own_ns = own_ns();
93)     asort($own_ns);
94)     $output.='<h4>Hinweis zu extern registrierten Domains</h4>
Bernd Wurst Warne, wenn bei den DNS-Ser...

Bernd Wurst authored 10 years ago

95) <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>
96) <ul>';
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

97)     foreach ($own_ns as $ns) {
98)         $output.='<li>'.$ns.'</li>';
99)     }
100)     $output.='</ul>';
Bernd Wurst Warne, wenn bei den DNS-Ser...

Bernd Wurst authored 10 years ago

101) }
102) if ($unused_dns) {
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

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

Bernd Wurst authored 10 years ago

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