7fb0aeba3e1621945895343e67edcf5be0648c98
bernd neues VHosts-Modul (unbenut...

bernd authored 16 years ago

1) <?php
2) 
3) require_once('inc/debug.php');
4) require_once('inc/security.php');
5) 
6) require_once('vhosts.php');
7) 
bernd Aliases editieren

bernd authored 16 years ago

8) $title = "Subdomain bearbeiten";
bernd VHosts können bearbeitet we...

bernd authored 16 years ago

9) $section = 'vhosts_vhosts';
bernd neues VHosts-Modul (unbenut...

bernd authored 16 years ago

10) 
11) require_role(ROLE_SYSTEMUSER);
12) 
bernd VHosts können bearbeitet we...

bernd authored 16 years ago

13) $id = (int) $_GET['vhost'];
14) $vhost = empty_vhost();
15) 
16) if ($id != 0)
17)   $vhost = get_vhost_details($id);
bernd neues VHosts-Modul (unbenut...

bernd authored 16 years ago

18) 
19) DEBUG($vhost);
bernd Aliases editieren

bernd authored 16 years ago

20) if ($id == 0) {
21)   output("<h3>Neue Subdomain anlegen</h3>");
22)   $title = "Subdomain anlegen";
23) }
24) else {
25)   output("<h3>Subdomain bearbeiten</h3>");
26) }
bernd neues VHosts-Modul (unbenut...

bernd authored 16 years ago

27) 
bernd VHosts können bearbeitet we...

bernd authored 16 years ago

28) output("<script type=\"text/javascript\">
bernd vhost-Modul kann jetzt SVN-...

bernd authored 16 years ago

29)   var default_docroot;
30)  
bernd VHosts können bearbeitet we...

bernd authored 16 years ago

31)   function selectedDomain() {
32)     var selected;
33)     selected=document.getElementById('domain').options.selectedIndex;
34)     return document.getElementById('domain').options.item(selected).text;
35)     }
36)   
37)   function defaultDocumentRoot() {
38)     var hostname;
39)     if (document.getElementById('hostname').value == '') 
40)       hostname = selectedDomain();
41)     else
42)       hostname = document.getElementById('hostname').value + '.' + selectedDomain();
bernd vhost-Modul kann jetzt SVN-...

bernd authored 16 years ago

43)     default_docroot = 'websites/' + hostname + '/htdocs';
bernd VHosts können bearbeitet we...

bernd authored 16 years ago

44)     useDefaultDocroot();
45)   }
46)   
47)   function useDefaultDocroot() {
48)     var do_it = (document.getElementById('use_default_docroot').checked == true);
49)     var inputfield = document.getElementById('docroot');
50)     inputfield.disabled = do_it;
51)     if (do_it) {
bernd vhost-Modul kann jetzt SVN-...

bernd authored 16 years ago

52)       document.getElementById('docroot').value = default_docroot;
bernd VHosts können bearbeitet we...

bernd authored 16 years ago

53)     }
54)   }
bernd Erster Versuch, SVN, DAV un...

bernd authored 16 years ago

55)   
56)   function showAppropriateLines() {
57)     if (document.getElementById('vhost_type_regular').checked == true) {
bernd VHosts-Modul mit neuem Layo...

bernd authored 16 years ago

58)       document.getElementById('options_regular').style.display = 'block';
59)       document.getElementById('options_webapp').style.display = 'none';
bernd Erster Versuch, SVN, DAV un...

bernd authored 16 years ago

60)     }
61)     else if ((document.getElementById('vhost_type_dav').checked == true) || 
62)          (document.getElementById('vhost_type_svn').checked == true)) {
bernd VHosts-Modul mit neuem Layo...

bernd authored 16 years ago

63)       document.getElementById('options_regular').style.display = 'none';
64)       document.getElementById('options_webapp').style.display = 'none';
bernd Erster Versuch, SVN, DAV un...

