84f913aef153e595a7a43ce882c2212f8168933c
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 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) 
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) 
Bernd Wurst Domain-Nutzung mit Deeplink...

Bernd Wurst authored 6 years ago

21) require_once('inc/jquery.php');
22) javascript();
23) 
bernd neues VHosts-Modul (unbenut...

bernd authored 16 years ago

24) require_once('vhosts.php');
25) 
bernd Benutze überall title() sta...

bernd authored 13 years ago

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

bernd authored 16 years ago

27) $error = '';
28) 
29) require_role(ROLE_SYSTEMUSER);
30) 
bernd VHost-Löschen als icon

bernd authored 16 years ago

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

bernd authored 16 years ago

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

bernd authored 13 years ago

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

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

bernd authored 16 years ago

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

bernd authored 16 years ago

37) 
Bernd Wurst Domain-Nutzung mit Deeplink...

Bernd Wurst authored 6 years ago

38) $filter = "";
39) if (isset($_REQUEST['filter']) && $_REQUEST['filter'] != '') {
40)   $filter = $_REQUEST['filter'];
41) }
42) if (isset($_REQUEST['clear']) && $_REQUEST['clear'] == 'X') {
43)     $filter = "";
Bernd Wurst Link auf Website / Ermöglic...

Bernd Wurst authored 10 years ago

44) }
Bernd Wurst Domain-Nutzung mit Deeplink...

Bernd Wurst authored 6 years ago

45) $vhosts = list_vhosts($filter);
46) 
47) 
Bernd Wurst Traffic-Statistik im Webint...

Bernd Wurst authored 11 years ago

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

Bernd Wurst authored 8 years ago

49) $letsencrypt = false;
50) foreach ($vhosts as $vh) {
51)   if (strstr($vh['options'], 'letsencrypt')) {
52)     $letsencrypt = true;
53)   }
54) }
Bernd Wurst Domain-Nutzung mit Deeplink...

Bernd Wurst authored 6 years ago

55) // Filter-Funktion
56) if (count($vhosts) > 10 || $filter) {
57)     $form = '<p><label for="filter">Filter für die Anzeige:</label> <input type="text" name="filter" id="filter" value="'.$filter.'"><button type="button" id="clear" title="Filter leeren">&times;</button><input type="submit" value="Filtern!"></p>';
58)     output(html_form('vhosts_filter', 'vhosts', '', $form));
59) }
bernd neues VHosts-Modul (unbenut...

bernd authored 16 years ago

60) 
61) if (count($vhosts) > 0)
62) {
Bernd Wurst Lets Encrypt ist jetzt kein...

Bernd Wurst authored 7 years ago

63)   /*
Bernd Wurst Beta-Warnung bei aktivierte...

Bernd Wurst authored 8 years ago

64)   if ($letsencrypt) {
65)     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.");
66)     warning("Die Bereitstellung eines Zertifikats von Let's Encrypt kann momentan bis zu 15 Minuten in Anspruch nehmen.");
67)   }
Bernd Wurst Lets Encrypt ist jetzt kein...

Bernd Wurst authored 7 years ago

68)   */
Bernd Wurst Ermögliche das Auswählen de...

Bernd Wurst authored 11 years ago

69)   if (count($vhosts) > 10) {
70)     addnew('edit', 'Neue Domain bzw. Subdomain einrichten');
71)   }
Bernd Wurst Interface für Zertifikate i...

Bernd Wurst authored 7 years ago

72)   output("<table><tr><th>(Sub-)Domain</th><th></th><th>Zusätzliche Alias-Namen</th><th>Protokoll</th><th>HTTPS</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

73) 
74)   $even = True;
bernd Aliases editieren

bernd authored 16 years ago

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

bernd authored 16 years ago

76)   foreach ($vhosts as $vhost)
77)   {
bernd mod_php deprecated, zwang z...

bernd authored 15 years ago

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

bernd authored 16 years ago

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

bernd authored 15 years ago

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

Bernd Wurst authored 10 years ago

82)     $proto = 'http';
83)     if ($vhost['ssl'] == 'https' || $vhost['ssl'] == 'forward') {
84)       $proto = 'https';
85)     }
86)     $linkuri = $vhost['fqdn'];
87)     if (strstr($vhost['options'], 'aliaswww')) {
88)       $linkuri = "www.".$vhost['fqdn'];
89)     }
90)     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

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

