0e0855ee30782d457d6cdf3b1519884cdc691959
bernd neues VHosts-Modul (unbenut...

bernd authored 16 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 Lizenzinfos in eigenes Modu...

Bernd Wurst authored 10 years ago

5) Written 2008-2014 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) 
11) You should have received a copy of the CC0 Public Domain Dedication along with this software. If not, see 
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) */
16) 
bernd neues VHosts-Modul (unbenut...

bernd authored 16 years ago

17) require_once('inc/debug.php');
18) require_once('inc/security.php');
bernd neue Bilder, mehr SSL-Zerti...

bernd authored 14 years ago

19) require_once('inc/icons.php');
bernd neues VHosts-Modul (unbenut...

bernd authored 16 years ago

20) 
21) require_once('vhosts.php');
22) 
bernd Benutze überall title() sta...

bernd authored 13 years ago

23) title("Subdomains");
bernd neues VHosts-Modul (unbenut...

bernd authored 16 years ago

24) $error = '';
25) 
26) require_role(ROLE_SYSTEMUSER);
27) 
bernd VHost-Löschen als icon

bernd authored 16 years ago

28) global $prefix;
bernd neues VHosts-Modul (unbenut...

bernd authored 16 years ago

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

bernd authored 13 years ago

30) output("<p>Mit dieser Funktion legen Sie fest, welche Domains und Subdomains als Webserver-Ressource verfügbar sein sollen und welches Verzeichnis die Dateien enthalten soll.</p>
bernd Beta-Hinweis im vhost-modul

bernd authored 16 years ago

31) <p>Änderungen an Ihren Einstellungen werden im 5-Minuten-Takt auf dem Server übernommen.</p>
32) ");
bernd neues VHosts-Modul (unbenut...

bernd authored 16 years ago

33) 
bernd Bugfix: Funktion-Dopplung v...

bernd authored 16 years ago

34) 
Bernd Wurst Link auf Website / Ermöglic...

Bernd Wurst authored 9 years ago

35) $domain = NULL;
36) if (isset($_REQUEST['domain']) && $_REQUEST['domain'] != '') {
37)   $domain = $_REQUEST['domain'];
38)   output('<p class="warning"><strong>Filter aktiv!</strong> Momentan werden nur Einstellungen für die Domain <strong>'.filter_input_general($domain).'</strong> angezeigt. Klicken Sie '.internal_link('', 'hier', 'domain=').' um alle Einstellungen anzuzeigen.</p>');
39) }
40) $vhosts = list_vhosts($domain);
Bernd Wurst Traffic-Statistik im Webint...

Bernd Wurst authored 11 years ago

41) $traffic_sum = 0;
Bernd Wurst Beta-Warnung bei aktivierte...

Bernd Wurst authored 8 years ago

42) $letsencrypt = false;
43) foreach ($vhosts as $vh) {
44)   if (strstr($vh['options'], 'letsencrypt')) {
45)     $letsencrypt = true;
46)   }
47) }
bernd neues VHosts-Modul (unbenut...

bernd authored 16 years ago

48) 
49) if (count($vhosts) > 0)
50) {
Bernd Wurst Beta-Warnung bei aktivierte...

Bernd Wurst authored 8 years ago

51)   if ($letsencrypt) {
52)     warning("Sie haben für eine oder mehrere Domains die Nutzung eines Let's-Encrypt-Zertifikats aktiviert. Wir haben diese Funktion nach allgemeiner Verfügbarkeit von Let's Encrypt umgehend freigeschaltet und sind mit der ersten Erfahrungen sehr zufrieden. Dennoch befindet sich Let's Encrypt momentan im Beta-Betrieb (d.h. Testbetrieb). Störungen sind daher nicht auszuschließen.");
53)     warning("Die Bereitstellung eines Zertifikats von Let's Encrypt kann momentan bis zu 15 Minuten in Anspruch nehmen.");
54)   }
Bernd Wurst Ermögliche das Auswählen de...

Bernd Wurst authored 11 years ago

55)   if (count($vhosts) > 10) {
56)     addnew('edit', 'Neue Domain bzw. Subdomain einrichten');
57)   }
Bernd Wurst Traffic-Statistik im Webint...

Bernd Wurst authored 11 years ago