bernd authored 16 years ago

65)     }
66)     else if (document.getElementById('vhost_type_webapp').checked == true) {
bernd VHosts-Modul mit neuem Layo...

bernd authored 16 years ago

67)       document.getElementById('options_regular').style.display = 'none';
68)       document.getElementById('options_webapp').style.display = 'block';
bernd Erster Versuch, SVN, DAV un...

bernd authored 16 years ago

69)     }
70)   }
bernd VHosts können bearbeitet we...

bernd authored 16 years ago

71)   </script>");
72) 
73) $defaultdocroot = $vhost['domain'];
bernd domain = NULL ==> user-subd...

bernd authored 16 years ago

74) if (! $vhost['domain'])
75)   $defaultdocroot = $_SESSION['userinfo']['username'].'.schokokeks.org';
bernd VHosts können bearbeitet we...

bernd authored 16 years ago

76) if ($vhost['hostname'])
77)   $defaultdocroot = $vhost['hostname'].'.'.$defaultdocroot;
78) 
79) $defaultdocroot = 'websites/'.$defaultdocroot.'/htdocs';
80) 
81) $is_default_docroot = ($vhost['docroot'] == NULL) || ($vhost['homedir'].'/'.$defaultdocroot == $vhost['docroot']);
82) 
83) $docroot = '';
84) if ($vhost['docroot'] == '')
85)   $docroot = $defaultdocroot;
86) else
87)   $docroot = substr($vhost['docroot'], strlen($vhost['homedir'])+1);
88) 
bernd neues VHosts-Modul (unbenut...

bernd authored 16 years ago

89) $s = (strstr($vhost['options'], 'aliaswww') ? ' checked="checked" ' : '');
bernd error_log konfigurierbar

bernd authored 16 years ago

90) $errorlog = (strstr($vhost['errorlog'], 'on') ? ' checked="checked" ' : '');
bernd VHosts-Modul mit neuem Layo...

bernd authored 16 years ago

91) 
92) $vhost_type = 'regular';
93) if ($vhost['is_dav'])
94)   $vhost_type = 'dav';
95) elseif ($vhost['is_svn'])
96)   $vhost_type = 'svn';
97) elseif ($vhost['is_webapp'])
98)   $vhost_type = 'webapp';
99) 
bernd neues VHosts-Modul (unbenut...

bernd authored 16 years ago

100) $form = "
bernd VHosts-Modul mit neuem Layo...

bernd authored 16 years ago

101) <h4 style=\"margin-top: 2em;\">Name des VHost</h4>
102)     <div style=\"margin-left: 2em;\"><input type=\"text\" name=\"hostname\" id=\"hostname\" size=\"10\" value=\"{$vhost['hostname']}\" onchange=\"defaultDocumentRoot()\" /><strong>.</strong>".domainselect($vhost['domain_id'], 'onchange="defaultDocumentRoot()"');
103) $form .= "<br /><input type=\"checkbox\" name=\"options[]\" id=\"aliaswww\" value=\"aliaswww\" {$s}/> <label for=\"aliaswww\">Auch mit <strong>www</strong> davor.</label></div>
104) 
bernd vhost-Modul kann jetzt SVN-...

bernd authored 16 years ago

105) <div class=\"vhostsidebyside\">
106) <div class=\"vhostoptions\" id=\"options_regular\" ".($vhost_type=='regular' ? '' : 'style="display: none;"').">
bernd VHosts-Modul mit neuem Layo...

bernd authored 16 years ago

107)   <h4>Optionen</h4>
108)   <h5>Speicherort für Dateien (»Document Root«)</h5>
109)   <div style=\"margin-left: 2em;\">
110)     <input type=\"checkbox\" id=\"use_default_docroot\" name=\"use_default_docroot\" value=\"1\" onclick=\"useDefaultDocroot()\" ".($is_default_docroot ? 'checked="checked" ' : '')."/>&#160;<label for=\"use_default_docroot\">Standardeinstellung benutzen</label><br />
bernd Entities repariert

