bernd commited on 2009-02-11 18:32:29
Zeige 3 geänderte Dateien mit 67 Einfügungen und 33 Löschungen.
git-svn-id: https://svn.schokokeks.org/repos/tools/webinterface/trunk@1241 87cf0b9e-d624-0410-a070-f6ee81989793
| ... | ... |
@@ -25,8 +25,7 @@ else {
|
| 25 | 25 |
output("<h3>Subdomain bearbeiten</h3>");
|
| 26 | 26 |
} |
| 27 | 27 |
|
| 28 |
-output("<script type=\"text/javascript\">
|
|
| 29 |
- var default_docroot; |
|
| 28 |
+html_header("<script type=\"text/javascript\">
|
|
| 30 | 29 |
|
| 31 | 30 |
function selectedDomain() {
|
| 32 | 31 |
var selected; |
| ... | ... |
@@ -40,11 +39,11 @@ output("<script type=\"text/javascript\">
|
| 40 | 39 |
hostname = selectedDomain(); |
| 41 | 40 |
else |
| 42 | 41 |
hostname = document.getElementById('hostname').value + '.' + selectedDomain();
|
| 43 |
- default_docroot = 'websites/' + hostname + '/htdocs'; |
|
| 44 |
- useDefaultDocroot(); |
|
| 42 |
+ var default_docroot = hostname + '/htdocs'; |
|
| 43 |
+ useDefaultDocroot(default_docroot); |
|
| 45 | 44 |
} |
| 46 | 45 |
|
| 47 |
- function useDefaultDocroot() {
|
|
| 46 |
+ function useDefaultDocroot( default_docroot ) {
|
|
| 48 | 47 |
var do_it = (document.getElementById('use_default_docroot').checked == true);
|
| 49 | 48 |
var inputfield = document.getElementById('docroot');
|
| 50 | 49 |
inputfield.disabled = do_it; |
| ... | ... |
@@ -83,15 +82,21 @@ if (! $vhost['domain']) |
| 83 | 82 |
if ($vhost['hostname']) |
| 84 | 83 |
$defaultdocroot = $vhost['hostname'].'.'.$defaultdocroot; |
| 85 | 84 |
|
| 86 |
-$defaultdocroot = 'websites/'.$defaultdocroot.'/htdocs'; |
|
| 85 |
+$defaultdocroot = $defaultdocroot.'/htdocs'; |
|
| 87 | 86 |
|
| 88 |
-$is_default_docroot = ($vhost['docroot'] == NULL) || ($vhost['homedir'].'/'.$defaultdocroot == $vhost['docroot']); |
|
| 87 |
+$is_default_docroot = ($vhost['docroot'] == NULL) || ($vhost['homedir'].'/websites/'.$defaultdocroot == $vhost['docroot']); |
|
| 88 |
+ |
|
| 89 |
+if ($vhost['docroot'] != '' && ! strstr($vhost['docroot'], '/websites/')) |
|
| 90 |
+{
|
|
| 91 |
+ 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.");
|
|
| 92 |
+ $is_default_docroot = True; |
|
| 93 |
+} |
|
| 89 | 94 |
|
| 90 | 95 |
$docroot = ''; |
| 91 |
-if ($vhost['docroot'] == '') |
|
| 96 |
+if ($is_default_docroot) |
|
| 92 | 97 |
$docroot = $defaultdocroot; |
| 93 | 98 |
else |
| 94 |
- $docroot = substr($vhost['docroot'], strlen($vhost['homedir'])+1); |
|
| 99 |
+ $docroot = substr($vhost['docroot'], strlen($vhost['homedir'].'/websites/')); |
|
| 95 | 100 |
|
| 96 | 101 |
$s = (strstr($vhost['options'], 'aliaswww') ? ' checked="checked" ' : ''); |
| 97 | 102 |
$errorlog = (strstr($vhost['errorlog'], 'on') ? ' checked="checked" ' : ''); |
| ... | ... |
@@ -121,22 +126,40 @@ $form .= "<br /><input type=\"checkbox\" name=\"options[]\" id=\"aliaswww\" valu |
| 121 | 126 |
<h5>Speicherort für Dateien (»Document Root«)</h5> |
| 122 | 127 |
<div style=\"margin-left: 2em;\"> |
| 123 | 128 |
<input type=\"checkbox\" id=\"use_default_docroot\" name=\"use_default_docroot\" value=\"1\" onclick=\"defaultDocumentRoot()\" ".($is_default_docroot ? 'checked="checked" ' : '')."/> <label for=\"use_default_docroot\">Standardeinstellung benutzen</label><br /> |
| 124 |
- <strong>".$vhost['homedir']."/</strong> <input type=\"text\" id=\"docroot\" name=\"docroot\" size=\"30\" value=\"".$docroot."\" ".($is_default_docroot ? 'disabled="disabled" ' : '')."/> |
|
| 129 |
+ <strong>".$vhost['homedir']."/websites/</strong> <input type=\"text\" id=\"docroot\" name=\"docroot\" size=\"30\" value=\"".$docroot."\" ".($is_default_docroot ? 'disabled="disabled" ' : '')."/> |
|
| 125 | 130 |
</div> |
| 126 | 131 |
</div> |
| 132 |
+"; |
|
| 127 | 133 |
|
| 134 |
+if ($vhost['php'] == 'mod_php') |
|
| 135 |
+{
|
|
| 136 |
+$form .= " |
|
| 128 | 137 |
<div class=\"vhostoptions\" id=\"options_scriptlang\" ".($vhost_type=='regular' ? '' : 'style="display: none;"')."> |
| 129 |
- <h5>Script-Sprache</h5> |
|
| 138 |
+ <h5>PHP</h5> |
|
| 130 | 139 |
<div style=\"margin-left: 2em;\"> |
| 131 | 140 |
<select name=\"php\" id=\"php\"> |
| 132 |
- <option value=\"none\" ".($vhost['php'] == NULL ? 'selected="selected"' : '')." >keine Scriptsprache</option> |
|
| 133 |
- <option value=\"mod_php\" ".($vhost['php'] == 'mod_php' ? 'selected="selected"' : '')." >PHP als Apache-Modul</option> |
|
| 134 |
- <option value=\"fastcgi\" ".($vhost['php'] == 'fastcgi' ? 'selected="selected"' : '')." >PHP als FastCGI</option> |
|
| 141 |
+ <option value=\"none\" ".($vhost['php'] == NULL ? 'selected="selected"' : '')." >ausgeschaltet</option> |
|
| 142 |
+ <option value=\"mod_php\" ".($vhost['php'] == 'mod_php' ? 'selected="selected"' : '')." >Eingeschaltet als Apache-Modul (veraltet)</option> |
|
| 143 |
+ <option value=\"fastcgi\" ".($vhost['php'] == 'fastcgi' ? 'selected="selected"' : '')." >Eingeschaltet</option> |
|
| 135 | 144 |
<!-- <option value=\"rubyonrails\" ".($vhost['php'] == 'rubyonrails' ? 'selected="selected"' : '')." >Ruby-on-Rails</option> --> |
| 136 | 145 |
</select> |
| 137 | 146 |
</div> |
| 138 | 147 |
</div> |
| 148 |
+"; |
|
| 149 |
+} |
|
| 150 |
+else |
|
| 151 |
+{
|
|
| 152 |
+$form .= " |
|
| 153 |
+<div class=\"vhostoptions\" id=\"options_scriptlang\" ".($vhost_type=='regular' ? '' : 'style="display: none;"')."> |
|
| 154 |
+ <h5>PHP</h5> |
|
| 155 |
+ <div style=\"margin-left: 2em;\"> |
|
| 156 |
+ <input type=\"checkbox\" name=\"php\" id=\"php\" value=\"fastcgi\" ".($vhost['php'] == 'fastcgi' ? 'checked="checked" ' : '')." /> <label for=\"php\">PHP aktivieren</label> |
|
| 157 |
+ </div> |
|
| 158 |
+</div> |
|
| 159 |
+"; |
|
| 160 |
+} |
|
| 139 | 161 |
|
| 162 |
+$form .= " |
|
| 140 | 163 |
<div class=\"vhostoptions\" id=\"options_webapp\" ".($vhost_type=='webapp' ? '' : 'style="display: none;"')."> |
| 141 | 164 |
<h4>Optionen</h4> |
| 142 | 165 |
<h5>Anwendung</h5> |
| ... | ... |
@@ -181,7 +204,7 @@ $form .= "<br /><input type=\"checkbox\" name=\"options[]\" id=\"aliaswww\" valu |
| 181 | 204 |
|
| 182 | 205 |
$form .= ' |
| 183 | 206 |
<p><input type="submit" value="Speichern" />    '.internal_link('vhosts', 'Abbrechen').'</p>
|
| 184 |
- <p class="warning"><span class="warning">*</span>Es ist im Moment Gegenstand gerichtlicher Außeinandersetzungen, ob die Speicherung von Logfiles auf Webservern |
|
| 207 |
+ <p class="warning"><span class="warning">*</span>Es ist im Moment fraglich, ob die Speicherung von Logfiles mit IP-Adressen auf Webservern |
|
| 185 | 208 |
zulässig ist. Wir weisen alle Nutzer darauf hin, dass sie selbst dafür verantwortlich sind, bei geloggten Nutzerdaten die |
| 186 | 209 |
Seitenbesucher darauf hinzuweisen. Wir empfehlen, wenn möglich, Logfiles abzuschalten oder anonymes Logging einzusetzen.</p> |
| 187 | 210 |
'; |
| ... | ... |
@@ -44,7 +44,7 @@ if ($_GET['action'] == 'edit') |
| 44 | 44 |
|
| 45 | 45 |
if (! check_path( $_POST['docroot'] )) |
| 46 | 46 |
system_failure("Eingegebener Pfad enthält ungültige Angaben");
|
| 47 |
- $docroot = $vhost['homedir'].'/'.$_POST['docroot']; |
|
| 47 |
+ $docroot = $vhost['homedir'].'/websites/'.$_POST['docroot']; |
|
| 48 | 48 |
|
| 49 | 49 |
if (($_POST['use_default_docroot'] == '1') || ($docroot == $defaultdocroot)) {
|
| 50 | 50 |
$docroot = ''; |
| ... | ... |
@@ -21,53 +21,64 @@ $vhosts = list_vhosts(); |
| 21 | 21 |
|
| 22 | 22 |
if (count($vhosts) > 0) |
| 23 | 23 |
{
|
| 24 |
- output("<table><tr><th>(Sub-)Domain</th><th></th><th>Zusätzliche Alias-Namen</th><th>Logfiles</th><th>PHP</th><th>Lokaler Pfad<sup>*</sup></th></tr>");
|
|
| 24 |
+ output("<table><tr><th>(Sub-)Domain</th><th></th><th>Zusätzliche Alias-Namen</th><th>Protokoll</th><th>PHP</th><th>Lokaler Pfad<sup>*</sup></th></tr>\n");
|
|
| 25 |
+ |
|
| 26 |
+ $even = True; |
|
| 25 | 27 |
|
| 26 | 28 |
foreach ($vhosts as $vhost) |
| 27 | 29 |
{
|
| 30 |
+ $even = ! $even; |
|
| 28 | 31 |
$fqdn = $vhost['fqdn']; |
| 29 |
- output("<tr><td>".internal_link('edit', $fqdn, "vhost={$vhost['id']}")."</td><td>".internal_link('save', "<img src=\"{$prefix}images/delete.png\" title=\"»{$vhost['fqdn']}« löschen\" alt=\"löschen\" />", 'action=delete&vhost='.$vhost['id'] )."</td><td>");
|
|
| 32 |
+ $class = 'odd'; |
|
| 33 |
+ if ($even) $class = 'even'; |
|
| 34 |
+ output("<tr class=\"{$class}\"><td>".internal_link('edit', $fqdn, "vhost={$vhost['id']}", 'title="Einstellungen bearbeiten"')."</td><td>".internal_link('save', "<img src=\"{$prefix}images/delete.png\" title=\"»{$vhost['fqdn']}« löschen\" alt=\"löschen\" />", 'action=delete&vhost='.$vhost['id'] )."</td><td>");
|
|
| 30 | 35 |
$aliases = get_all_aliases($vhost['id']); |
| 36 |
+ $tmp = ''; |
|
| 37 |
+ if (count($aliases) > 0) |
|
| 38 |
+ {
|
|
| 31 | 39 |
foreach ($aliases as $alias) |
| 32 | 40 |
{
|
| 33 |
- output($alias['fqdn'].'<br />'); |
|
| 41 |
+ $tmp .= $alias['fqdn'].'<br />'; |
|
| 42 |
+ } |
|
| 43 |
+ } else {
|
|
| 44 |
+ $tmp = '<em>- keine -</em>'; |
|
| 34 | 45 |
} |
| 35 |
- output(internal_link('aliases', 'Aliase verwalten', 'vhost='.$vhost['id']));
|
|
| 46 |
+ output(internal_link('aliases', $tmp, 'vhost='.$vhost['id'], 'title="Aliase verwalten"'));
|
|
| 36 | 47 |
output('</td>');
|
| 37 |
- $logfiles = 'keine'; |
|
| 48 |
+ $logfiles = 'Kein Protokoll'; |
|
| 38 | 49 |
if ($vhost['logtype'] == 'default') |
| 39 |
- $logfiles = 'normal'; |
|
| 50 |
+ $logfiles = 'Zugriffe'; |
|
| 40 | 51 |
elseif ($vhost['logtype'] == 'anonymous') |
| 41 |
- $logfiles = 'anonym'; |
|
| 52 |
+ $logfiles = 'Zugriffe anonym'; |
|
| 42 | 53 |
if ($vhost['errorlog'] == 1) |
| 43 | 54 |
{
|
| 44 |
- if ($logfiles == 'keine') |
|
| 45 |
- $logfiles = 'nur Fehler'; |
|
| 55 |
+ if ($vhost['logtype'] == NULL) |
|
| 56 |
+ $logfiles = 'Nur Fehler'; |
|
| 46 | 57 |
else |
| 47 |
- $logfiles .= ', Fehler'; |
|
| 58 |
+ $logfiles .= ' und Fehler'; |
|
| 48 | 59 |
} |
| 49 | 60 |
output("<td>{$logfiles}</td>");
|
| 50 | 61 |
if ($vhost['is_webapp'] == 1) {
|
| 51 |
- output('<td colspan="2"><em>globale Webanwendung</em></td>');
|
|
| 62 |
+ output('<td colspan="2"><em><strong>Sonderanwendung:</strong> Vorinstallierte Webanwendung</em></td>');
|
|
| 52 | 63 |
} |
| 53 | 64 |
elseif ($vhost['is_dav'] == 1) {
|
| 54 |
- output('<td colspan="2"><em>WebDAV</em></td>');
|
|
| 65 |
+ output('<td colspan="2"><em><strong>Sonderanwendung:</strong> WebDAV</em></td>');
|
|
| 55 | 66 |
} |
| 56 | 67 |
elseif ($vhost['is_svn'] == 1) {
|
| 57 |
- output('<td colspan="2"><em>Subversion-Server</em></td>');
|
|
| 68 |
+ output('<td colspan="2"><em><strong>Sonderanwendung:</strong> Subversion-Server</em></td>');
|
|
| 58 | 69 |
} |
| 59 | 70 |
else {
|
| 60 | 71 |
$php = $vhost['php']; |
| 61 | 72 |
switch ($php) |
| 62 | 73 |
{
|
| 63 | 74 |
case NULL: |
| 64 |
- $php = 'kein PHP'; |
|
| 75 |
+ $php = "<img src=\"{$prefix}images/error.png\" alt=\"aus\" title=\"PHP ausgeschaltet\" />";
|
|
| 65 | 76 |
break; |
| 66 | 77 |
case 'mod_php': |
| 67 |
- $php = 'Apache-Modul'; |
|
| 78 |
+ $php = "<img src=\"{$prefix}images/warning.png\" alt=\"mod_php\" title=\"Veraltet: Bitte umstellen\" /> Apache-Modul";
|
|
| 68 | 79 |
break; |
| 69 | 80 |
case 'fastcgi': |
| 70 |
- $php = 'FastCGI'; |
|
| 81 |
+ $php = "<img src=\"{$prefix}images/ok.png\" alt=\"ein\" title=\"PHP eingeschaltet\" />";
|
|
| 71 | 82 |
break; |
| 72 | 83 |
} |
| 73 | 84 |
output("<td>{$php}</td>");
|
| ... | ... |
@@ -76,7 +87,7 @@ if (count($vhosts) > 0) |
| 76 | 87 |
else |
| 77 | 88 |
output("<td><strong>{$vhost['docroot']}</strong></td>");
|
| 78 | 89 |
} |
| 79 |
- output("</tr>");
|
|
| 90 |
+ output("</tr>\n");
|
|
| 80 | 91 |
} |
| 81 | 92 |
output('</table>');
|
| 82 | 93 |
output('<p><sup>*</sup>) schwach geschriebene Pfadangaben bezeichnen die Standardeinstellung. Ist ein Pfad fett dargestellt, so haben Sie einen davon abweichenden Wert eingegeben.</p>');
|
| 83 | 94 |