f12aba6daa6e2848a8ed60ea57b26874d6675f52
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 Updated copyright notice (2...

Bernd Wurst authored 11 years ago

5) Written 2008-2013 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 neues VHosts-Modul (unbenut...

bernd authored 16 years ago

35) $vhosts = list_vhosts();
36) 
37) if (count($vhosts) > 0)
38) {
Bernd Wurst Ermögliche das Auswählen de...

Bernd Wurst authored 11 years ago

39)   if (count($vhosts) > 10) {
40)     addnew('edit', 'Neue Domain bzw. Subdomain einrichten');
41)     addnew('../webapps/install', 'Neue Domain bzw. Subdomain mit vorinstallierter Web-Anwendung einrichten');
42)   }
bernd Neue Zertifikatsverwaltung

bernd authored 14 years ago

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

bernd authored 15 years ago

44) 
45)   $even = True;
bernd Aliases editieren

bernd authored 16 years ago

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

bernd authored 16 years ago

47)   foreach ($vhosts as $vhost)
48)   {
bernd mod_php deprecated, zwang z...

bernd authored 15 years ago

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

bernd authored 16 years ago

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

bernd authored 15 years ago

51)     $class = 'odd';
52)     if ($even) $class = 'even';
bernd neue Bilder, mehr SSL-Zerti...

bernd authored 14 years ago

53)     output("<tr class=\"{$class}\"><td>".internal_link('edit', $fqdn, "vhost={$vhost['id']}", 'title="Einstellungen bearbeiten"')."</td><td>".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

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

bernd authored 15 years ago

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

bernd authored 16 years ago

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

bernd authored 15 years ago

58)       foreach ($aliases as $alias)
59)       {
60)         $tmp .= $alias['fqdn'].'<br />';
61)       }
62)     } else {
63)       $tmp = '<em>- keine -</em>';
bernd neues VHosts-Modul (unbenut...

bernd authored 16 years ago

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

bernd authored 15 years ago

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

bernd authored 16 years ago

66)     output('</td>');
bernd mod_php deprecated, zwang z...

bernd authored 15 years ago

67)     $logfiles = 'Kein Protokoll';
bernd Logfile-Status in der vhost...

bernd authored 16 years ago

68)     if ($vhost['logtype'] == 'default')
bernd mod_php deprecated, zwang z...

bernd authored 15 years ago

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

bernd authored 16 years ago

70)     elseif ($vhost['logtype'] == 'anonymous')
bernd mod_php deprecated, zwang z...

bernd authored 15 years ago

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

bernd authored 16 years ago

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

bernd authored 15 years ago

74)       if ($vhost['logtype'] == NULL)
75)         $logfiles = 'Nur Fehler';
bernd Logfile-Status in der vhost...

bernd authored 16 years ago

76)       else
bernd mod_php deprecated, zwang z...

bernd authored 15 years ago

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

bernd authored 16 years ago

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

bernd authored 14 years ago

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

bernd authored 14 years ago

81)   
82)     if ($vhost['ssl'] == 'http')
83)     {
bernd neue Bilder, mehr SSL-Zerti...

bernd authored 14 years ago

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

bernd authored 14 years ago

85)     }
86)     elseif ($vhost['cert'])
87)     {
88)       output("<td><img src=\"{$prefix}images/secure.png\" style=\"height: 16px; width: 16px;\" alt=\"cert\" title=\"SSL mit eigenem Zertifikat\" /></td>");
89)     }
90)     else
91)     {
bernd neue Bilder, mehr SSL-Zerti...

bernd authored 14 years ago

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

bernd authored 14 years ago

93)     }
94) 
bernd VHosts-Modul mit neuem Layo...

bernd authored 16 years ago

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

bernd authored 15 years ago

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

bernd authored 16 years ago

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

bernd authored 15 years ago

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

bernd authored 16 years ago

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

bernd authored 15 years ago

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

bernd authored 16 years ago

103)     }
104)     else {
105)       $php = $vhost['php'];
106)       switch ($php)
107)       {
108)         case NULL:
bernd neue Bilder, mehr SSL-Zerti...

bernd authored 14 years ago

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

bernd authored 16 years ago

110)           break;
111)         case 'mod_php':
bernd neue Bilder, mehr SSL-Zerti...

bernd authored 14 years ago

112)           $php = icon_warning('[mod_php] Veraltet, bitte umstellen!').' Apache-Modul';
bernd VHosts-Modul mit neuem Layo...

bernd authored 16 years ago

113)           break;
114)         case 'fastcgi':
bernd Neue Icons für PHP 5.2 und 5.3

bernd authored 13 years ago

115)           $php = icon_enabled_warning('PHP in veralteter Version aktiviert');
bernd Vorbereitung für PHP 5.3

bernd authored 14 years ago

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

Bernd Wurst authored 12 years ago

117)         case 'php54':
Bernd Wurst PHP 5.4 ist nicht mehr expe...

Bernd Wurst authored 11 years ago

118)           $php = icon_enabled_php54('PHP in Version 5.4 eingeschaltet');
Bernd Wurst prepare for experimental PH...

Bernd Wurst authored 12 years ago

119)           break;
bernd Vorbereitung für PHP 5.3

bernd authored 14 years ago

120)         case 'php53':
Bernd Wurst PHP 5.4 ist nicht mehr expe...

Bernd Wurst authored 11 years ago

121)           $php = icon_enabled_php53('PHP in Version 5.3 eingeschaltet');
bernd VHosts-Modul mit neuem Layo...

bernd authored 16 years ago

122)           break;
123)       }
124)       output("<td>{$php}</td>");
125)       if ($vhost['docroot_is_default'] == 1)
126)         output("<td><span style=\"color:#777;\">{$vhost['docroot']}</span></td>");
127)       else
128)         output("<td><strong>{$vhost['docroot']}</strong></td>");
129)     }
bernd mod_php deprecated, zwang z...

bernd authored 15 years ago

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

bernd authored 16 years ago

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

bernd authored 16 years ago

132)   output('</table>');
bernd addnew() eingeführt

bernd authored 14 years ago

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

134) }
bernd Deutlich machen wenn keine...

bernd authored 14 years ago

135) else // keine VHosts vorhanden
136) {
137)   output("<p><strong><em>Bisher haben Sie keine Domain bzw. Subdomain eingerichtet.</em></strong></p>");
138) }
bernd neues VHosts-Modul (unbenut...

bernd authored 16 years ago

139) 
bernd addnew() eingeführt

bernd authored 14 years ago

140) addnew('edit', 'Neue Domain bzw. Subdomain einrichten');
141) 
142) addnew('../webapps/install', 'Neue Domain bzw. Subdomain mit vorinstallierter Web-Anwendung einrichten');