bernd authored 16 years ago

111)     <strong>".$vhost['homedir']."/</strong>&#160;<input type=\"text\" id=\"docroot\" name=\"docroot\" size=\"30\" value=\"".$docroot."\" ".($is_default_docroot ? 'disabled="disabled" ' : '')."/>
bernd VHosts-Modul mit neuem Layo...

bernd authored 16 years ago

112)   </div>
113)   <h5>Script-Sprache</h5>
114)   <div style=\"margin-left: 2em;\">
115)     <select name=\"php\" id=\"php\">
116)       <option value=\"none\" ".($vhost['php'] == NULL ? 'selected="selected"' : '')." >keine Scriptsprache</option>
117)       <option value=\"mod_php\" ".($vhost['php'] == 'mod_php' ? 'selected="selected"' : '')." >PHP als Apache-Modul</option>
118)       <option value=\"fastcgi\" ".($vhost['php'] == 'fastcgi' ? 'selected="selected"' : '')." >PHP als FastCGI</option>
bernd vhost-Modul kann jetzt SVN-...

bernd authored 16 years ago

119)       <!--  <option value=\"rubyonrails\" ".($vhost['php'] == 'rubyonrails' ? 'selected="selected"' : '')." >Ruby-on-Rails</option> -->
bernd VHosts können bearbeitet we...

bernd authored 16 years ago

120)     </select>
bernd VHosts-Modul mit neuem Layo...

bernd authored 16 years ago

121)   </div>
122) </div>
123) 
bernd vhost-Modul kann jetzt SVN-...

bernd authored 16 years ago

124) <div class=\"vhostoptions\" id=\"options_webapp\" ".($vhost_type=='webapp' ? '' : 'style="display: none;"').">
bernd VHosts-Modul mit neuem Layo...

bernd authored 16 years ago

125)   <h4>Optionen</h4>
126)   <h5>Anwendung</h5>
bernd vhost-Modul kann jetzt SVN-...

bernd authored 16 years ago

127)   <select name=\"webapp\" id=\"webapp\" size=\"1\">
128)     <option value=\"1\">Drupal 5.x</option>
129)   </select>
bernd VHosts-Modul mit neuem Layo...

bernd authored 16 years ago

130) </div>
131) 
132) <h4>Verwendung</h4>
133)         <div style=\"margin-left: 2em;\">
134) 	  <input class=\"usageoption\" onclick=\"showAppropriateLines()\" type=\"radio\" name=\"vhost_type\" id=\"vhost_type_regular\" value=\"regular\" ".(($vhost_type=='regular') ? 'checked="checked" ' : '')."/><label for=\"vhost_type_regular\">&#160;Normal (selbst Dateien hinterlegen)</label><br />
135) 	  <input class=\"usageoption\" onclick=\"showAppropriateLines()\" type=\"radio\" name=\"vhost_type\" id=\"vhost_type_dav\" value=\"dav\" ".(($vhost_type=='dav') ? 'checked="checked" ' : '')."/><label for=\"vhost_type_dav\">&#160;WebDAV</label><br />
136) 	  <input class=\"usageoption\" onclick=\"showAppropriateLines()\" type=\"radio\" name=\"vhost_type\" id=\"vhost_type_svn\" value=\"svn\" ".(($vhost_type=='svn') ? 'checked="checked" ' : '')."/><label for=\"vhost_type_svn\">&#160;Subversion-Server</label><br />
bernd vhost-Modul kann jetzt SVN-...

bernd authored 16 years ago

137) 	  <div style=\"display: none\">
138) 	    <input class=\"usageoption\" onclick=\"showAppropriateLines()\" type=\"radio\" name=\"vhost_type\" id=\"vhost_type_webapp\" value=\"webapp\" ".(($vhost_type=='webapp') ? 'checked="checked" ' : '')."/><label for=\"vhost_type_webapp\">&#160;Eine vorgefertigte Applikation nutzen</label>
139) 	  </div>
bernd VHosts-Modul mit neuem Layo...