58)   output("<table><tr><th>(Sub-)Domain</th><th></th><th>Zusätzliche Alias-Namen</th><th>Protokoll</th><th>SSL</th><th>Traffic<sup>*</sup></th><th>PHP</th><th>Lokaler Pfad<sup>**</sup></th></tr>\n");
bernd mod_php deprecated, zwang z...

bernd authored 15 years ago

59) 
60)   $even = True;
bernd Aliases editieren

bernd authored 16 years ago

61) 
bernd neues VHosts-Modul (unbenut...

bernd authored 16 years ago

62)   foreach ($vhosts as $vhost)
63)   {
bernd mod_php deprecated, zwang z...

bernd authored 15 years ago

64)     $even = ! $even;
bernd neues VHosts-Modul (unbenut...

bernd authored 16 years ago

65)     $fqdn = $vhost['fqdn'];
bernd mod_php deprecated, zwang z...

bernd authored 15 years ago

66)     $class = 'odd';
67)     if ($even) $class = 'even';
Bernd Wurst Link auf Website / Ermöglic...

Bernd Wurst authored 9 years ago

68)     $proto = 'http';
69)     if ($vhost['ssl'] == 'https' || $vhost['ssl'] == 'forward') {
70)       $proto = 'https';
71)     }
72)     $linkuri = $vhost['fqdn'];
73)     if (strstr($vhost['options'], 'aliaswww')) {
74)       $linkuri = "www.".$vhost['fqdn'];
75)     }
76)     output("<tr class=\"{$class}\"><td>".internal_link('edit', $fqdn, "vhost={$vhost['id']}", 'title="Einstellungen bearbeiten"')."</td><td><a href=\"{$proto}://{$linkuri}\">".other_icon('world_link.png', 'Website aufrufen')."</a> ".internal_link('save', icon_delete("»{$vhost['fqdn']}« löschen"), 'action=delete&vhost='.$vhost['id'] )."</td><td>");
bernd Weniger Datenbankzugriffe b...

bernd authored 14 years ago

77)     $aliases = get_all_aliases($vhost);
bernd mod_php deprecated, zwang z...

bernd authored 15 years ago

78)     $tmp = '';
79)     if (count($aliases) > 0)
bernd neues VHosts-Modul (unbenut...

bernd authored 16 years ago

80)     {
bernd mod_php deprecated, zwang z...

bernd authored 15 years ago

81)       foreach ($aliases as $alias)
82)       {
83)         $tmp .= $alias['fqdn'].'<br />';
84)       }
85)     } else {
86)       $tmp = '<em>- keine -</em>';
bernd neues VHosts-Modul (unbenut...

bernd authored 16 years ago

87)     }
bernd mod_php deprecated, zwang z...

bernd authored 15 years ago

88)     output(internal_link('aliases', $tmp, 'vhost='.$vhost['id'], 'title="Aliase verwalten"'));
bernd neues VHosts-Modul (unbenut...

bernd authored 16 years ago

89)     output('</td>');
Bernd Wurst Traffic-Statistik im Webint...

Bernd Wurst authored 11 years ago

90)     $logfiles = 'Kein Log';
bernd Logfile-Status in der vhost...

bernd authored 16 years ago

91)     if ($vhost['logtype'] == 'default')
Bernd Wurst Traffic-Statistik im Webint...

Bernd Wurst authored 11 years ago

92)       $logfiles = 'Zugriffe ';
bernd Logfile-Status in der vhost...

bernd authored 16 years ago

93)     elseif ($vhost['logtype'] == 'anonymous')
Bernd Wurst Traffic-Statistik im Webint...

Bernd Wurst authored 11 years ago

94)       $logfiles = 'Anonym';
bernd Logfile-Status in der vhost...

bernd authored 16 years ago

95)     if ($vhost['errorlog'] == 1)
96)     {
bernd mod_php deprecated, zwang z...

bernd authored 15 years ago

97)       if ($vhost['logtype'] == NULL)
Bernd Wurst Traffic-Statistik im Webint...

Bernd Wurst authored 11 years ago

98)         $logfiles = 'Fehler';
bernd Logfile-Status in der vhost...

bernd authored 16 years ago

99)       else
Bernd Wurst Traffic-Statistik im Webint...

Bernd Wurst authored 11 years ago

100)         $logfiles .= ' + Fehler';
bernd Logfile-Status in der vhost...

bernd authored 16 years ago

