Hanno Böck 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. You should have received a copy of the CC0 Public Domain Dedication along with this software. If not, see http://creativecommons.org/publicdomain/zero/1.0/ 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. */ require_once('inc/debug.php'); require_once('inc/security.php'); require_once('inc/icons.php'); require_once('inc/jquery.php'); javascript(); require_once('vhosts.php'); title("Websites"); $error = ''; require_role(ROLE_SYSTEMUSER); global $prefix; output("

Mit dieser Funktion legen Sie fest, welche Websites verfügbar sein sollen und welches Verzeichnis die Dateien enthalten soll.

Änderungen an Ihren Einstellungen werden im 5-Minuten-Takt auf dem Server übernommen.

"); $filter = ""; if (isset($_REQUEST['filter']) && $_REQUEST['filter'] != '') { $filter = filter_input_general($_REQUEST['filter']); } $vhosts = list_vhosts($filter); $traffic_sum = 0; $letsencrypt = false; foreach ($vhosts as $vh) { if (strstr($vh['options'], 'letsencrypt')) { $letsencrypt = true; } } // Filter-Funktion if (count($vhosts) > 10 || $filter) { $form = '

'; output(html_form('vhosts_filter', 'vhosts', '', $form)); } if (count($vhosts) > 0) { /* if ($letsencrypt) { 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."); warning("Die Bereitstellung eines Zertifikats von Let's Encrypt kann momentan bis zu 15 Minuten in Anspruch nehmen."); } */ if (count($vhosts) > 10) { addnew('edit', 'Neue Website einrichten'); } output("\n"); $even = true; foreach ($vhosts as $vhost) { $even = ! $even; $fqdn = $vhost['fqdn']; $class = 'odd'; if ($even) { $class = 'even'; } $proto = 'http'; if ($vhost['ssl'] == 'https' || $vhost['ssl'] == 'forward') { $proto = 'https'; } $linkuri = $vhost['fqdn']; if (strstr($vhost['options'], 'aliaswww')) { $linkuri = "www.".$vhost['fqdn']; } output("'); $logfiles = 'Kein Log'; if ($vhost['logtype'] == 'default') { $logfiles = 'Zugriffe '; } elseif ($vhost['logtype'] == 'anonymous') { $logfiles = 'Anonym'; } if ($vhost['errorlog'] == 1) { if ($vhost['logtype'] == null) { $logfiles = 'Fehler'; } else { $logfiles .= ' + Fehler'; } } $stats = $vhost['stats'] ? internal_link("showstats", other_icon("chart_bar.png", "Statistiken anzeigen"), "vhost={$vhost['id']}").' ' : ''; output(""); if ($vhost['ssl'] == 'http') { output(""); } elseif (strstr($vhost['options'], "letsencrypt") && $vhost['cert']) { $forward = ''; if ($vhost['ssl'] == 'forward') { $forward = " ".other_icon("refresh.png", 'Auf HTTPS umleiten'); } else { $forward = " ".other_icon("warning.png", 'Ungeschützter Aufruf weiterhin möglich'); } output(""); } elseif ($vhost['cert']) { output(""); } elseif (strstr($vhost['options'], "letsencrypt")) { // Letsencrypt gewählt aber noch nicht aktiv $message = "Let's Encrypt-Zertifikat ist noch nicht bereit"; output(""); } else { output(""); } $traffic = traffic_month($vhost['id']); $traffic_sum += (int) $traffic; $traffic_string = $traffic.' MB'; if ($traffic > 1024) { $traffic_string = round($traffic / 1024, 2).' GB'; } if ($traffic === null) { $traffic_string = '--'; } output(""); if ($vhost['is_webapp'] == 1) { output(''); } elseif ($vhost['is_dav'] == 1) { output(''); } elseif ($vhost['is_svn'] == 1) { output(''); } else { $php = $vhost['php']; $phpinfo = valid_php_versions($php); if (array_key_exists($php, $phpinfo)) { $phpinfo = $phpinfo[$php]; /* To create new PHP icon: convert ok.png -gravity center -draw "text 0,0 '7.2'" ok-php72.png */ $php = icon_enabled_phpxx('PHP in Version '.$phpinfo['major'].'.'.$phpinfo['minor'].' eingeschaltet', $phpinfo['major'], $phpinfo['minor']); if ($phpinfo['status'] == 'deprecated') { $php .= ' '.icon_warning('Diese PHP-Version ist veraltet!'); } elseif ($phpinfo['status'] == 'used') { $php .= ' '.icon_warning('Diese PHP-Version hat für Sie aktuell nur noch Bestandsschutz'); } } else { $php = icon_disabled('PHP ausgeschaltet'); } output(""); if ($vhost['docroot_is_default'] == 1) { output(""); } else { output(""); } } output("\n"); } output('
Haupt-AdresseZusätzliche Alias-NamenProtokollHTTPSTraffic*PHPLokaler Pfad**
".internal_link('edit', $fqdn, "vhost={$vhost['id']}", 'title="Einstellungen bearbeiten"')."".other_icon('world_link.png', 'Website aufrufen')." ".internal_link('save', icon_delete("»{$vhost['fqdn']}« löschen"), 'action=delete&vhost='.$vhost['id']).""); $aliases = get_all_aliases($vhost); $tmp = ''; if (count($aliases) > 0) { foreach ($aliases as $alias) { $tmp .= $alias['fqdn'].'
'; } } else { $tmp = '- keine -'; } output(internal_link('aliases', $tmp, 'vhost='.$vhost['id'], 'title="Aliase verwalten"')); output('
{$stats}{$logfiles}".icon_disabled('HTTPS ausgeschaltet')."".other_icon("letsencrypt.png", "Automatische Zertifikatsverwaltung mit Let's Encrypt").$forward."".other_icon("key.png", "HTTPS mit eigenem Zertifikat")."".other_icon("letsencrypt.png", $message).icon_warning($message)."".icon_enabled('HTTPS eingeschaltet')."{$traffic_string}Sonderanwendung: Vorinstallierte WebanwendungSonderanwendung: WebDAVSonderanwendung: Subversion-Server{$php}{$vhost['docroot']}{$vhost['docroot']}
'); if ($traffic_sum > 0) { $traffic_string = $traffic_sum.' MB'; if ($traffic_sum > 1024) { $traffic_string = round($traffic_sum / 1024, 2).' GB'; } output('

Traffic insgesamt: '.$traffic_string.' in den letzten 30 Tagen

'); } output('

*) Dieser Wert stellt den Datenverkehr dieser Website für die letzten 30 Tage dar.

'); output('

**) schwach geschriebene Pfadangaben bezeichnen die Standardeinstellung. Ist ein Pfad fett dargestellt, so haben Sie einen davon abweichenden Wert eingegeben.

'); } elseif ($filter) { output("

Keine Einträge für Ihre aktuellen Filterkrieterien.

"); } else { // keine VHosts vorhanden output("

Bisher haben Sie keine Website eingerichtet.

"); } addnew('edit', 'Neue Website einrichten'); output('

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.

'); addnew('newcert', 'Ein eigenes HTTPS-Zertifikat eintragen');