8d1feb35ad1482df9cf632f0d86b06330665b60f
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) 
Bernd Wurst Copyright year update

Bernd Wurst authored 6 years ago

5) Written 2008-2018 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) 
9) To the extent possible under law, the author(s) have dedicated all copyright and related and neighboring rights to this software to the public domain worldwide. This software is distributed without any warranty.
10) 
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

11) You should have received a copy of the CC0 Public Domain Dedication along with this software. If not, see
Bernd Wurst Added license tags for CC0,...

Bernd Wurst authored 12 years ago

12) http://creativecommons.org/publicdomain/zero/1.0/
13) 
14) 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.
15) */
bernd Stub für dns-Admin-Interface

bernd authored 15 years ago

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

Bernd Wurst authored 10 years ago

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

bernd authored 15 years ago

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

bernd authored 14 years ago

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

bernd authored 15 years ago

22) 
23) require_once('dnsinclude.php');
24) 
25) 
Bernd Wurst fix warning about undeclare...

Bernd Wurst authored 4 years ago

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

bernd authored 15 years ago

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

bernd authored 13 years ago

28) title('DNS-Records');
29) 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

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

Bernd Wurst authored 10 years ago

34) $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

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

Hanno authored 5 years ago

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

Bernd Wurst authored 10 years ago

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

Hanno authored 5 years ago

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

Bernd Wurst authored 10 years ago

51)         continue;
52)     }
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

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

bernd authored 15 years ago

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

Hanno authored 5 years ago

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

Hanno authored 5 years ago

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

Hanno authored 5 years ago

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

bernd authored 15 years ago

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

Bernd Wurst authored 10 years ago

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

Hanno authored 5 years ago

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

Bernd Wurst authored 10 years ago

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

Hanno authored 5 years ago

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

Bernd Wurst authored 10 years ago

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

Hanno authored 5 years ago

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

Bernd Wurst authored 10 years ago

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