bernd authored 15 years ago

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

bernd authored 16 years ago

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

bernd authored 15 years ago

95)       foreach ($aliases as $alias)
96)       {
97)         $tmp .= $alias['fqdn'].'<br />';
98)       }
99)     } else {
100)       $tmp = '<em>- keine -</em>';
bernd neues VHosts-Modul (unbenut...

bernd authored 16 years ago

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

bernd authored 15 years ago

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

bernd authored 16 years ago

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

Bernd Wurst authored 11 years ago

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

bernd authored 16 years ago

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

Bernd Wurst authored 11 years ago

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

bernd authored 16 years ago

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

Bernd Wurst authored 11 years ago

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

bernd authored 16 years ago

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

bernd authored 15 years ago

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

Bernd Wurst authored 11 years ago

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

bernd authored 16 years ago

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

Bernd Wurst authored 11 years ago

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

bernd authored 16 years ago

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

bernd authored 14 years ago

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

bernd authored 14 years ago

118)   
119)     if ($vhost['ssl'] == 'http')
120)     {
Bernd Wurst Interface für Zertifikate i...

Bernd Wurst authored 7 years ago

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

bernd authored 14 years ago

122)     }
Bernd Wurst Add lets encrypt logo

Bernd Wurst authored 8 years ago

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

Bernd Wurst authored 8 years ago

125)       $forward = '';
126)       if ($vhost['ssl'] == 'forward') {
Bernd Wurst Interface für Zertifikate i...

Bernd Wurst authored 7 years ago

127)         $forward = " ".other_icon("refresh.png", 'Auf HTTPS umleiten');
Bernd Wurst Zeige Warning wenn Lets Enc...

Bernd Wurst authored 8 years ago

128)       } else {
129)         $forward = " ".other_icon("warning.png", 'Ungeschützter Aufruf weiterhin möglich');
130)       }
131)       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

132)     }
bernd Neue Zertifikatsverwaltung

bernd authored 14 years ago

133)     elseif ($vhost['cert'])
134)     {
Bernd Wurst Interface für Zertifikate i...

Bernd Wurst authored 7 years ago

135)       output("<td>".other_icon("secure.png", "HTTPS mit eigenem Zertifikat")."</td>");
Bernd Wurst Icons für LE-Zertifikat

Bernd Wurst authored 8 years ago

136)     }
137)     elseif (strstr($vhost['options'], "letsencrypt")) {
138)       // Letsencrypt gewählt aber noch nicht aktiv
139)       $message = "Let's Encrypt-Zertifikat ist noch nicht bereit";
Bernd Wurst Add lets encrypt logo

Bernd Wurst authored 8 years ago

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

bernd authored 14 years ago

141)     }
142)     else
143)     {
Bernd Wurst Interface für Zertifikate i...

Bernd Wurst authored 7 years ago

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

bernd authored 14 years ago

145)     }
146) 
Bernd Wurst Traffic-Statistik im Webint...

Bernd Wurst authored 11 years ago

147)     $traffic = traffic_month($vhost['id']);
148)     $traffic_sum += (int) $traffic;
149)     $traffic_string = $traffic.' MB';
150)     if ($traffic > 1024) {
151)       $traffic_string = round($traffic / 1024, 2).' GB';
152)     }
153)     if ($traffic === NULL) {
154)       $traffic_string = '--';
155)     }
156)     output("<td style=\"text-align: right;\">{$traffic_string}</td>");
157) 
bernd VHosts-Modul mit neuem Layo...

bernd authored 16 years ago

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

bernd authored 15 years ago

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

bernd authored 16 years ago

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

bernd authored 15 years ago

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

bernd authored 16 years ago

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

bernd authored 15 years ago

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

bernd authored 16 years ago