101)     }
bernd Webalizer/Statistik-Funktio...

bernd authored 14 years ago

102)     $stats = $vhost['stats'] ? internal_link("showstats", other_icon("chart_bar.png", "Statistiken anzeigen"), "vhost={$vhost['id']}").' ' : '';
103)     output("<td>{$stats}{$logfiles}</td>");
bernd Neue Zertifikatsverwaltung

bernd authored 14 years ago

104)   
105)     if ($vhost['ssl'] == 'http')
106)     {
bernd neue Bilder, mehr SSL-Zerti...

bernd authored 14 years ago

107)       output("<td>".icon_disabled('SSL ausgeschaltet')."</td>");
bernd Neue Zertifikatsverwaltung

bernd authored 14 years ago

108)     }
Bernd Wurst Add lets encrypt logo

Bernd Wurst authored 8 years ago

109)     elseif (strstr($vhost['options'], "letsencrypt") && $vhost['cert'])
110)     {
Bernd Wurst Zeige Warning wenn Lets Enc...

Bernd Wurst authored 8 years ago

111)       $forward = '';
112)       if ($vhost['ssl'] == 'forward') {
113)         $forward = " ".other_icon("refresh.png", 'Auf SSL umleiten');
114)       } else {
115)         $forward = " ".other_icon("warning.png", 'Ungeschützter Aufruf weiterhin möglich');
116)       }
117)       output("<td>".other_icon("letsencrypt.png", "Automatische Zertifikatsverwaltung mit Let's Encrypt").$forward."</td>");
Bernd Wurst Add lets encrypt logo

Bernd Wurst authored 8 years ago

118)     }
bernd Neue Zertifikatsverwaltung

bernd authored 14 years ago

119)     elseif ($vhost['cert'])
120)     {
Bernd Wurst Icons für LE-Zertifikat

Bernd Wurst authored 8 years ago

121)       output("<td>".other_icon("secure.png", "SSL mit eigenem Zertifikat")."</td>");
122)     }
123)     elseif (strstr($vhost['options'], "letsencrypt")) {
124)       // Letsencrypt gewählt aber noch nicht aktiv
125)       $message = "Let's Encrypt-Zertifikat ist noch nicht bereit";
Bernd Wurst Add lets encrypt logo

Bernd Wurst authored 8 years ago

126)       output("<td>".other_icon("letsencrypt.png", $message).icon_warning($message)."</td>");
bernd Neue Zertifikatsverwaltung

bernd authored 14 years ago

127)     }
128)     else
129)     {
bernd neue Bilder, mehr SSL-Zerti...

bernd authored 14 years ago

130)       output("<td>".icon_enabled('SSL eingeschaltet')."</td>");
bernd Neue Zertifikatsverwaltung

bernd authored 14 years ago

131)     }
132) 
Bernd Wurst Traffic-Statistik im Webint...

Bernd Wurst authored 11 years ago

133)     $traffic = traffic_month($vhost['id']);
134)     $traffic_sum += (int) $traffic;
135)     $traffic_string = $traffic.' MB';
136)     if ($traffic > 1024) {
137)       $traffic_string = round($traffic / 1024, 2).' GB';
138)     }
139)     if ($traffic === NULL) {
140)       $traffic_string = '--';
141)     }
142)     output("<td style=\"text-align: right;\">{$traffic_string}</td>");
143) 
bernd VHosts-Modul mit neuem Layo...

bernd authored 16 years ago

144)     if ($vhost['is_webapp'] == 1) {
bernd mod_php deprecated, zwang z...

bernd authored 15 years ago

145)       output('<td colspan="2"><em><strong>Sonderanwendung:</strong> Vorinstallierte Webanwendung</em></td>');
bernd VHosts-Modul mit neuem Layo...

bernd authored 16 years ago

146)     }
147)     elseif ($vhost['is_dav'] == 1) {
bernd mod_php deprecated, zwang z...

bernd authored 15 years ago

148)       output('<td colspan="2"><em><strong>Sonderanwendung:</strong> WebDAV</em></td>');
bernd VHosts-Modul mit neuem Layo...

bernd authored 16 years ago

149)     }
150)     elseif ($vhost['is_svn'] == 1) {
bernd mod_php deprecated, zwang z...

bernd authored 15 years ago

151)       output('<td colspan="2"><em><strong>Sonderanwendung:</strong> Subversion-Server</em></td>');
bernd VHosts-Modul mit neuem Layo...