bernd authored 16 years ago

140) 	</div>
bernd vhost-Modul kann jetzt SVN-...

bernd authored 16 years ago

141) <br />
142) </div>
bernd VHosts-Modul mit neuem Layo...

bernd authored 16 years ago

143) 
144) <h4 style=\"margin-top: 3em;\">Allgemeine Optionen</h4>
145) <div style=\"margin-left: 2em;\">
146)     <h5>SSL-Verschlüsselung</h5>
147)     <div style=\"margin-left: 2em;\">
148)     <select name=\"ssl\" id=\"ssl\">
bernd SSL auch über webinterface...

bernd authored 16 years ago

149)       <option value=\"none\" ".($vhost['ssl'] == NULL ? 'selected="selected"' : '')." >SSL optional anbieten</option>
150)       <option value=\"http\" ".($vhost['ssl'] == 'http' ? 'selected="selected"' : '')." >kein SSL</option>
151)       <option value=\"https\" ".($vhost['ssl'] == 'https' ? 'selected="selected"' : '')." >nur SSL</option>
152)       <option value=\"forward\" ".($vhost['ssl'] == 'forward' ? 'selected="selected"' : '')." >Immer auf SSL umleiten</option>
153)     </select>
bernd VHosts-Modul mit neuem Layo...

bernd authored 16 years ago

154)     </div>
155)     <h5>Logfiles <span class=\"warning\">*</span></h5>
156)     <div style=\"margin-left: 2em;\">
157)       <select name=\"logtype\" id=\"logtype\">
158)         <option value=\"none\" ".($vhost['logtype'] == NULL ? 'selected="selected"' : '')." >keine Logfiles</option>
159)         <option value=\"anonymous\" ".($vhost['logtype'] == 'anonymous' ? 'selected="selected"' : '')." >anonymisiert</option>
160)         <option value=\"default\" ".($vhost['logtype'] == 'default' ? 'selected="selected"' : '')." >vollständige Logfile</option>
161)       </select><br />
162)       <input type=\"checkbox\" id=\"errorlog\" name=\"errorlog\" value=\"1\" ".($vhost['errorlog'] == 1 ? ' checked="checked" ' : '')." />&#160;<label for=\"errorlog\">Fehlerprotokoll (error_log) einschalten</label>
163)     </div>
164) </div>
bernd VHosts können bearbeitet we...

bernd authored 16 years ago

165)     ";
bernd neues VHosts-Modul (unbenut...

bernd authored 16 years ago

166) 
bernd VHosts-Modul mit neuem Layo...

bernd authored 16 years ago

167) $form .= '
bernd Entities repariert

bernd authored 16 years ago

168)   <p><input type="submit" value="Speichern" />&#160;&#160;&#160;&#160;'.internal_link('vhosts.php', 'Abbrechen').'</p>
bernd typo

bernd authored 16 years ago

169)   <p class="warning"><span class="warning">*</span>Es ist im Moment Gegenstand gerichtlicher Außeinandersetzungen, ob die Speicherung von Logfiles auf Webservern
bernd warnung bzgl. logfiles eing...

bernd authored 16 years ago

170)   zulässig ist. Wir weisen alle Nutzer darauf hin, dass sie selbst dafür verantwortlich sind, bei geloggten Nutzerdaten die
171)   Seitenbesucher darauf hinzuweisen. Wir empfehlen, wenn möglich, Logfiles abzuschalten oder anonymes Logging einzusetzen.</p>
bernd VHosts können bearbeitet we...

bernd authored 16 years ago

172) ';
173) output(html_form('vhosts_edit_vhost', 'save.php', 'action=edit&vhost='.$vhost['id'], $form));