166)     }
167)     else {
168)       $php = $vhost['php'];
169)       switch ($php)
170)       {
Hanno Böck add PHP 7.2 support, re-cre...

Hanno Böck authored 6 years ago

171)         /* To create new PHP icon:
172)            convert ok.png -gravity center -draw "text 0,0 '7.2'" ok-php72.png
173)         */
bernd VHosts-Modul mit neuem Layo...

bernd authored 16 years ago

174)         case NULL:
bernd neue Bilder, mehr SSL-Zerti...

bernd authored 14 years ago

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

bernd authored 16 years ago

176)           break;
Hanno Böck php 5.6 logo, reorganize lo...

Hanno Böck authored 9 years ago

177)         case 'php56':
178)           $php = icon_enabled_phpxx('PHP in Version 5.6 eingeschaltet', 5, 6);
bernd VHosts-Modul mit neuem Layo...

bernd authored 16 years ago

179)           break;
Bernd Wurst PHP <= 5.5 entfernt und Vor...

Bernd Wurst authored 7 years ago

180)         case 'fpm70':
Hanno Böck PHP 7.0 support

Hanno Böck authored 8 years ago

181)           $php = icon_enabled_phpxx('PHP in Version 7.0 eingeschaltet', 7, 0);
182)           break;
Bernd Wurst PHP <= 5.5 entfernt und Vor...

Bernd Wurst authored 7 years ago

183)         case 'fpm71':
184)           $php = icon_enabled_phpxx('PHP in Version 7.1 eingeschaltet', 7, 1);
185)           break;
Hanno Böck add PHP 7.2 support, re-cre...

Hanno Böck authored 6 years ago

186)         case 'fpm72':
187)           $php = icon_enabled_phpxx('PHP in Version 7.2 eingeschaltet', 7, 2);
188)           break;
bernd VHosts-Modul mit neuem Layo...

bernd authored 16 years ago

189)       }
190)       output("<td>{$php}</td>");
191)       if ($vhost['docroot_is_default'] == 1)
192)         output("<td><span style=\"color:#777;\">{$vhost['docroot']}</span></td>");
193)       else
194)         output("<td><strong>{$vhost['docroot']}</strong></td>");
195)     }
bernd mod_php deprecated, zwang z...

bernd authored 15 years ago

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

bernd authored 16 years ago

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

bernd authored 16 years ago

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

Bernd Wurst authored 11 years ago

199)   if ($traffic_sum > 0) {
200)     $traffic_string = $traffic_sum.' MB';
201)     if ($traffic_sum > 1024) {
202)       $traffic_string = round($traffic_sum / 1024, 2).' GB';
203)     }
schokokeks.org web services Typo

schokokeks.org web services authored 10 years ago

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

205)   }
206)   output('<p style="font-size: 90%;"><sup>*</sup>)&#160;Dieser Wert stellt den Datenverkehr dieser Website für die letzten 30 Tage dar.</p>');
207)   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

208) }
Bernd Wurst Domain-Nutzung mit Deeplink...

Bernd Wurst authored 6 years ago

209) elseif ($filter) {
210)   output("<p><strong><em>Keine Einträge für Ihre aktuellen Filterkrieterien.</em></strong></p>");
211) }
bernd Deutlich machen wenn keine...

bernd authored 14 years ago

212) else // keine VHosts vorhanden
213) {
214)   output("<p><strong><em>Bisher haben Sie keine Domain bzw. Subdomain eingerichtet.</em></strong></p>");
215) }
bernd neues VHosts-Modul (unbenut...

bernd authored 16 years ago

216) 
bernd addnew() eingeführt

bernd authored 14 years ago

217) addnew('edit', 'Neue Domain bzw. Subdomain einrichten');
218) 
Bernd Wurst Interface für Zertifikate i...

Bernd Wurst authored 7 years ago

219) output('<p>Bei passenden Einstellungen wird für jede Ihrer Websites automatisch ein Zertifikat von Let\'s Encrypt verwaltet und regelmäßig erneuert. Wenn Sie ein Zertifikat einsetzen möchten, das von einer anderen Zertifizierungsstelle ausgestellt ist, können Sie dieses hier hochladen.</p>');
220) addnew('newcert', 'Ein eigenes HTTPS-Zertifikat eintragen');
221)