... | ... |
@@ -126,12 +126,12 @@ $form .= "<br /> |
126 | 126 |
$options = ["none" => 'ausgeschaltet', "default" => "Eingeschaltet (empfohlene Version)"]; |
127 | 127 |
$phpinfo = valid_php_versions(); |
128 | 128 |
$php_default_version = null; |
129 |
- foreach ($phpinfo as $v) { |
|
130 |
- if ($v['default'] == true) { |
|
131 |
- $php_default_version = $v['major'].'.'.$v['minor']; |
|
132 |
- break; |
|
133 |
- } |
|
129 |
+foreach ($phpinfo as $v) { |
|
130 |
+ if ($v['default'] == true) { |
|
131 |
+ $php_default_version = $v['major'].'.'.$v['minor']; |
|
132 |
+ break; |
|
134 | 133 |
} |
134 |
+} |
|
135 | 135 |
foreach ($phpinfo as $tag => $info) { |
136 | 136 |
$options[$tag] = 'PHP '.$info['major'].'.'.$info['minor']; |
137 | 137 |
if ($info['status'] == 'deprecated') { |
... | ... |
@@ -274,35 +274,35 @@ if (!$vhost['server']) { |
274 | 274 |
$vhost['server'] = my_server_id(); |
275 | 275 |
} |
276 | 276 |
|
277 |
- if (count($ipaddrs)) { |
|
278 |
- $ipselect = [0 => 'System-Standard']; |
|
279 |
- foreach ($ipaddrs as $i) { |
|
280 |
- $ipselect[$i] = $i; |
|
281 |
- } |
|
282 |
- $form .= " |
|
277 |
+if (count($ipaddrs)) { |
|
278 |
+ $ipselect = [0 => 'System-Standard']; |
|
279 |
+ foreach ($ipaddrs as $i) { |
|
280 |
+ $ipselect[$i] = $i; |
|
281 |
+ } |
|
282 |
+ $form .= " |
|
283 | 283 |
<h5>IP-Adresse</h5> |
284 | 284 |
<div style=\"margin-left: 2em;\"> |
285 | 285 |
".html_select('ipv4', $ipselect, $vhost['ipv4'])." |
286 | 286 |
</div>"; |
287 |
- } |
|
288 |
- if (count($available_users)) { |
|
289 |
- $userselect = [0 => 'Eigener Benutzeraccount']; |
|
290 |
- foreach ($available_users as $u) { |
|
291 |
- $userselect[$u['uid']] = $u['username']; |
|
292 |
- } |
|
293 |
- $form .= " |
|
287 |
+} |
|
288 |
+if (count($available_users)) { |
|
289 |
+ $userselect = [0 => 'Eigener Benutzeraccount']; |
|
290 |
+ foreach ($available_users as $u) { |
|
291 |
+ $userselect[$u['uid']] = $u['username']; |
|
292 |
+ } |
|
293 |
+ $form .= " |
|
294 | 294 |
<h5>SuExec-Benutzeraccount</h5> |
295 | 295 |
<div style=\"margin-left: 2em;\"> |
296 | 296 |
".html_select('suexec_user', $userselect, $vhost['suexec_user'])." |
297 | 297 |
</div>"; |
298 |
- } |
|
299 |
- if (count($available_servers) > 1) { |
|
300 |
- $form .= " |
|
298 |
+} |
|
299 |
+if (count($available_servers) > 1) { |
|
300 |
+ $form .= " |
|
301 | 301 |
<h5>Einrichten auf Server</h5> |
302 | 302 |
<div style=\"margin-left: 2em;\"> |
303 | 303 |
".html_select('server', $selectable_servers, $vhost['server'])." |
304 | 304 |
</div>"; |
305 |
- } |
|
305 |
+} |
|
306 | 306 |
if ($have_v6) { |
307 | 307 |
$ipv6_address = ''; |
308 | 308 |
if ($vhost['id'] && ($vhost['autoipv6'] >0)) { |
... | ... |
@@ -2,14 +2,11 @@ |
2 | 2 |
/* |
3 | 3 |
This file belongs to the Webinterface of schokokeks.org Hosting |
4 | 4 |
|
5 |
-Written 2008-2018 by schokokeks.org Hosting, namely |
|
5 |
+Written by schokokeks.org Hosting, namely |
|
6 | 6 |
Bernd Wurst <bernd@schokokeks.org> |
7 | 7 |
Hanno Böck <hanno@schokokeks.org> |
8 | 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/ |
|
9 |
+This code is published under a 0BSD license. |
|
13 | 10 |
|
14 | 11 |
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 | 12 |
*/ |
... | ... |
@@ -34,7 +34,7 @@ if ($id != 0) { |
34 | 34 |
} |
35 | 35 |
|
36 | 36 |
$have_v6 = false; |
37 |
-$server = (isset($vhost['server']) ? $vhost['server'] : $_SESSION['userinfo']['server']); |
|
37 |
+$server = ($vhost['server'] ?? $_SESSION['userinfo']['server']); |
|
38 | 38 |
if (ipv6_possible($server)) { |
39 | 39 |
$have_v6 = true; |
40 | 40 |
} |
... | ... |
@@ -91,7 +91,7 @@ foreach ($applist as $app) { |
91 | 91 |
$webapp_options .= "<option value=\"{$app['id']}\">{$app['displayname']}</option>\n"; |
92 | 92 |
} |
93 | 93 |
|
94 |
-$aliaswww_options = array("forwardwww" => "Umleiten auf www-Subdomain", "forwardnowww" => "Umleiten auf Stammdomain (ohne www)", "noforward" => "Keine Umleitung"); |
|
94 |
+$aliaswww_options = ["forwardwww" => "Umleiten auf www-Subdomain", "forwardnowww" => "Umleiten auf Stammdomain (ohne www)", "noforward" => "Keine Umleitung"]; |
|
95 | 95 |
$aliaswww_option = 'forwardwww'; |
96 | 96 |
if (strstr($vhost['options'], 'aliaswww')) { |
97 | 97 |
// Wenn aliaswww gar nicht gesetzt war, dann soll die select-Option für forwardwww trotzdem auf dem default stehen. |
... | ... |
@@ -126,7 +126,7 @@ $form .= "<br /> |
126 | 126 |
/* |
127 | 127 |
* Choose what PHP version to use |
128 | 128 |
*/ |
129 |
-$options = array("none" => 'ausgeschaltet', "default" => "Eingeschaltet (empfohlene Version)"); |
|
129 |
+$options = ["none" => 'ausgeschaltet', "default" => "Eingeschaltet (empfohlene Version)"]; |
|
130 | 130 |
$phpinfo = valid_php_versions(); |
131 | 131 |
$php_default_version = null; |
132 | 132 |
foreach ($phpinfo as $v) { |
... | ... |
@@ -188,7 +188,7 @@ if ($vhost_type=='webapp') { |
188 | 188 |
"; |
189 | 189 |
} |
190 | 190 |
$hsts_value = $vhost['hsts']; |
191 |
-$hsts_preset_values = array("-1" => "aus", "86400" => "1 Tag", "2592000" => "30 Tage", "31536000" => "1 Jahr", "63072000" => "2 Jahre", "custom" => "Individuell"); |
|
191 |
+$hsts_preset_values = ["-1" => "aus", "86400" => "1 Tag", "2592000" => "30 Tage", "31536000" => "1 Jahr", "63072000" => "2 Jahre", "custom" => "Individuell"]; |
|
192 | 192 |
$hsts_preset_value = 'custom'; |
193 | 193 |
if (isset($hsts_preset_values[$hsts_value])) { |
194 | 194 |
$hsts_preset_value = $hsts_value; |
... | ... |
@@ -218,7 +218,7 @@ $form .= " |
218 | 218 |
</div>"; |
219 | 219 |
|
220 | 220 |
$certs = user_certs(); |
221 |
-$certselect = array(); |
|
221 |
+$certselect = []; |
|
222 | 222 |
$certselect[0] = 'kein Zertifikat / System-Standard benutzen'; |
223 | 223 |
if ($vhost_type != 'dav' && $vhost_type != 'svn') { |
224 | 224 |
$certselect[-1] = 'Automatische Zertifikatsverwaltung mit Let\'s Encrypt'; |
... | ... |
@@ -266,7 +266,7 @@ $available_servers = additional_servers(); |
266 | 266 |
$available_servers[] = my_server_id(); |
267 | 267 |
$available_servers = array_unique($available_servers); |
268 | 268 |
|
269 |
-$selectable_servers = array(); |
|
269 |
+$selectable_servers = []; |
|
270 | 270 |
$all_servers = server_names(); |
271 | 271 |
foreach ($all_servers as $id => $fqdn) { |
272 | 272 |
if (in_array($id, $available_servers)) { |
... | ... |
@@ -278,7 +278,7 @@ if (!$vhost['server']) { |
278 | 278 |
} |
279 | 279 |
|
280 | 280 |
if (count($ipaddrs)) { |
281 |
- $ipselect = array(0 => 'System-Standard'); |
|
281 |
+ $ipselect = [0 => 'System-Standard']; |
|
282 | 282 |
foreach ($ipaddrs as $i) { |
283 | 283 |
$ipselect[$i] = $i; |
284 | 284 |
} |
... | ... |
@@ -289,7 +289,7 @@ if (!$vhost['server']) { |
289 | 289 |
</div>"; |
290 | 290 |
} |
291 | 291 |
if (count($available_users)) { |
292 |
- $userselect = array(0 => 'Eigener Benutzeraccount'); |
|
292 |
+ $userselect = [0 => 'Eigener Benutzeraccount']; |
|
293 | 293 |
foreach ($available_users as $u) { |
294 | 294 |
$userselect[$u['uid']] = $u['username']; |
295 | 295 |
} |
... | ... |
@@ -136,14 +136,14 @@ $php_default_version = null; |
136 | 136 |
} |
137 | 137 |
} |
138 | 138 |
foreach ($phpinfo as $tag => $info) { |
139 |
- $options[$tag] = 'PHP '.$info['major'].'.'.$info['minor']; |
|
140 |
- if ($info['status'] == 'deprecated') { |
|
141 |
- $options[$tag] .= ' (veraltet)'; |
|
142 |
- } elseif ($info['status'] == 'beta') { |
|
143 |
- $options[$tag] .= ' (Testversion)'; |
|
144 |
- } elseif ($info['status'] == 'used') { |
|
145 |
- $options[$tag] .= ' (nur Bestandsschutz)'; |
|
146 |
- } |
|
139 |
+ $options[$tag] = 'PHP '.$info['major'].'.'.$info['minor']; |
|
140 |
+ if ($info['status'] == 'deprecated') { |
|
141 |
+ $options[$tag] .= ' (veraltet)'; |
|
142 |
+ } elseif ($info['status'] == 'beta') { |
|
143 |
+ $options[$tag] .= ' (Testversion)'; |
|
144 |
+ } elseif ($info['status'] == 'used') { |
|
145 |
+ $options[$tag] .= ' (nur Bestandsschutz)'; |
|
146 |
+ } |
|
147 | 147 |
} |
148 | 148 |
$phpoptions = " |
149 | 149 |
<h5>PHP</h5> |
... | ... |
@@ -126,7 +126,7 @@ $form .= "<br /> |
126 | 126 |
/* |
127 | 127 |
* Choose what PHP version to use |
128 | 128 |
*/ |
129 |
-$options = array("none" => 'ausgeschaltet', "default" => "Eingeschaltet (neueste Version)"); |
|
129 |
+$options = array("none" => 'ausgeschaltet', "default" => "Eingeschaltet (empfohlene Version)"); |
|
130 | 130 |
$phpinfo = valid_php_versions(); |
131 | 131 |
$php_default_version = null; |
132 | 132 |
foreach ($phpinfo as $v) { |
... | ... |
@@ -149,7 +149,7 @@ $phpoptions = " |
149 | 149 |
<h5>PHP</h5> |
150 | 150 |
<div style=\"margin-left: 2em;\"> |
151 | 151 |
".html_select("php", $options, $vhost['php'])."<br> |
152 |
- <p>Aktuelle Standardversion: $php_default_version. Bei der Einstellung \"neueste Version\" wird Ihre Website immer mit der neuesten stabilen PHP-Version betrieben.</p> |
|
152 |
+ <p>Aktuell empfohlene Version: $php_default_version.<br>Bei der Einstellung \"empfohlene Version\" wird Ihre Website immer mit einer von uns ausgesuchten PHP-Version betrieben. Meist ist dies die zweit-neueste Version.</p> |
|
153 | 153 |
</div>"; |
154 | 154 |
|
155 | 155 |
$safemode = ($vhost['cgi'] == 1 ? '' : ' checked="checked" '); |
... | ... |
@@ -123,26 +123,19 @@ $form .= "<br /> |
123 | 123 |
</div> |
124 | 124 |
"; |
125 | 125 |
|
126 |
-/* |
|
127 |
- * Boolean option, to be used when only one PHP version is available |
|
128 |
- */ |
|
129 |
-$have_php = ($vhost['php'] == 'php56' ? ' checked="checked" ' : ''); |
|
130 |
- |
|
131 |
-/* |
|
132 |
-$phpoptions = "<h5>PHP</h5> |
|
133 |
- <div style=\"margin-left: 2em;\"> |
|
134 |
- <input type=\"checkbox\" name=\"php\" id=\"php\" value=\"php53\" {$have_php}/> <label for=\"php\">PHP einschalten</label> |
|
135 |
- </div> |
|
136 |
-"; |
|
137 |
-*/ |
|
138 | 126 |
/* |
139 | 127 |
* Choose what PHP version to use |
140 | 128 |
*/ |
141 |
-//if ($vhost['php'] == 'php54') |
|
142 |
-//{ |
|
143 |
- $options = array("none" => 'ausgeschaltet'); |
|
144 |
- $phpinfo = valid_php_versions(); |
|
145 |
- foreach ($phpinfo as $tag => $info) { |
|
129 |
+$options = array("none" => 'ausgeschaltet', "default" => "Eingeschaltet (neueste Version)"); |
|
130 |
+$phpinfo = valid_php_versions(); |
|
131 |
+$php_default_version = null; |
|
132 |
+ foreach ($phpinfo as $v) { |
|
133 |
+ if ($v['default'] == true) { |
|
134 |
+ $php_default_version = $v['major'].'.'.$v['minor']; |
|
135 |
+ break; |
|
136 |
+ } |
|
137 |
+ } |
|
138 |
+foreach ($phpinfo as $tag => $info) { |
|
146 | 139 |
$options[$tag] = 'PHP '.$info['major'].'.'.$info['minor']; |
147 | 140 |
if ($info['status'] == 'deprecated') { |
148 | 141 |
$options[$tag] .= ' (veraltet)'; |
... | ... |
@@ -151,13 +144,13 @@ $phpoptions = "<h5>PHP</h5> |
151 | 144 |
} elseif ($info['status'] == 'used') { |
152 | 145 |
$options[$tag] .= ' (nur Bestandsschutz)'; |
153 | 146 |
} |
154 |
- } |
|
155 |
- $phpoptions = " |
|
156 |
- <h5>PHP</h5> |
|
157 |
- <div style=\"margin-left: 2em;\"> |
|
158 |
- ".html_select("php", $options, $vhost['php'])." |
|
159 |
- </div>"; |
|
160 |
-//} |
|
147 |
+} |
|
148 |
+$phpoptions = " |
|
149 |
+<h5>PHP</h5> |
|
150 |
+<div style=\"margin-left: 2em;\"> |
|
151 |
+ ".html_select("php", $options, $vhost['php'])."<br> |
|
152 |
+ <p>Aktuelle Standardversion: $php_default_version. Bei der Einstellung \"neueste Version\" wird Ihre Website immer mit der neuesten stabilen PHP-Version betrieben.</p> |
|
153 |
+</div>"; |
|
161 | 154 |
|
162 | 155 |
$safemode = ($vhost['cgi'] == 1 ? '' : ' checked="checked" '); |
163 | 156 |
|
... | ... |
@@ -263,7 +263,6 @@ $form.=" |
263 | 263 |
<option value=\"default\" ".($vhost['logtype'] == 'default' ? 'selected="selected"' : '')." >vollständige Logfile</option> |
264 | 264 |
</select><br /> |
265 | 265 |
<input type=\"checkbox\" id=\"errorlog\" name=\"errorlog\" value=\"1\" ".($vhost['errorlog'] == 1 ? ' checked="checked" ' : '')." /> <label for=\"errorlog\">Fehlerprotokoll (error_log) einschalten</label><br /> |
266 |
- <input type=\"checkbox\" id=\"stats\" name=\"stats\" value=\"1\" ".($vhost['stats'] != null ? ' checked="checked" ' : '')." /> <label for=\"stats\">Statistiken/Auswertungen erzeugen</label> |
|
267 | 266 |
</div> |
268 | 267 |
<p>Logfiles werden unter <b>/var/log/apache2/".$_SESSION['userinfo']['username']."</b> abgelegt.</p> |
269 | 268 |
"; |
... | ... |
@@ -41,9 +41,9 @@ if (ipv6_possible($server)) { |
41 | 41 |
|
42 | 42 |
DEBUG($vhost); |
43 | 43 |
if ($id == 0) { |
44 |
- title("Neue Subdomain anlegen"); |
|
44 |
+ title("Neue Website anlegen"); |
|
45 | 45 |
} else { |
46 |
- title("Subdomain bearbeiten"); |
|
46 |
+ title("Website bearbeiten"); |
|
47 | 47 |
} |
48 | 48 |
|
49 | 49 |
$defaultdocroot = $vhost['domain']; |
... | ... |
@@ -317,7 +317,7 @@ if (!$vhost['server']) { |
317 | 317 |
if ($have_v6) { |
318 | 318 |
$ipv6_address = ''; |
319 | 319 |
if ($vhost['id'] && ($vhost['autoipv6'] >0)) { |
320 |
- $ipv6_address = '<strong>IPv6-Adresse dieser Subdomain:</strong> '.autoipv6_address($vhost['id'], $vhost['autoipv6']); |
|
320 |
+ $ipv6_address = '<strong>IPv6-Adresse dieser Website:</strong> '.autoipv6_address($vhost['id'], $vhost['autoipv6']); |
|
321 | 321 |
} |
322 | 322 |
$checked = ($vhost['autoipv6'] > 0) ? ' checked="checked"' : ''; |
323 | 323 |
$checked2 = ($vhost['autoipv6'] == 2) ? ' checked="checked"' : ''; |
... | ... |
@@ -106,7 +106,7 @@ if (strstr($vhost['options'], 'aliaswww')) { |
106 | 106 |
} |
107 | 107 |
|
108 | 108 |
$form = " |
109 |
-<h4 style=\"margin-top: 2em;\">Name des VHost</h4> |
|
109 |
+<h4 style=\"margin-top: 2em;\">Adresse der Website</h4> |
|
110 | 110 |
<div style=\"margin-left: 2em;\"><input type=\"text\" name=\"hostname\" id=\"hostname\" size=\"10\" value=\"{$vhost['hostname']}\" /><strong>.</strong>".domainselect($vhost['domain_id']); |
111 | 111 |
$form .= "<br /> |
112 | 112 |
<input type=\"checkbox\" name=\"aliaswww\" id=\"aliaswww\" value=\"aliaswww\" {$s}/> <label for=\"aliaswww\">Auch mit <strong>www</strong> davor.</label><br/> |
... | ... |
@@ -146,6 +146,8 @@ $phpoptions = "<h5>PHP</h5> |
146 | 146 |
$options[$tag] = 'PHP '.$info['major'].'.'.$info['minor']; |
147 | 147 |
if ($info['status'] == 'deprecated') { |
148 | 148 |
$options[$tag] .= ' (veraltet)'; |
149 |
+ } elseif ($info['status'] == 'beta') { |
|
150 |
+ $options[$tag] .= ' (Testversion)'; |
|
149 | 151 |
} elseif ($info['status'] == 'used') { |
150 | 152 |
$options[$tag] .= ' (nur Bestandsschutz)'; |
151 | 153 |
} |
... | ... |
@@ -146,6 +146,8 @@ $phpoptions = "<h5>PHP</h5> |
146 | 146 |
$options[$tag] = 'PHP '.$info['major'].'.'.$info['minor']; |
147 | 147 |
if ($info['status'] == 'deprecated') { |
148 | 148 |
$options[$tag] .= ' (veraltet)'; |
149 |
+ } elseif ($info['status'] == 'used') { |
|
150 |
+ $options[$tag] .= ' (nur Bestandsschutz)'; |
|
149 | 151 |
} |
150 | 152 |
} |
151 | 153 |
$phpoptions = " |
... | ... |
@@ -140,7 +140,14 @@ $phpoptions = "<h5>PHP</h5> |
140 | 140 |
*/ |
141 | 141 |
//if ($vhost['php'] == 'php54') |
142 | 142 |
//{ |
143 |
- $options = array("none" => 'ausgeschaltet', "php56" => "PHP 5.6 (veraltet)", "fpm70" => "PHP 7.0 (auslaufend)", "fpm71" => "PHP 7.1", "fpm72" => "PHP 7.2"); |
|
143 |
+ $options = array("none" => 'ausgeschaltet'); |
|
144 |
+ $phpinfo = valid_php_versions(); |
|
145 |
+ foreach ($phpinfo as $tag => $info) { |
|
146 |
+ $options[$tag] = 'PHP '.$info['major'].'.'.$info['minor']; |
|
147 |
+ if ($info['status'] == 'deprecated') { |
|
148 |
+ $options[$tag] .= ' (veraltet)'; |
|
149 |
+ } |
|
150 |
+ } |
|
144 | 151 |
$phpoptions = " |
145 | 152 |
<h5>PHP</h5> |
146 | 153 |
<div style=\"margin-left: 2em;\"> |
... | ... |
@@ -8,7 +8,7 @@ Written 2008-2018 by schokokeks.org Hosting, namely |
8 | 8 |
|
9 | 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 | 10 |
|
11 |
-You should have received a copy of the CC0 Public Domain Dedication along with this software. If not, see |
|
11 |
+You should have received a copy of the CC0 Public Domain Dedication along with this software. If not, see |
|
12 | 12 |
http://creativecommons.org/publicdomain/zero/1.0/ |
13 | 13 |
|
14 | 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. |
... | ... |
@@ -29,68 +29,72 @@ require_role(ROLE_SYSTEMUSER); |
29 | 29 |
$id = (isset($_GET['vhost']) ? (int) $_GET['vhost'] : 0); |
30 | 30 |
$vhost = empty_vhost(); |
31 | 31 |
|
32 |
-if ($id != 0) |
|
33 |
- $vhost = get_vhost_details($id); |
|
32 |
+if ($id != 0) { |
|
33 |
+ $vhost = get_vhost_details($id); |
|
34 |
+} |
|
34 | 35 |
|
35 | 36 |
$have_v6 = false; |
36 | 37 |
$server = (isset($vhost['server']) ? $vhost['server'] : $_SESSION['userinfo']['server']); |
37 |
-if (ipv6_possible($server)) |
|
38 |
- $have_v6 = true; |
|
38 |
+if (ipv6_possible($server)) { |
|
39 |
+ $have_v6 = true; |
|
40 |
+} |
|
39 | 41 |
|
40 | 42 |
DEBUG($vhost); |
41 | 43 |
if ($id == 0) { |
42 |
- title("Neue Subdomain anlegen"); |
|
43 |
-} |
|
44 |
-else { |
|
45 |
- title("Subdomain bearbeiten"); |
|
44 |
+ title("Neue Subdomain anlegen"); |
|
45 |
+} else { |
|
46 |
+ title("Subdomain bearbeiten"); |
|
46 | 47 |
} |
47 | 48 |
|
48 | 49 |
$defaultdocroot = $vhost['domain']; |
49 | 50 |
if (! $vhost['domain']) { |
50 |
- $defaultdocroot = $_SESSION['userinfo']['username'].'.'.config('masterdomain'); |
|
51 |
+ $defaultdocroot = $_SESSION['userinfo']['username'].'.'.config('masterdomain'); |
|
51 | 52 |
} |
52 | 53 |
if ($vhost['domain_id'] == -1) { |
53 |
- $defaultdocroot = $_SESSION['userinfo']['username'].'.'.config('user_vhosts_domain'); |
|
54 |
+ $defaultdocroot = $_SESSION['userinfo']['username'].'.'.config('user_vhosts_domain'); |
|
55 |
+} |
|
56 |
+if ($vhost['hostname']) { |
|
57 |
+ $defaultdocroot = $vhost['hostname'].'.'.$defaultdocroot; |
|
54 | 58 |
} |
55 |
-if ($vhost['hostname']) |
|
56 |
- $defaultdocroot = $vhost['hostname'].'.'.$defaultdocroot; |
|
57 | 59 |
|
58 | 60 |
$defaultdocroot = $defaultdocroot.'/htdocs'; |
59 | 61 |
|
60 |
-$is_default_docroot = ($vhost['docroot'] == NULL) || ($vhost['homedir'].'/websites/'.$defaultdocroot == $vhost['docroot']); |
|
62 |
+$is_default_docroot = ($vhost['docroot'] == null) || ($vhost['homedir'].'/websites/'.$defaultdocroot == $vhost['docroot']); |
|
61 | 63 |
|
62 |
-if ($vhost['docroot'] != '' && ! strstr($vhost['docroot'], '/websites/')) |
|
63 |
-{ |
|
64 |
- warning("Sie verwenden einen Speicherplatz außerhalb von »~/websites/«. Diese Einstellung ist momentan nicht mehr gestattet. Ihre Einstellung wurde daher auf die Standardeinstellung zurückgesetzt. Prüfen Sie dies bitte und verschieben Sie ggf. ihre Dateien."); |
|
65 |
- $is_default_docroot = True; |
|
64 |
+if ($vhost['docroot'] != '' && ! strstr($vhost['docroot'], '/websites/')) { |
|
65 |
+ warning("Sie verwenden einen Speicherplatz außerhalb von »~/websites/«. Diese Einstellung ist momentan nicht mehr gestattet. Ihre Einstellung wurde daher auf die Standardeinstellung zurückgesetzt. Prüfen Sie dies bitte und verschieben Sie ggf. ihre Dateien."); |
|
66 |
+ $is_default_docroot = true; |
|
66 | 67 |
} |
67 | 68 |
|
68 | 69 |
$docroot = ''; |
69 |
-if ($is_default_docroot) |
|
70 |
- $docroot = $defaultdocroot; |
|
71 |
-else |
|
72 |
- $docroot = substr($vhost['docroot'], strlen($vhost['homedir'].'/websites/')); |
|
70 |
+if ($is_default_docroot) { |
|
71 |
+ $docroot = $defaultdocroot; |
|
72 |
+} else { |
|
73 |
+ $docroot = substr($vhost['docroot'], strlen($vhost['homedir'].'/websites/')); |
|
74 |
+} |
|
73 | 75 |
|
74 | 76 |
$s = (strstr($vhost['options'], 'aliaswww') ? ' checked="checked" ' : ''); |
75 | 77 |
$errorlog = ($vhost['errorlog'] == 1 ? ' checked="checked" ' : ''); |
76 | 78 |
|
77 | 79 |
$vhost_type = 'regular'; |
78 |
-if ($vhost['is_dav']) |
|
79 |
- $vhost_type = 'dav'; |
|
80 |
-elseif ($vhost['is_svn']) |
|
81 |
- $vhost_type = 'svn'; |
|
82 |
-elseif ($vhost['is_webapp']) |
|
83 |
- $vhost_type = 'webapp'; |
|
80 |
+if ($vhost['is_dav']) { |
|
81 |
+ $vhost_type = 'dav'; |
|
82 |
+} elseif ($vhost['is_svn']) { |
|
83 |
+ $vhost_type = 'svn'; |
|
84 |
+} elseif ($vhost['is_webapp']) { |
|
85 |
+ $vhost_type = 'webapp'; |
|
86 |
+} |
|
84 | 87 |
|
85 | 88 |
$applist = list_available_webapps(); |
86 | 89 |
$webapp_options = ''; |
87 |
-foreach ($applist as $app) |
|
88 |
- $webapp_options .= "<option value=\"{$app['id']}\">{$app['displayname']}</option>\n"; |
|
90 |
+foreach ($applist as $app) { |
|
91 |
+ $webapp_options .= "<option value=\"{$app['id']}\">{$app['displayname']}</option>\n"; |
|
92 |
+} |
|
89 | 93 |
|
90 | 94 |
$aliaswww_options = array("forwardwww" => "Umleiten auf www-Subdomain", "forwardnowww" => "Umleiten auf Stammdomain (ohne www)", "noforward" => "Keine Umleitung"); |
91 | 95 |
$aliaswww_option = 'forwardwww'; |
92 | 96 |
if (strstr($vhost['options'], 'aliaswww')) { |
93 |
- // Wenn aliaswww gar nicht gesetzt war, dann soll die select-Option für forwardwww trotzdem auf dem default stehen. |
|
97 |
+ // Wenn aliaswww gar nicht gesetzt war, dann soll die select-Option für forwardwww trotzdem auf dem default stehen. |
|
94 | 98 |
// Ist nicht sichtbar und wird beim Speichern auch wieder entfernt |
95 | 99 |
if (strstr($vhost['options'], 'forwardwww')) { |
96 | 100 |
$aliaswww_option = 'forwardwww'; |
... | ... |
@@ -172,11 +176,10 @@ $form .= " |
172 | 176 |
<div style=\"margin-left: 2em;\"> |
173 | 177 |
<input class=\"usageoption\" type=\"radio\" name=\"vhost_type\" id=\"vhost_type_regular\" value=\"regular\" ".(($vhost_type=='regular') ? 'checked="checked" ' : '')."/><label for=\"vhost_type_regular\"> Normal (selbst Dateien hinterlegen)</label><br /> |
174 | 178 |
"; |
175 |
-if ($vhost_type=='webapp') |
|
176 |
-{ |
|
177 |
- // Wird nur noch angezeigt wenn der Vhost schon auf webapp konfiguriert ist, ansonsten nicht. |
|
178 |
- // Die User sollen den Webapp-Installer benutzen. |
|
179 |
- $form .= " |
|
179 |
+if ($vhost_type=='webapp') { |
|
180 |
+ // Wird nur noch angezeigt wenn der Vhost schon auf webapp konfiguriert ist, ansonsten nicht. |
|
181 |
+ // Die User sollen den Webapp-Installer benutzen. |
|
182 |
+ $form .= " |
|
180 | 183 |
<input class=\"usageoption\" type=\"radio\" name=\"vhost_type\" id=\"vhost_type_webapp\" value=\"webapp\" ".(($vhost_type=='webapp') ? 'checked="checked" ' : '')."/><label for=\"vhost_type_webapp\"> Eine vorgefertigte Applikation nutzen</label><br /> |
181 | 184 |
"; |
182 | 185 |
} |
... | ... |
@@ -184,7 +187,7 @@ $hsts_value = $vhost['hsts']; |
184 | 187 |
$hsts_preset_values = array("-1" => "aus", "86400" => "1 Tag", "2592000" => "30 Tage", "31536000" => "1 Jahr", "63072000" => "2 Jahre", "custom" => "Individuell"); |
185 | 188 |
$hsts_preset_value = 'custom'; |
186 | 189 |
if (isset($hsts_preset_values[$hsts_value])) { |
187 |
- $hsts_preset_value = $hsts_value; |
|
190 |
+ $hsts_preset_value = $hsts_value; |
|
188 | 191 |
} |
189 | 192 |
$form .= " |
190 | 193 |
<input class=\"usageoption\" type=\"radio\" name=\"vhost_type\" id=\"vhost_type_dav\" value=\"dav\" ".(($vhost_type=='dav') ? 'checked="checked" ' : '')."/><label for=\"vhost_type_dav\"> WebDAV</label><br /> |
... | ... |
@@ -200,7 +203,7 @@ $form .= " |
200 | 203 |
<h5>Sichere Verbindung erzwingen</h5> |
201 | 204 |
<div style=\"margin-left: 2em;\"> |
202 | 205 |
<select name=\"ssl\" id=\"ssl\"> |
203 |
- <option value=\"none\" ".($vhost['ssl'] == NULL ? 'selected="selected"' : '')." >Nein</option> |
|
206 |
+ <option value=\"none\" ".($vhost['ssl'] == null ? 'selected="selected"' : '')." >Nein</option> |
|
204 | 207 |
".($vhost['ssl'] == 'http' ? "<option value=\"http\" selected=\"selected\">kein HTTPS anbieten</option>" : '')." |
205 | 208 |
".($vhost['ssl'] == 'https' ? "<option value=\"https\" selected=\"selected\">Konfiguration nur für HTTPS verwenden</option>" : '')." |
206 | 209 |
<option value=\"forward\" ".($vhost['ssl'] == 'forward' ? 'selected="selected"' : '')." >Ja, immer auf HTTPS umleiten</option> |
... | ... |
@@ -216,8 +219,7 @@ $certselect[0] = 'kein Zertifikat / System-Standard benutzen'; |
216 | 219 |
if ($vhost_type != 'dav' && $vhost_type != 'svn') { |
217 | 220 |
$certselect[-1] = 'Automatische Zertifikatsverwaltung mit Let\'s Encrypt'; |
218 | 221 |
} |
219 |
-foreach ($certs as $c) |
|
220 |
-{ |
|
222 |
+foreach ($certs as $c) { |
|
221 | 223 |
if (! cert_is_letsencrypt($c['id'])) { |
222 | 224 |
$certselect[$c['id']] = $c['subject']; |
223 | 225 |
} |
... | ... |
@@ -237,7 +239,6 @@ if (count($certselect) > 1) { |
237 | 239 |
automatisch in den für jeden zugänglichen Certificate-Transparency-Logs abgelegt. |
238 | 240 |
Die zugehörigen Subdomains sind damit auch öffentlich. |
239 | 241 |
Sie können die Logs mit dem Service <a href=\"https://crt.sh/\">crt.sh</a> durchsuchen.</p>"; |
240 |
- |
|
241 | 242 |
} else { |
242 | 243 |
$form .= "<h5>Verwendetes Zertifikat</h5> |
243 | 244 |
<div style=\"margin-left: 2em;\"><p>Für Sonderanwendungen (WebDAV, SVN) kann momentan kein Lets-Encrypt-Zertifikat verwaltet werden. Bitte beschaffen Sie ggf. ein Zertifikat und tragen Sie dieses unten auf der Websites-Übersichtsseite ein, damit es hier ausgewählt werden kann.</p></div>"; |
... | ... |
@@ -246,12 +247,12 @@ $form.=" |
246 | 247 |
<h5>Logfiles</h5> |
247 | 248 |
<div style=\"margin-left: 2em;\"> |
248 | 249 |
<select name=\"logtype\" id=\"logtype\"> |
249 |
- <option value=\"none\" ".($vhost['logtype'] == NULL ? 'selected="selected"' : '')." >keine Logfiles</option> |
|
250 |
+ <option value=\"none\" ".($vhost['logtype'] == null ? 'selected="selected"' : '')." >keine Logfiles</option> |
|
250 | 251 |
<option value=\"anonymous\" ".($vhost['logtype'] == 'anonymous' ? 'selected="selected"' : '')." >anonymisiert</option> |
251 | 252 |
<option value=\"default\" ".($vhost['logtype'] == 'default' ? 'selected="selected"' : '')." >vollständige Logfile</option> |
252 | 253 |
</select><br /> |
253 | 254 |
<input type=\"checkbox\" id=\"errorlog\" name=\"errorlog\" value=\"1\" ".($vhost['errorlog'] == 1 ? ' checked="checked" ' : '')." /> <label for=\"errorlog\">Fehlerprotokoll (error_log) einschalten</label><br /> |
254 |
- <input type=\"checkbox\" id=\"stats\" name=\"stats\" value=\"1\" ".($vhost['stats'] != NULL ? ' checked="checked" ' : '')." /> <label for=\"stats\">Statistiken/Auswertungen erzeugen</label> |
|
255 |
+ <input type=\"checkbox\" id=\"stats\" name=\"stats\" value=\"1\" ".($vhost['stats'] != null ? ' checked="checked" ' : '')." /> <label for=\"stats\">Statistiken/Auswertungen erzeugen</label> |
|
255 | 256 |
</div> |
256 | 257 |
<p>Logfiles werden unter <b>/var/log/apache2/".$_SESSION['userinfo']['username']."</b> abgelegt.</p> |
257 | 258 |
"; |
... | ... |
@@ -265,57 +266,51 @@ $available_servers = array_unique($available_servers); |
265 | 266 |
$selectable_servers = array(); |
266 | 267 |
$all_servers = server_names(); |
267 | 268 |
foreach ($all_servers as $id => $fqdn) { |
268 |
- if (in_array($id, $available_servers)) { |
|
269 |
- $selectable_servers[$id] = $fqdn; |
|
270 |
- } |
|
269 |
+ if (in_array($id, $available_servers)) { |
|
270 |
+ $selectable_servers[$id] = $fqdn; |
|
271 |
+ } |
|
271 | 272 |
} |
272 | 273 |
if (!$vhost['server']) { |
273 |
- $vhost['server'] = my_server_id(); |
|
274 |
+ $vhost['server'] = my_server_id(); |
|
274 | 275 |
} |
275 | 276 |
|
276 |
- if (count($ipaddrs)) |
|
277 |
- { |
|
278 |
- $ipselect = array(0 => 'System-Standard'); |
|
279 |
- foreach ($ipaddrs AS $i) |
|
280 |
- { |
|
281 |
- $ipselect[$i] = $i; |
|
282 |
- } |
|
283 |
- $form .= " |
|
277 |
+ if (count($ipaddrs)) { |
|
278 |
+ $ipselect = array(0 => 'System-Standard'); |
|
279 |
+ foreach ($ipaddrs as $i) { |
|
280 |
+ $ipselect[$i] = $i; |
|
281 |
+ } |
|
282 |
+ $form .= " |
|
284 | 283 |
<h5>IP-Adresse</h5> |
285 | 284 |
<div style=\"margin-left: 2em;\"> |
286 | 285 |
".html_select('ipv4', $ipselect, $vhost['ipv4'])." |
287 | 286 |
</div>"; |
288 |
- } |
|
289 |
- if (count($available_users)) |
|
290 |
- { |
|
291 |
- $userselect = array(0 => 'Eigener Benutzeraccount'); |
|
292 |
- foreach ($available_users AS $u) |
|
293 |
- { |
|
294 |
- $userselect[$u['uid']] = $u['username']; |
|
295 |
- } |
|
296 |
- $form .= " |
|
287 |
+ } |
|
288 |
+ if (count($available_users)) { |
|
289 |
+ $userselect = array(0 => 'Eigener Benutzeraccount'); |
|
290 |
+ foreach ($available_users as $u) { |
|
291 |
+ $userselect[$u['uid']] = $u['username']; |
|
292 |
+ } |
|
293 |
+ $form .= " |
|
297 | 294 |
<h5>SuExec-Benutzeraccount</h5> |
298 | 295 |
<div style=\"margin-left: 2em;\"> |
299 | 296 |
".html_select('suexec_user', $userselect, $vhost['suexec_user'])." |
300 | 297 |
</div>"; |
301 | 298 |
} |
302 |
- if (count($available_servers) > 1) |
|
303 |
- { |
|
304 |
- $form .= " |
|
299 |
+ if (count($available_servers) > 1) { |
|
300 |
+ $form .= " |
|
305 | 301 |
<h5>Einrichten auf Server</h5> |
306 | 302 |
<div style=\"margin-left: 2em;\"> |
307 | 303 |
".html_select('server', $selectable_servers, $vhost['server'])." |
308 | 304 |
</div>"; |
309 |
- |
|
310 | 305 |
} |
311 |
-if ($have_v6) |
|
312 |
-{ |
|
313 |
- $ipv6_address = ''; |
|
314 |
- if ($vhost['id'] && ($vhost['autoipv6'] >0 )) |
|
315 |
- $ipv6_address = '<strong>IPv6-Adresse dieser Subdomain:</strong> '.autoipv6_address($vhost['id'], $vhost['autoipv6']); |
|
316 |
- $checked = ($vhost['autoipv6'] > 0) ? ' checked="checked"' : ''; |
|
317 |
- $checked2 = ($vhost['autoipv6'] == 2) ? ' checked="checked"' : ''; |
|
318 |
- $form .= '<h5>IPv6</h5> |
|
306 |
+if ($have_v6) { |
|
307 |
+ $ipv6_address = ''; |
|
308 |
+ if ($vhost['id'] && ($vhost['autoipv6'] >0)) { |
|
309 |
+ $ipv6_address = '<strong>IPv6-Adresse dieser Subdomain:</strong> '.autoipv6_address($vhost['id'], $vhost['autoipv6']); |
|
310 |
+ } |
|
311 |
+ $checked = ($vhost['autoipv6'] > 0) ? ' checked="checked"' : ''; |
|
312 |
+ $checked2 = ($vhost['autoipv6'] == 2) ? ' checked="checked"' : ''; |
|
313 |
+ $form .= '<h5>IPv6</h5> |
|
319 | 314 |
<div style="margin-left: 2em;"> |
320 | 315 |
<input type="checkbox" name="ipv6" id="ipv6" value="yes" '.$checked.'/> <label for="ipv6">Auch über IPv6 erreichbar machen</label><br /> |
321 | 316 |
<input type="checkbox" name="ipv6_separate" id="ipv6_separate" value="yes" '.$checked2.'/> <label for="ipv6_separate">Für diese Website eine eigene IPv6-Adresse reservieren</label><br /> |
... | ... |
@@ -329,6 +324,3 @@ $form .= ' |
329 | 324 |
<p><input type="submit" value="Speichern" />    '.internal_link('vhosts', 'Abbrechen').'</p> |
330 | 325 |
'; |
331 | 326 |
output(html_form('vhosts_edit_vhost', 'save', 'action=edit&vhost='.$vhost['id'], $form)); |
332 |
- |
|
333 |
- |
|
334 |
-?> |
... | ... |
@@ -210,34 +210,40 @@ $form .= " |
210 | 210 |
</span> |
211 | 211 |
</div>"; |
212 | 212 |
|
213 |
- $certs = user_certs(); |
|
214 |
- $certselect = array(); |
|
215 |
- $certselect[0] = 'kein Zertifikat / System-Standard benutzen'; |
|
216 |
- if ($vhost_type != 'dav' && $vhost_type != 'svn') { |
|
217 |
- $certselect[-1] = 'Automatische Zertifikatsverwaltung mit Let\'s Encrypt'; |
|
218 |
- } |
|
219 |
- foreach ($certs as $c) |
|
220 |
- { |
|
213 |
+$certs = user_certs(); |
|
214 |
+$certselect = array(); |
|
215 |
+$certselect[0] = 'kein Zertifikat / System-Standard benutzen'; |
|
216 |
+if ($vhost_type != 'dav' && $vhost_type != 'svn') { |
|
217 |
+ $certselect[-1] = 'Automatische Zertifikatsverwaltung mit Let\'s Encrypt'; |
|
218 |
+} |
|
219 |
+foreach ($certs as $c) |
|
220 |
+{ |
|
221 | 221 |
if (! cert_is_letsencrypt($c['id'])) { |
222 | 222 |
$certselect[$c['id']] = $c['subject']; |
223 | 223 |
} |
224 |
- } |
|
225 |
- if (strstr($vhost['options'], 'letsencrypt')) { |
|
224 |
+} |
|
225 |
+if (strstr($vhost['options'], 'letsencrypt')) { |
|
226 | 226 |
$vhost['certid'] = -1; |
227 |
- } |
|
228 |
- $form .= " |
|
229 |
- <h5>verwendetes Zertifikat</h5> |
|
230 |
- <div style=\"margin-left: 2em;\"> |
|
231 |
- ".html_select('cert', $certselect, $vhost['certid'])." |
|
232 |
-</div> |
|
233 |
-<p class=\"warning\"><b>Datenschutz-Hinweis:</b><br> |
|
234 |
-Alle erstellten HTTPS-Zertifikate werden |
|
235 |
-automatisch in den für jeden zugänglichen Certificate-Transparency-Logs abgelegt. |
|
236 |
-Die zugehörigen Subdomains sind damit auch öffentlich. |
|
237 |
-Sie können die Logs mit dem Service <a href=\"https://crt.sh/\">crt.sh</a> durchsuchen.</p>"; |
|
238 |
- |
|
239 |
- $form.=" |
|
240 |
- <h5>Logfiles</h5> |
|
227 |
+} |
|
228 |
+if (count($certselect) > 1) { |
|
229 |
+ // Nur dann gibt es was zum Auswählen |
|
230 |
+ $form .= " |
|
231 |
+ <h5>Verwendetes Zertifikat</h5> |
|
232 |
+ <div style=\"margin-left: 2em;\"> |
|
233 |
+ ".html_select('cert', $certselect, $vhost['certid'])." |
|
234 |
+ </div> |
|
235 |
+ <p class=\"warning\"><b>Datenschutz-Hinweis:</b><br> |
|
236 |
+ Alle erstellten HTTPS-Zertifikate werden |
|
237 |
+ automatisch in den für jeden zugänglichen Certificate-Transparency-Logs abgelegt. |
|
238 |
+ Die zugehörigen Subdomains sind damit auch öffentlich. |
|
239 |
+ Sie können die Logs mit dem Service <a href=\"https://crt.sh/\">crt.sh</a> durchsuchen.</p>"; |
|
240 |
+ |
|
241 |
+} else { |
|
242 |
+ $form .= "<h5>Verwendetes Zertifikat</h5> |
|
243 |
+ <div style=\"margin-left: 2em;\"><p>Für Sonderanwendungen (WebDAV, SVN) kann momentan kein Lets-Encrypt-Zertifikat verwaltet werden. Bitte beschaffen Sie ggf. ein Zertifikat und tragen Sie dieses unten auf der Websites-Übersichtsseite ein, damit es hier ausgewählt werden kann.</p></div>"; |
|
244 |
+} |
|
245 |
+$form.=" |
|
246 |
+<h5>Logfiles</h5> |
|
241 | 247 |
<div style=\"margin-left: 2em;\"> |
242 | 248 |
<select name=\"logtype\" id=\"logtype\"> |
243 | 249 |
<option value=\"none\" ".($vhost['logtype'] == NULL ? 'selected="selected"' : '')." >keine Logfiles</option> |
... | ... |
@@ -211,10 +211,16 @@ $form .= " |
211 | 211 |
</div>"; |
212 | 212 |
|
213 | 213 |
$certs = user_certs(); |
214 |
- $certselect = array(0 => 'kein Zertifikat / System-Standard benutzen', -1 => 'Automatische Zertifikatsverwaltung mit Let\'s Encrypt'); |
|
214 |
+ $certselect = array(); |
|
215 |
+ $certselect[0] = 'kein Zertifikat / System-Standard benutzen'; |
|
216 |
+ if ($vhost_type != 'dav' && $vhost_type != 'svn') { |
|
217 |
+ $certselect[-1] = 'Automatische Zertifikatsverwaltung mit Let\'s Encrypt'; |
|
218 |
+ } |
|
215 | 219 |
foreach ($certs as $c) |
216 | 220 |
{ |
217 |
- $certselect[$c['id']] = $c['subject']; |
|
221 |
+ if (! cert_is_letsencrypt($c['id'])) { |
|
222 |
+ $certselect[$c['id']] = $c['subject']; |
|
223 |
+ } |
|
218 | 224 |
} |
219 | 225 |
if (strstr($vhost['options'], 'letsencrypt')) { |
220 | 226 |
$vhost['certid'] = -1; |
... | ... |
@@ -136,7 +136,7 @@ $phpoptions = "<h5>PHP</h5> |
136 | 136 |
*/ |
137 | 137 |
//if ($vhost['php'] == 'php54') |
138 | 138 |
//{ |
139 |
- $options = array("none" => 'ausgeschaltet', "php56" => "PHP 5.6 (veraltet)", "fpm70" => "PHP 7.0", "fpm71" => "PHP 7.1", "fpm72" => "PHP 7.2 (beta)"); |
|
139 |
+ $options = array("none" => 'ausgeschaltet', "php56" => "PHP 5.6 (veraltet)", "fpm70" => "PHP 7.0 (auslaufend)", "fpm71" => "PHP 7.1", "fpm72" => "PHP 7.2"); |
|
140 | 140 |
$phpoptions = " |
141 | 141 |
<h5>PHP</h5> |
142 | 142 |
<div style=\"margin-left: 2em;\"> |
... | ... |
@@ -136,7 +136,7 @@ $phpoptions = "<h5>PHP</h5> |
136 | 136 |
*/ |
137 | 137 |
//if ($vhost['php'] == 'php54') |
138 | 138 |
//{ |
139 |
- $options = array("none" => 'ausgeschaltet', "php56" => "PHP 5.6", "fpm70" => "PHP 7.0", "fpm71" => "PHP 7.1"); |
|
139 |
+ $options = array("none" => 'ausgeschaltet', "php56" => "PHP 5.6 (veraltet)", "fpm70" => "PHP 7.0", "fpm71" => "PHP 7.1", "fpm72" => "PHP 7.2 (beta)"); |
|
140 | 140 |
$phpoptions = " |
141 | 141 |
<h5>PHP</h5> |
142 | 142 |
<div style=\"margin-left: 2em;\"> |
... | ... |
@@ -87,25 +87,26 @@ $webapp_options = ''; |
87 | 87 |
foreach ($applist as $app) |
88 | 88 |
$webapp_options .= "<option value=\"{$app['id']}\">{$app['displayname']}</option>\n"; |
89 | 89 |
|
90 |
+$aliaswww_options = array("forwardwww" => "Umleiten auf www-Subdomain", "forwardnowww" => "Umleiten auf Stammdomain (ohne www)", "noforward" => "Keine Umleitung"); |
|
91 |
+$aliaswww_option = 'forwardwww'; |
|
92 |
+if (strstr($vhost['options'], 'aliaswww')) { |
|
93 |
+ // Wenn aliaswww gar nicht gesetzt war, dann soll die select-Option für forwardwww trotzdem auf dem default stehen. |
|
94 |
+ // Ist nicht sichtbar und wird beim Speichern auch wieder entfernt |
|
95 |
+ if (strstr($vhost['options'], 'forwardwww')) { |
|
96 |
+ $aliaswww_option = 'forwardwww'; |
|
97 |
+ } elseif (strstr($vhost['options'], 'forwardnowww')) { |
|
98 |
+ $aliaswww_option = 'forwardnowww'; |
|
99 |
+ } else { |
|
100 |
+ $aliaswww_option = 'noforward'; |
|
101 |
+ } |
|
102 |
+} |
|
90 | 103 |
|
91 | 104 |
$form = " |
92 | 105 |
<h4 style=\"margin-top: 2em;\">Name des VHost</h4> |
93 | 106 |
<div style=\"margin-left: 2em;\"><input type=\"text\" name=\"hostname\" id=\"hostname\" size=\"10\" value=\"{$vhost['hostname']}\" /><strong>.</strong>".domainselect($vhost['domain_id']); |
94 | 107 |
$form .= "<br /> |
95 |
- <input type=\"checkbox\" name=\"options[]\" id=\"aliaswww\" value=\"aliaswww\" {$s}/> <label for=\"aliaswww\">Auch mit <strong>www</strong> davor.</label><br/> |
|
96 |
-<span class=\"buttonset ui-buttonset\" id=\"buttonset-aliaswww\"> |
|
97 |
- <input type=\"radio\" name=\"aliaswww\" id=\"aliaswww_forwardwww\" value=\"forwardwww\"/><label for=\"aliaswww_forwardwww\">Auf www-Präfix umleiten</label> |
|
98 |
- <input type=\"radio\" name=\"aliaswww\" id=\"aliaswww_forwardnowww\" value=\"forwardnowww\"/><label for=\"aliaswww_forwardnowww\">www-Präfix auf Stammdomain umleiten</label> |
|
99 |
- <input type=\"radio\" name=\"aliaswww\" id=\"aliaswww_aliaswww\" value=\"aliaswww\"/><label for=\"aliaswww_aliaswww\">www-Präfix als Alias einrichten</label> |
|
100 |
- <input type=\"radio\" name=\"aliaswww\" id=\"aliaswww_nowww\" value=\"nowww\"/><label for=\"aliaswww_nowww\">Kein www-Präfix erzeugen</label> |
|
101 |
- </span><br/> |
|
102 |
- <label for=\"aliaswww\">Soll auch ein www-Präfix erzeugt werden?</label> <select name=\"aliaswww\" id=\"aliaswww\"> |
|
103 |
- <option value=\"forwardwww\">Auf www-Präfix umleiten</option> |
|
104 |
- <option value=\"forwardnowww\">www-Präfix auf Stammdomain umleiten</option> |
|
105 |
- <option value=\"aliaswww\">www-Präfix als Alias einrichten</option> |
|
106 |
- <option value=\"nowww\">Kein www-Präfix erzeugen</option> |
|
107 |
- </select> |
|
108 |
- |
|
108 |
+ <input type=\"checkbox\" name=\"aliaswww\" id=\"aliaswww\" value=\"aliaswww\" {$s}/> <label for=\"aliaswww\">Auch mit <strong>www</strong> davor.</label><br/> |
|
109 |
+ <span id=\"aliaswww_option\"><label for=\"forwardwww\">Umleitungs-Option </label>".html_select('forwardwww', $aliaswww_options, $aliaswww_option)."</span><br /> |
|
109 | 110 |
</div> |
110 | 111 |
<div class=\"vhostsidebyside\"> |
111 | 112 |
<div class=\"vhostoptions\" id=\"options_docroot\" ".($vhost_type=='regular' || $vhost_type=='dav' ? '' : 'style="display: none;"')."> |
... | ... |
@@ -91,7 +91,9 @@ foreach ($applist as $app) |
91 | 91 |
$form = " |
92 | 92 |
<h4 style=\"margin-top: 2em;\">Name des VHost</h4> |
93 | 93 |
<div style=\"margin-left: 2em;\"><input type=\"text\" name=\"hostname\" id=\"hostname\" size=\"10\" value=\"{$vhost['hostname']}\" /><strong>.</strong>".domainselect($vhost['domain_id']); |
94 |
-$form .= "<br /><span class=\"buttonset ui-buttonset\" id=\"buttonset-aliaswww\"> |
|
94 |
+$form .= "<br /> |
|
95 |
+ <input type=\"checkbox\" name=\"options[]\" id=\"aliaswww\" value=\"aliaswww\" {$s}/> <label for=\"aliaswww\">Auch mit <strong>www</strong> davor.</label><br/> |
|
96 |
+<span class=\"buttonset ui-buttonset\" id=\"buttonset-aliaswww\"> |
|
95 | 97 |
<input type=\"radio\" name=\"aliaswww\" id=\"aliaswww_forwardwww\" value=\"forwardwww\"/><label for=\"aliaswww_forwardwww\">Auf www-Präfix umleiten</label> |
96 | 98 |
<input type=\"radio\" name=\"aliaswww\" id=\"aliaswww_forwardnowww\" value=\"forwardnowww\"/><label for=\"aliaswww_forwardnowww\">www-Präfix auf Stammdomain umleiten</label> |
97 | 99 |
<input type=\"radio\" name=\"aliaswww\" id=\"aliaswww_aliaswww\" value=\"aliaswww\"/><label for=\"aliaswww_aliaswww\">www-Präfix als Alias einrichten</label> |
... | ... |
@@ -91,8 +91,20 @@ foreach ($applist as $app) |
91 | 91 |
$form = " |
92 | 92 |
<h4 style=\"margin-top: 2em;\">Name des VHost</h4> |
93 | 93 |
<div style=\"margin-left: 2em;\"><input type=\"text\" name=\"hostname\" id=\"hostname\" size=\"10\" value=\"{$vhost['hostname']}\" /><strong>.</strong>".domainselect($vhost['domain_id']); |
94 |
-$form .= "<br /><input type=\"checkbox\" name=\"options[]\" id=\"aliaswww\" value=\"aliaswww\" {$s}/> <label for=\"aliaswww\">Auch mit <strong>www</strong> davor.</label></div> |
|
95 |
- |
|
94 |
+$form .= "<br /><span class=\"buttonset ui-buttonset\" id=\"buttonset-aliaswww\"> |
|
95 |
+ <input type=\"radio\" name=\"aliaswww\" id=\"aliaswww_forwardwww\" value=\"forwardwww\"/><label for=\"aliaswww_forwardwww\">Auf www-Präfix umleiten</label> |
|
96 |
+ <input type=\"radio\" name=\"aliaswww\" id=\"aliaswww_forwardnowww\" value=\"forwardnowww\"/><label for=\"aliaswww_forwardnowww\">www-Präfix auf Stammdomain umleiten</label> |
|
97 |
+ <input type=\"radio\" name=\"aliaswww\" id=\"aliaswww_aliaswww\" value=\"aliaswww\"/><label for=\"aliaswww_aliaswww\">www-Präfix als Alias einrichten</label> |
|
98 |
+ <input type=\"radio\" name=\"aliaswww\" id=\"aliaswww_nowww\" value=\"nowww\"/><label for=\"aliaswww_nowww\">Kein www-Präfix erzeugen</label> |
|
99 |
+ </span><br/> |
|
100 |
+ <label for=\"aliaswww\">Soll auch ein www-Präfix erzeugt werden?</label> <select name=\"aliaswww\" id=\"aliaswww\"> |
|
101 |
+ <option value=\"forwardwww\">Auf www-Präfix umleiten</option> |
|
102 |
+ <option value=\"forwardnowww\">www-Präfix auf Stammdomain umleiten</option> |
|
103 |
+ <option value=\"aliaswww\">www-Präfix als Alias einrichten</option> |
|
104 |
+ <option value=\"nowww\">Kein www-Präfix erzeugen</option> |
|
105 |
+ </select> |
|
106 |
+ |
|
107 |
+</div> |
|
96 | 108 |
<div class=\"vhostsidebyside\"> |
97 | 109 |
<div class=\"vhostoptions\" id=\"options_docroot\" ".($vhost_type=='regular' || $vhost_type=='dav' ? '' : 'style="display: none;"')."> |
98 | 110 |
<h4>Optionen</h4> |
... | ... |
@@ -189,7 +189,9 @@ $form .= " |
189 | 189 |
".($vhost['ssl'] == 'http' ? "<option value=\"http\" selected=\"selected\">kein HTTPS anbieten</option>" : '')." |
190 | 190 |
".($vhost['ssl'] == 'https' ? "<option value=\"https\" selected=\"selected\">Konfiguration nur für HTTPS verwenden</option>" : '')." |
191 | 191 |
<option value=\"forward\" ".($vhost['ssl'] == 'forward' ? 'selected="selected"' : '')." >Ja, immer auf HTTPS umleiten</option> |
192 |
- </select> <span id=\"hsts_block\" style=\"padding-top: 0.2em;\"> <label for=\"hsts\"><a title=\"Mit HSTS können Sie festlegen, dass eine bestimmte Website niemals ohne Verschlüsselung aufgerufen werden soll. Zudem werden Zertifikate strenger geprüft.\" href=\"https://de.wikipedia.org/wiki/HTTP_Strict_Transport_Security\">HSTS</a>:</label> <span id=\"hsts_select\" style=\"display: none\">".html_select('hsts_preset', $hsts_preset_values, $hsts_preset_value)."</span> <span id=\"hsts_seconds\"><input type=\"text\" name=\"hsts\" id=\"hsts\" size=\"10\" style=\"text-align: right;\" value=\"{$hsts_value}\" /> Sekunden</span> |
|
192 |
+ </select> <span id=\"hsts_block\" style=\"padding-top: 0.2em;\"> <label for=\"hsts\"><a title=\"Mit HSTS können Sie festlegen, dass eine bestimmte Website niemals ohne Verschlüsselung aufgerufen werden soll. Zudem werden Zertifikate strenger geprüft.\" href=\"https://de.wikipedia.org/wiki/HTTP_Strict_Transport_Security\">HSTS</a>:</label> <span id=\"hsts_select\" style=\"display: none\">".html_select('hsts_preset', $hsts_preset_values, $hsts_preset_value)."</span> <span id=\"hsts_seconds\"><input type=\"text\" name=\"hsts\" id=\"hsts\" size=\"10\" style=\"text-align: right;\" value=\"{$hsts_value}\" /> Sekunden</span><br /> |
|
193 |
+ <span id=\"hsts_preload_options\"><input type=\"checkbox\" id=\"hsts_subdomains\" name=\"hsts_subdomains\" value=\"1\" ".(strstr($vhost['options'], 'hsts_subdomains') ? 'checked="checked"' : '')."/> <label for=\"hsts_subdomains\">Einschließlich aller Subdomains</label><br /> |
|
194 |
+ <input type=\"checkbox\" id=\"hsts_preload\" name=\"hsts_preload\" value=\"1\" ".(strstr($vhost['options'], 'hsts_preload') ? 'checked="checked"' : '')."/> <label for=\"hsts_preload\">Diese Domain soll in die Preload-Liste aufgenommen werden (diese Option setzt den <em>preload</em>-Parameter)</label></span> |
|
193 | 195 |
</span> |
194 | 196 |
</div>"; |
195 | 197 |
|
... | ... |
@@ -189,7 +189,7 @@ $form .= " |
189 | 189 |
".($vhost['ssl'] == 'http' ? "<option value=\"http\" selected=\"selected\">kein HTTPS anbieten</option>" : '')." |
190 | 190 |
".($vhost['ssl'] == 'https' ? "<option value=\"https\" selected=\"selected\">Konfiguration nur für HTTPS verwenden</option>" : '')." |
191 | 191 |
<option value=\"forward\" ".($vhost['ssl'] == 'forward' ? 'selected="selected"' : '')." >Ja, immer auf HTTPS umleiten</option> |
192 |
- </select> <span id=\"hsts_block\" style=\"padding-top: 0.2em;\"> <label for=\"hsts\"><a title=\"Mit HSTS können Sie festlegen, dass eine bestimmte Website niemals ohne Verschlüsselung aufgerufen werden soll. Zudem werden Zertifikate strenger geprüft.\" href=\"https://de.wikipedia.org/wiki/Hypertext_Transfer_Protocol_Secure#HSTS\">HSTS</a>:</label> <span id=\"hsts_select\" style=\"display: none\">".html_select('hsts_preset', $hsts_preset_values, $hsts_preset_value)."</span> <span id=\"hsts_seconds\"><input type=\"text\" name=\"hsts\" id=\"hsts\" size=\"10\" style=\"text-align: right;\" value=\"{$hsts_value}\" /> Sekunden</span> |
|
192 |
+ </select> <span id=\"hsts_block\" style=\"padding-top: 0.2em;\"> <label for=\"hsts\"><a title=\"Mit HSTS können Sie festlegen, dass eine bestimmte Website niemals ohne Verschlüsselung aufgerufen werden soll. Zudem werden Zertifikate strenger geprüft.\" href=\"https://de.wikipedia.org/wiki/HTTP_Strict_Transport_Security\">HSTS</a>:</label> <span id=\"hsts_select\" style=\"display: none\">".html_select('hsts_preset', $hsts_preset_values, $hsts_preset_value)."</span> <span id=\"hsts_seconds\"><input type=\"text\" name=\"hsts\" id=\"hsts\" size=\"10\" style=\"text-align: right;\" value=\"{$hsts_value}\" /> Sekunden</span> |
|
193 | 193 |
</span> |
194 | 194 |
</div>"; |
195 | 195 |
|
... | ... |
@@ -189,7 +189,7 @@ $form .= " |
189 | 189 |
".($vhost['ssl'] == 'http' ? "<option value=\"http\" selected=\"selected\">kein HTTPS anbieten</option>" : '')." |
190 | 190 |
".($vhost['ssl'] == 'https' ? "<option value=\"https\" selected=\"selected\">Konfiguration nur für HTTPS verwenden</option>" : '')." |
191 | 191 |
<option value=\"forward\" ".($vhost['ssl'] == 'forward' ? 'selected="selected"' : '')." >Ja, immer auf HTTPS umleiten</option> |
192 |
- </select> <span id=\"hsts_block\" style=\"padding-top: 0.2em;\"> <label for=\"hsts\"><a title=\"Mit HSTS können Sie festlegen, dass eine bestimmte Website niemals ohne Verschlüsselung aufgerufen werden soll. Zudem werden Zertifikate strenger geprüft.\" href=\"https://de.wikipedia.org/wiki/Hypertext_Transfer_Protocol_Secure#HSTS\">HSTS</a>:</label> ".html_select('hsts_preset', $hsts_preset_values, $hsts_preset_value)." <span id=\"hsts_seconds\"><input type=\"text\" name=\"hsts\" id=\"hsts\" size=\"10\" style=\"text-align: right;\" value=\"{$hsts_value}\" /> Sekunden</span> |
|
192 |
+ </select> <span id=\"hsts_block\" style=\"padding-top: 0.2em;\"> <label for=\"hsts\"><a title=\"Mit HSTS können Sie festlegen, dass eine bestimmte Website niemals ohne Verschlüsselung aufgerufen werden soll. Zudem werden Zertifikate strenger geprüft.\" href=\"https://de.wikipedia.org/wiki/Hypertext_Transfer_Protocol_Secure#HSTS\">HSTS</a>:</label> <span id=\"hsts_select\" style=\"display: none\">".html_select('hsts_preset', $hsts_preset_values, $hsts_preset_value)."</span> <span id=\"hsts_seconds\"><input type=\"text\" name=\"hsts\" id=\"hsts\" size=\"10\" style=\"text-align: right;\" value=\"{$hsts_value}\" /> Sekunden</span> |
|
193 | 193 |
</span> |
194 | 194 |
</div>"; |
195 | 195 |
|
... | ... |
@@ -189,7 +189,7 @@ $form .= " |
189 | 189 |
".($vhost['ssl'] == 'http' ? "<option value=\"http\" selected=\"selected\">kein HTTPS anbieten</option>" : '')." |
190 | 190 |
".($vhost['ssl'] == 'https' ? "<option value=\"https\" selected=\"selected\">Konfiguration nur für HTTPS verwenden</option>" : '')." |
191 | 191 |
<option value=\"forward\" ".($vhost['ssl'] == 'forward' ? 'selected="selected"' : '')." >Ja, immer auf HTTPS umleiten</option> |
192 |
- </select> <span id=\"hsts_block\" style=\"padding-top: 0.2em;\"> <label for=\"hsts\"><a title=\"Mit HSTS können Sie festlegen, dass eine bestimmte Website niemals ohne Verschlüsselung aufgerufen werden soll. Zudem werden Zertifikate strenger geprüft.\" href=\"http://de.wikipedia.org/wiki/Hypertext_Transfer_Protocol_Secure#HSTS\">HSTS</a>:</label> ".html_select('hsts_preset', $hsts_preset_values, $hsts_preset_value)." <span id=\"hsts_seconds\"><input type=\"text\" name=\"hsts\" id=\"hsts\" size=\"10\" style=\"text-align: right;\" value=\"{$hsts_value}\" /> Sekunden</span> |
|
192 |
+ </select> <span id=\"hsts_block\" style=\"padding-top: 0.2em;\"> <label for=\"hsts\"><a title=\"Mit HSTS können Sie festlegen, dass eine bestimmte Website niemals ohne Verschlüsselung aufgerufen werden soll. Zudem werden Zertifikate strenger geprüft.\" href=\"https://de.wikipedia.org/wiki/Hypertext_Transfer_Protocol_Secure#HSTS\">HSTS</a>:</label> ".html_select('hsts_preset', $hsts_preset_values, $hsts_preset_value)." <span id=\"hsts_seconds\"><input type=\"text\" name=\"hsts\" id=\"hsts\" size=\"10\" style=\"text-align: right;\" value=\"{$hsts_value}\" /> Sekunden</span> |
|
193 | 193 |
</span> |
194 | 194 |
</div>"; |
195 | 195 |
|
... | ... |
@@ -121,7 +121,7 @@ $phpoptions = "<h5>PHP</h5> |
121 | 121 |
*/ |
122 | 122 |
//if ($vhost['php'] == 'php54') |
123 | 123 |
//{ |
124 |
- $options = array("none" => 'ausgeschaltet', "php56" => "PHP 5.6", "fpm70" => "PHP 7.0"); |
|
124 |
+ $options = array("none" => 'ausgeschaltet', "php56" => "PHP 5.6", "fpm70" => "PHP 7.0", "fpm71" => "PHP 7.1"); |
|
125 | 125 |
$phpoptions = " |
126 | 126 |
<h5>PHP</h5> |
127 | 127 |
<div style=\"margin-left: 2em;\"> |
... | ... |
@@ -180,7 +180,7 @@ $form .= " |
180 | 180 |
<br /> |
181 | 181 |
</div> |
182 | 182 |
|
183 |
-<h4 style=\"clear: right; margin-top: 3em;\">Allgemeine Optionen</h4> |
|
183 |
+<h4 style=\"clear: right; margin-top: 3em;\">Optionen</h4> |
|
184 | 184 |
<div style=\"margin-left: 2em;\"> |
185 | 185 |
<h5>Sichere Verbindung erzwingen</h5> |
186 | 186 |
<div style=\"margin-left: 2em;\"> |
... | ... |
@@ -191,8 +191,30 @@ $form .= " |
191 | 191 |
<option value=\"forward\" ".($vhost['ssl'] == 'forward' ? 'selected="selected"' : '')." >Ja, immer auf HTTPS umleiten</option> |
192 | 192 |
</select> <span id=\"hsts_block\" style=\"padding-top: 0.2em;\"> <label for=\"hsts\"><a title=\"Mit HSTS können Sie festlegen, dass eine bestimmte Website niemals ohne Verschlüsselung aufgerufen werden soll. Zudem werden Zertifikate strenger geprüft.\" href=\"http://de.wikipedia.org/wiki/Hypertext_Transfer_Protocol_Secure#HSTS\">HSTS</a>:</label> ".html_select('hsts_preset', $hsts_preset_values, $hsts_preset_value)." <span id=\"hsts_seconds\"><input type=\"text\" name=\"hsts\" id=\"hsts\" size=\"10\" style=\"text-align: right;\" value=\"{$hsts_value}\" /> Sekunden</span> |
193 | 193 |
</span> |
194 |
- </div> |
|
195 |
- <h5>Logfiles <span class=\"warning\">*</span></h5> |
|
194 |
+ </div>"; |
|
195 |
+ |
|
196 |
+ $certs = user_certs(); |
|
197 |
+ $certselect = array(0 => 'kein Zertifikat / System-Standard benutzen', -1 => 'Automatische Zertifikatsverwaltung mit Let\'s Encrypt'); |
|
198 |
+ foreach ($certs as $c) |
|
199 |
+ { |
|
200 |
+ $certselect[$c['id']] = $c['subject']; |
|
201 |
+ } |
|
202 |
+ if (strstr($vhost['options'], 'letsencrypt')) { |