6979709e1406d13962be4d4da69cd65faf9e5ea5
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 10 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 neues VHosts-Modul (unbenut...

bernd authored 16 years ago

42) 
43) if (count($vhosts) > 0)
44) {
Bernd Wurst Ermögliche das Auswählen de...

Bernd Wurst authored 11 years ago

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

Bernd Wurst authored 11 years ago

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

49) 
50)   $even = True;
bernd Aliases editieren

bernd authored 16 years ago

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

bernd authored 16 years ago

52)   foreach ($vhosts as $vhost)
53)   {
bernd mod_php deprecated, zwang z...

bernd authored 15 years ago

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

bernd authored 16 years ago

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

bernd authored 15 years ago

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

Bernd Wurst authored 10 years ago

58)     $proto = 'http';
59)     if ($vhost['ssl'] == 'https' || $vhost['ssl'] == 'forward') {
60)       $proto = 'https';
61)     }
62)     $linkuri = $vhost['fqdn'];
63)     if (strstr($vhost['options'], 'aliaswww')) {
64)       $linkuri = "www.".$vhost['fqdn'];
65)     }
66)     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

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

bernd authored 15 years ago

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

bernd authored 16 years ago

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

bernd authored 15 years ago

71)       foreach ($aliases as $alias)
72)       {
73)         $tmp .= $alias['fqdn'].'<br />';
74)       }
75)     } else {
76)       $tmp = '<em>- keine -</em>';
bernd neues VHosts-Modul (unbenut...

bernd authored 16 years ago

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

bernd authored 15 years ago

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

bernd authored 16 years ago

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

Bernd Wurst authored 11 years ago

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

bernd authored 16 years ago

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

Bernd Wurst authored 11 years ago

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

bernd authored 16 years ago

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

Bernd Wurst authored 11 years ago

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

bernd authored 16 years ago

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

bernd authored 15 years ago

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

Bernd Wurst authored 11 years ago

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

bernd authored 16 years ago

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

Bernd Wurst authored 11 years ago

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

bernd authored 16 years ago

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

bernd authored 14 years ago

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

bernd authored 14 years ago

94)   
95)     if ($vhost['ssl'] == 'http')
96)     {
bernd neue Bilder, mehr SSL-Zerti...

bernd authored 14 years ago

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

bernd authored 14 years ago

98)     }
99)     elseif ($vhost['cert'])
100)     {
101)       output("<td><img src=\"{$prefix}images/secure.png\" style=\"height: 16px; width: 16px;\" alt=\"cert\" title=\"SSL mit eigenem Zertifikat\" /></td>");
102)     }
103)     else
104)     {
bernd neue Bilder, mehr SSL-Zerti...

bernd authored 14 years ago

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

bernd authored 14 years ago

106)     }
107) 
Bernd Wurst Traffic-Statistik im Webint...

Bernd Wurst authored 11 years ago

108)     $traffic = traffic_month($vhost['id']);
109)     $traffic_sum += (int) $traffic;
110)     $traffic_string = $traffic.' MB';
111)     if ($traffic > 1024) {
112)       $traffic_string = round($traffic / 1024, 2).' GB';
113)     }
114)     if ($traffic === NULL) {
115)       $traffic_string = '--';
116)     }
117)     output("<td style=\"text-align: right;\">{$traffic_string}</td>");
118) 
bernd VHosts-Modul mit neuem Layo...

bernd authored 16 years ago

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

bernd authored 15 years ago

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

bernd authored 16 years ago

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

bernd authored 15 years ago

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

bernd authored 16 years ago

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

bernd authored 15 years ago

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

bernd authored 16 years ago

127)     }
128)     else {
129)       $php = $vhost['php'];
130)       switch ($php)
131)       {
132)         case NULL:
bernd neue Bilder, mehr SSL-Zerti...

bernd authored 14 years ago

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

bernd authored 16 years ago

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

Hanno Böck authored 10 years ago

135)         case 'php53':
Hanno Böck php 5.6 logo, reorganize lo...

Hanno Böck authored 9 years ago

136)           $php = icon_enabled_warning('PHP in veralteter Version aktiviert');
Hanno Böck übrige Änderungen für php55

Hanno Böck authored 10 years ago

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

Bernd Wurst authored 12 years ago

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

Hanno Böck authored 9 years ago

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

Bernd Wurst authored 12 years ago

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

Hanno Böck authored 10 years ago

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

Hanno Böck authored 9 years ago

142)           $php = icon_enabled_phpxx('PHP in Version 5.5 eingeschaltet', 5, 5);
143)           break;
144)         case 'php56':
145)           $php = icon_enabled_phpxx('PHP in Version 5.6 eingeschaltet', 5, 6);
bernd VHosts-Modul mit neuem Layo...

bernd authored 16 years ago

146)           break;
147)       }
148)       output("<td>{$php}</td>");
149)       if ($vhost['docroot_is_default'] == 1)
150)         output("<td><span style=\"color:#777;\">{$vhost['docroot']}</span></td>");
151)       else
152)         output("<td><strong>{$vhost['docroot']}</strong></td>");
153)     }
bernd mod_php deprecated, zwang z...

bernd authored 15 years ago

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

bernd authored 16 years ago

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

bernd authored 16 years ago

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

Bernd Wurst authored 11 years ago

157)   if ($traffic_sum > 0) {
158)     $traffic_string = $traffic_sum.' MB';
159)     if ($traffic_sum > 1024) {
160)       $traffic_string = round($traffic_sum / 1024, 2).' GB';
161)     }
schokokeks.org web services Typo

schokokeks.org web services authored 10 years ago

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

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

166) }
bernd Deutlich machen wenn keine...

bernd authored 14 years ago

167) else // keine VHosts vorhanden
168) {
169)   output("<p><strong><em>Bisher haben Sie keine Domain bzw. Subdomain eingerichtet.</em></strong></p>");
170) }
bernd neues VHosts-Modul (unbenut...

bernd authored 16 years ago

171) 
bernd addnew() eingeführt

bernd authored 14 years ago

172) addnew('edit', 'Neue Domain bzw. Subdomain einrichten');
173)