bernd authored 16 years ago

152)     }
153)     else {
154)       $php = $vhost['php'];
155)       switch ($php)
156)       {
157)         case NULL:
bernd neue Bilder, mehr SSL-Zerti...

bernd authored 14 years ago

158)           $php = icon_disabled('PHP ausgeschaltet');
bernd VHosts-Modul mit neuem Layo...

bernd authored 16 years ago

159)           break;
Bernd Wurst prepare for experimental PH...

Bernd Wurst authored 12 years ago

160)         case 'php54':
Hanno Böck php 5.6 logo, reorganize lo...

Hanno Böck authored 9 years ago

161)           $php = icon_enabled_warning('PHP in veralteter Version aktiviert');
Bernd Wurst prepare for experimental PH...

Bernd Wurst authored 12 years ago

162)           break;
Hanno Böck übrige Änderungen für php55

Hanno Böck authored 10 years ago

163)         case 'php55':
Hanno Böck php 5.6 logo, reorganize lo...

Hanno Böck authored 9 years ago

164)           $php = icon_enabled_phpxx('PHP in Version 5.5 eingeschaltet', 5, 5);
165)           break;
166)         case 'php56':
167)           $php = icon_enabled_phpxx('PHP in Version 5.6 eingeschaltet', 5, 6);
bernd VHosts-Modul mit neuem Layo...

bernd authored 16 years ago

168)           break;
Bernd Wurst zwinge PHP 7.0 auf FPM (har...

Bernd Wurst authored 8 years ago

169)         case 'fpm70': # FIXME: FPM soll bald default sein
Hanno Böck PHP 7.0 support

Hanno Böck authored 8 years ago

170)           $php = icon_enabled_phpxx('PHP in Version 7.0 eingeschaltet', 7, 0);
171)           break;
bernd VHosts-Modul mit neuem Layo...

bernd authored 16 years ago

172)       }
173)       output("<td>{$php}</td>");
174)       if ($vhost['docroot_is_default'] == 1)
175)         output("<td><span style=\"color:#777;\">{$vhost['docroot']}</span></td>");
176)       else
177)         output("<td><strong>{$vhost['docroot']}</strong></td>");
178)     }
bernd mod_php deprecated, zwang z...

bernd authored 15 years ago

179)     output("</tr>\n");
bernd neues VHosts-Modul (unbenut...

bernd authored 16 years ago

180)   }
bernd VHosts anlegen geht auch we...

bernd authored 16 years ago

181)   output('</table>');
Bernd Wurst Traffic-Statistik im Webint...

Bernd Wurst authored 11 years ago

182)   if ($traffic_sum > 0) {
183)     $traffic_string = $traffic_sum.' MB';
184)     if ($traffic_sum > 1024) {
185)       $traffic_string = round($traffic_sum / 1024, 2).' GB';
186)     }
schokokeks.org web services Typo

schokokeks.org web services authored 10 years ago

187)     output('<p><strong>Traffic insgesamt: '.$traffic_string.'</strong> in den letzten 30 Tagen</p>');
Bernd Wurst Traffic-Statistik im Webint...

Bernd Wurst authored 11 years ago

188)   }
189)   output('<p style="font-size: 90%;"><sup>*</sup>)&#160;Dieser Wert stellt den Datenverkehr dieser Website für die letzten 30 Tage dar.</p>');
190)   output('<p style="font-size: 90%;"><sup>**</sup>)&#160;schwach geschriebene Pfadangaben bezeichnen die Standardeinstellung. Ist ein Pfad fett dargestellt, so haben Sie einen davon abweichenden Wert eingegeben.</p>');
bernd neues VHosts-Modul (unbenut...

bernd authored 16 years ago

191) }
bernd Deutlich machen wenn keine...

bernd authored 14 years ago

192) else // keine VHosts vorhanden
193) {
194)   output("<p><strong><em>Bisher haben Sie keine Domain bzw. Subdomain eingerichtet.</em></strong></p>");
195) }
bernd neues VHosts-Modul (unbenut...

bernd authored 16 years ago

196) 
bernd addnew() eingeführt

bernd authored 14 years ago

197) addnew('edit', 'Neue Domain bzw. Subdomain einrichten');
198)