efb08fd725276c4635c4f0c6cfaa576ce6e67122
bernd neues VHosts-Modul (unbenut...

bernd authored 16 years ago

1) <?php
2) 
3) require_once("inc/base.php");
4) require_once("inc/error.php");
5) require_once("inc/security.php");
6) 
7) require_once('class/domain.php');
8) 
bernd Neue Zertifikatsverwaltung

bernd authored 14 years ago

9) require_once("certs.php");
10) 
bernd Aliases editieren

bernd authored 16 years ago

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

bernd authored 16 years ago

12) function list_vhosts()
13) {
14)   $uid = (int) $_SESSION['userinfo']['uid'];
bernd CGI abschaltbar

bernd authored 14 years ago

15)   $result = db_query("SELECT vh.id,fqdn,domain,docroot,docroot_is_default,php,cgi,vh.certid AS cert, vh.ssl, vh.options,logtype,errorlog,IF(dav.id IS NULL OR dav.type='svn', 0, 1) AS is_dav,IF(dav.id IS NULL OR dav.type='dav', 0, 1) AS is_svn, IF(webapps.id IS NULL, 0, 1) AS is_webapp, stats FROM vhosts.v_vhost AS vh LEFT JOIN vhosts.dav ON (dav.vhost=vh.id) LEFT JOIN vhosts.webapps ON (webapps.vhost = vh.id) WHERE uid={$uid} ORDER BY domain,hostname");
bernd neues VHosts-Modul (unbenut...

bernd authored 16 years ago

16)   $ret = array();
17)   while ($item = mysql_fetch_assoc($result))
18)     array_push($ret, $item);
19)   return $ret;
20) }
21) 
bernd IPv6-fähigkeit auch richtig...

bernd authored 13 years ago

22) function ipv6_possible($server)
bernd IPv6-Option nur anzeigen we...

bernd authored 13 years ago

23) {
bernd IPv6-fähigkeit auch richtig...

bernd authored 13 years ago

24)   $serverid = (int) $server;
25)   $servername = mysql_real_escape_string($server);
26)   $result = db_query("SELECT v6_prefix FROM system.servers WHERE id={$serverid} OR hostname='{$servername}'");
27)   $line = mysql_fetch_assoc($result);
28)   DEBUG("Server {$server} is v6-capable: ". ($line['v6_prefix'] != NULL));
29)   return ($line['v6_prefix'] != NULL);
bernd IPv6-Option nur anzeigen we...

bernd authored 13 years ago

30) }
31) 
bernd VHosts können bearbeitet we...

bernd authored 16 years ago

32) function empty_vhost()
33) {
bernd neue Bilder, mehr SSL-Zerti...

bernd authored 14 years ago

34)   $vhost['id'] = NULL;
bernd VHosts können bearbeitet we...

bernd authored 16 years ago

35)   $vhost['hostname'] = '';
36)   
bernd domain = NULL ==> user-subd...

bernd authored 16 years ago

37)   $vhost['domain_id'] = -1;
bernd Mehr config-optionen und co...

bernd authored 14 years ago

38)   $vhost['domain'] = $_SESSION['userinfo']['username'].'.'.config('masterdomain');
bernd VHosts können bearbeitet we...

bernd authored 16 years ago

39)   
40)   $vhost['homedir'] = $_SESSION['userinfo']['homedir'];
41)   $vhost['docroot'] = NULL;
bernd PHP 5.3 als Default

bernd authored 14 years ago

42)   $vhost['php'] = 'php53';
bernd CGI abschaltbar

bernd authored 14 years ago

43)   $vhost['cgi'] = 1;
bernd SSL auch über webinterface...

bernd authored 16 years ago

44)   $vhost['ssl'] = NULL;
bernd SuExec-Useraccount einstellbar

bernd authored 14 years ago

45)   $vhost['suexec_user'] = NULL;
bernd VHosts können bearbeitet we...

bernd authored 16 years ago

46)   $vhost['logtype'] = NULL;
bernd Einige notices (undefined i...

bernd authored 14 years ago

47)   $vhost['errorlog'] = 0;
bernd vhost-Modul kann jetzt SVN-...

bernd authored 16 years ago

48)   $vhost['is_dav'] = 0;
49)   $vhost['is_svn'] = 0;
50)   $vhost['is_webapp'] = 0;
bernd Neue Zertifikatsverwaltung

bernd authored 14 years ago

51)   $vhost['webapp_id'] = NULL;
52)   
53)   $vhost['cert'] = NULL;
bernd Einige notices (undefined i...

bernd authored 14 years ago

54)   $vhost['certid'] = NULL;
bernd IP-Adressen aktivieren

bernd authored 14 years ago

55)   $vhost['ipv4'] = NULL;
bernd IPv6

bernd authored 14 years ago

56)   $vhost['autoipv6'] = 0;
bernd Neue Zertifikatsverwaltung

bernd authored 14 years ago

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

bernd authored 16 years ago

58)   $vhost['options'] = '';
bernd Webalizer/Statistik-Funktio...

bernd authored 14 years ago

59)   $vhost['stats'] = NULL;
bernd VHosts können bearbeitet we...

bernd authored 16 years ago

60)   return $vhost;
61) }
62) 
63) 
bernd Aliases editieren

bernd authored 16 years ago

64) function empty_alias()
65) {
66)   $alias['hostname'] = '';
67)   
bernd domain = NULL ==> user-subd...

bernd authored 16 years ago

68)   $alias['domain_id'] = -1;
bernd Mehr config-optionen und co...

bernd authored 14 years ago

69)   $alias['domain'] = $_SESSION['userinfo']['username'].'.'.config('masterdomain');
bernd Aliases editieren

bernd authored 16 years ago

70)   
71)   $alias['options'] = '';
72)   return $alias;
73) }
74) 
75) 
bernd VHosts können bearbeitet we...

bernd authored 16 years ago

76) function domainselect($selected = NULL, $selectattribute = '')
bernd neues VHosts-Modul (unbenut...

bernd authored 16 years ago

77) {
bernd Mehr config-optionen und co...

bernd authored 14 years ago

78)   global $domainlist, $config;
bernd neues VHosts-Modul (unbenut...

bernd authored 16 years ago

79)   if ($domainlist == NULL)
80)     $domainlist = get_domain_list($_SESSION['customerinfo']['customerno'],
81)                                   $_SESSION['userinfo']['uid']);
82)   $selected = (int) $selected;
83) 
bernd VHosts können bearbeitet we...

bernd authored 16 years ago

84)   $ret = '<select id="domain" name="domain" size="1" '.$selectattribute.' >';
bernd Mehr config-optionen und co...

bernd authored 14 years ago

85)   $ret .= ' <option value="-1">'.$_SESSION['userinfo']['username'].'.'.config('masterdomain').'</option>';
bernd domain = NULL ==> user-subd...

bernd authored 16 years ago

86)   $ret .= ' <option value="" disabled="disabled">--------------------------------</option>';
bernd neues VHosts-Modul (unbenut...

bernd authored 16 years ago

87)   foreach ($domainlist as $dom)
88)   {
bernd Aliases editieren

bernd authored 16 years ago

89)     $s = ($selected == $dom->id) ? ' selected="selected" ': '';
bernd neues VHosts-Modul (unbenut...

bernd authored 16 years ago

90)     $ret .= "<option value=\"{$dom->id}\"{$s}>{$dom->fqdn}</option>\n";
91)   }
92)   $ret .= '</select>';
93)   return $ret;
94) }
95) 
96) 
97) 
98) function get_vhost_details($id)
99) {
100)   $id = (int) $id;
101)   $uid = (int) $_SESSION['userinfo']['uid'];
bernd VHosts-Modul mit neuem Layo...

bernd authored 16 years ago

102)   $result = db_query("SELECT vh.*,IF(dav.id IS NULL OR dav.type='svn', 0, 1) AS is_dav,IF(dav.id IS NULL OR dav.type='dav', 0, 1) AS is_svn, IF(webapps.id IS NULL, 0, 1) AS is_webapp FROM vhosts.v_vhost AS vh LEFT JOIN vhosts.dav ON (dav.vhost=vh.id) LEFT JOIN vhosts.webapps ON (webapps.vhost = vh.id) WHERE uid={$uid} AND vh.id={$id}");
bernd neues VHosts-Modul (unbenut...

bernd authored 16 years ago

103)   if (mysql_num_rows($result) != 1)
104)     system_failure('Interner Fehler beim Auslesen der Daten');
105) 
bernd Neue Zertifikatsverwaltung

bernd authored 14 years ago

106)   $ret = mysql_fetch_assoc($result);
107)   DEBUG($ret);
108)   return $ret;
bernd neues VHosts-Modul (unbenut...

bernd authored 16 years ago

109) }
110) 
111) 
112) function get_aliases($vhost)
113) {
114)   $result = db_query("SELECT id,fqdn,options FROM vhosts.v_alias WHERE vhost={$vhost}");
115)   $ret = array();
bernd Aliases editieren

bernd authored 16 years ago

116)   while ($item = mysql_fetch_assoc($result)) {
bernd neues VHosts-Modul (unbenut...

bernd authored 16 years ago

117)     array_push($ret, $item);
bernd Aliases editieren

bernd authored 16 years ago

118)   }
119)   return $ret;
120) }
121) 
122) 
123) 
124) function get_all_aliases($vhost)
125) {
bernd Weniger Datenbankzugriffe b...

bernd authored 14 years ago

126)   //$vhost = get_vhost_details( (int) $vhost );
bernd Aliases editieren

bernd authored 16 years ago

127)   $aliases = get_aliases($vhost['id']);
128)   $ret = array();
129)   if (strstr($vhost['options'], 'aliaswww')) {
130)     array_push($ret, array('id' => 'www', 'fqdn' => 'www.'.$vhost['fqdn'], 'options' => (strstr($vhost['options'], 'forwardwww') ? 'forward' : '')));
131)   }
132)   foreach ($aliases as $item) {
133)     array_push($ret, $item);
134)     if (strstr($item['options'], 'aliaswww')) {
135)       array_push($ret, array('id' => 'www_'.$item['id'], 'fqdn' => 'www.'.$item['fqdn'], 'options' => (strstr($item['options'], 'forward') ? 'forward' : '')));
136)     }
137)   }
bernd neues VHosts-Modul (unbenut...

bernd authored 16 years ago

138)   return $ret;
139) }
140) 
bernd Aliases editieren

bernd authored 16 years ago

141) 
bernd Webapps implementiert

bernd authored 16 years ago

142) function list_available_webapps()
143) {
144)   $result = db_query("SELECT id,displayname FROM vhosts.global_webapps");
145)   $ret = array();
146)   while ($item = mysql_fetch_assoc($result))
147)     array_push($ret, $item);
148)   return $ret;
149) }
150) 
151) 
bernd VHosts können bearbeitet we...

bernd authored 16 years ago

152) function delete_vhost($id)
153) {
154)   $id = (int) $id;
155)   if ($id == 0)
156)     system_failure("id == 0");
157)   $vhost = get_vhost_details($id);
bernd Logger mit Logleveln

bernd authored 14 years ago

158)   logger(LOG_INFO, 'modules/vhosts/include/vhosts', 'vhosts', 'Removing vhost #'.$id.' ('.$vhost['hostname'].'.'.$vhost['domain'].')');
bernd VHosts können bearbeitet we...

bernd authored 16 years ago

159)   db_query("DELETE FROM vhosts.vhost WHERE id={$vhost['id']} LIMIT 1");
160) }
161) 
bernd Aliases editieren

bernd authored 16 years ago

162) 
bernd vhost-Modul kann jetzt SVN-...

bernd authored 16 years ago

163) 
164) function make_svn_vhost($id) 
165) {
166)   $id = (int) $id;
167)   if ($id == 0)
168)     system_failure("id == 0");
bernd Logger mit Logleveln

bernd authored 14 years ago

169)   logger(LOG_INFO, 'modules/vhosts/include/vhosts', 'vhosts', 'Converting vhost #'.$id.' to SVN');
bernd letzter commit rückgängig

bernd authored 16 years ago

170)   db_query("REPLACE INTO vhosts.dav (vhost, type) VALUES ({$id}, 'svn')");
bernd Webapps implementiert

bernd authored 16 years ago

171)   db_query("DELETE FROM vhosts.webapps WHERE vhost={$id}");
bernd vhost-Modul kann jetzt SVN-...

bernd authored 16 years ago

172) }
173) 
174) function make_dav_vhost($id) 
175) {
176)   $id = (int) $id;
177)   if ($id == 0)
178)     system_failure("id == 0");
bernd Logger mit Logleveln

bernd authored 14 years ago

179)   logger(LOG_INFO, 'modules/vhosts/include/vhosts', 'vhosts', 'Converting vhost #'.$id.' to WebDAV');
bernd Docroot auch bei WebDAV anz...

bernd authored 16 years ago

180)   db_query("REPLACE INTO vhosts.dav (vhost, type, options) VALUES ({$id}, 'dav', 'nouserfile')");
bernd Webapps implementiert

bernd authored 16 years ago

181)   db_query("DELETE FROM vhosts.webapps WHERE vhost={$id}");
bernd vhost-Modul kann jetzt SVN-...

bernd authored 16 years ago

182) }
183) 
bernd Webapps implementiert

bernd authored 16 years ago

184) function make_regular_vhost($id)
bernd vhost-Modul kann jetzt SVN-...

bernd authored 16 years ago

185) {
186)   $id = (int) $id;
187)   if ($id == 0)
188)     system_failure("id == 0");
bernd Logger mit Logleveln

bernd authored 14 years ago

189)   logger(LOG_INFO, 'modules/vhosts/include/vhosts', 'vhosts', 'Converting vhost #'.$id.' to regular');
bernd vhost-Modul kann jetzt SVN-...

bernd authored 16 years ago

190)   db_query("DELETE FROM vhosts.dav WHERE vhost={$id}");
bernd Webapps implementiert

bernd authored 16 years ago

191)   db_query("DELETE FROM vhosts.webapps WHERE vhost={$id}");
bernd vhost-Modul kann jetzt SVN-...

bernd authored 16 years ago

192) }
193) 
194) 
195) function make_webapp_vhost($id, $webapp) 
196) {
197)   $id = (int) $id;
198)   $webapp = (int) $webapp;
199)   if ($id == 0)
200)     system_failure("id == 0");
bernd Webapps implementiert

bernd authored 16 years ago

201)   $result = db_query("SELECT displayname FROM vhosts.global_webapps WHERE id={$webapp};");
202)   if (mysql_num_rows($result) == 0)
203)     system_failure("webapp-id invalid");
204)   $webapp_name = mysql_fetch_object($result)->displayname;
bernd Logger mit Logleveln

bernd authored 14 years ago

205)   logger(LOG_INFO, 'modules/vhosts/include/vhosts', 'vhosts', 'Setting up webapp '.$webapp_name.' on vhost #'.$id);
bernd Webapps implementiert

bernd authored 16 years ago

206)   db_query("REPLACE INTO vhosts.webapps (vhost, webapp) VALUES ({$id}, {$webapp})");
207)   mail('webapps-setup@schokokeks.org', 'setup', 'setup');
bernd vhost-Modul kann jetzt SVN-...

bernd authored 16 years ago

208) }
209) 
210) 
bernd VHosts können bearbeitet we...

bernd authored 16 years ago

211) function save_vhost($vhost)
212) {
213)   if (! is_array($vhost))
214)     system_failure('$vhost kein array!');
215)   $id = (int) $vhost['id'];
216)   $hostname = maybe_null($vhost['hostname']);
bernd Webalizer/Statistik-Funktio...

bernd authored 14 years ago

217)   $domain = (int) $vhost['domain_id'];
bernd VHosts können bearbeitet we...

bernd authored 16 years ago

218)   if ($domain == 0)
bernd Aliases editieren

bernd authored 16 years ago

219)     system_failure('$domain == 0');
bernd Webalizer/Statistik-Funktio...

bernd authored 14 years ago

220)   if ($vhost['domain_id'] == -1)
bernd domain = NULL ==> user-subd...

bernd authored 16 years ago

221)     $domain = 'NULL';
bernd VHosts können bearbeitet we...

bernd authored 16 years ago

222)   $docroot = maybe_null($vhost['docroot']);
223)   $php = maybe_null($vhost['php']);
bernd CGI abschaltbar

bernd authored 14 years ago

224)   $cgi = ($vhost['cgi'] == 1 ? 1 : 0);
bernd SSL auch über webinterface...

bernd authored 16 years ago

225)   $ssl = maybe_null($vhost['ssl']);
bernd SuExec-Useraccount einstellbar

bernd authored 14 years ago

226)   $suexec_user = 'NULL';
227) 
228)   $available_suexec = available_suexec_users();
229)   foreach ($available_suexec AS $u)
230)     if ($u['uid'] == $vhost['suexec_user'])
231)       $suexec_user = $u['uid'];
232) 
bernd VHosts können bearbeitet we...

bernd authored 16 years ago

233)   $logtype = maybe_null($vhost['logtype']);
bernd error_log konfigurierbar

bernd authored 16 years ago

234)   $errorlog = (int) $vhost['errorlog'];
bernd fix für svn/nodocroot

bernd authored 16 years ago

235)   if ($vhost['is_svn']) {
bernd nodocroot für svn-hosts

bernd authored 16 years ago

236)     if (! $vhost['options']) $vhost['options']='nodocroot';
237)     else $vhost['options']+=",nodocroot";
238)   }
bernd VHosts können bearbeitet we...

bernd authored 16 years ago

239)   $options = mysql_real_escape_string( $vhost['options'] );
240) 
bernd Neue Zertifikatsverwaltung

bernd authored 14 years ago

241)   $cert = 0;
242)   $certs = user_certs();
243)   foreach ($certs as $c)
244)     if ($c['id'] == $vhost['cert'])
245)       $cert = $c['id'];
246)   if ($cert == 0)
247)     $cert = 'NULL';
248) 
bernd IP-Adressen aktivieren

bernd authored 14 years ago

249)   $ipv4 = 'NULL';
250)   $ipv4_avail = user_ipaddrs();
251)   if (in_array($vhost['ipv4'], $ipv4_avail))
252)   {
253)     $ipv4 = maybe_null($vhost['ipv4']);
254)   }
bernd IPv6

bernd authored 14 years ago

255) 
256)   $autoipv6 = ( $vhost['autoipv6'] == 1) ? '1' : '0';
257) 
bernd Webalizer/Statistik-Funktio...

bernd authored 14 years ago

258)   $stats = maybe_null($vhost['stats']);
bernd IP-Adressen aktivieren

bernd authored 14 years ago

259) 
bernd Logging

bernd authored 16 years ago

260)   if ($id != 0) {
bernd Logger mit Logleveln

bernd authored 14 years ago

261)     logger(LOG_INFO, 'modules/vhosts/include/vhosts', 'vhosts', 'Updating vhost #'.$id.' ('.$vhost['hostname'].'.'.$vhost['domain'].')');
bernd SuExec-Useraccount einstellbar

bernd authored 14 years ago

262)     db_query("UPDATE vhosts.vhost SET hostname={$hostname}, domain={$domain}, docroot={$docroot}, php={$php}, cgi={$cgi}, `ssl`={$ssl}, `suexec_user`={$suexec_user}, logtype={$logtype}, errorlog={$errorlog}, certid={$cert}, ipv4={$ipv4}, autoipv6={$autoipv6}, options='{$options}', stats={$stats} WHERE id={$id} LIMIT 1");
bernd Logging

bernd authored 16 years ago

263)   }
264)   else {
bernd Logger mit Logleveln

bernd authored 14 years ago

265)     logger(LOG_INFO, 'modules/vhosts/include/vhosts', 'vhosts', 'Creating vhost '.$vhost['hostname'].'.'.$vhost['domain'].'');
bernd SuExec-Useraccount einstellbar

bernd authored 14 years ago

266)     $result = db_query("INSERT INTO vhosts.vhost (user, hostname, domain, docroot, php, cgi, `ssl`, `suexec_user`, logtype, errorlog, certid, ipv4, autoipv6, options, stats) VALUES ({$_SESSION['userinfo']['uid']}, {$hostname}, {$domain}, {$docroot}, {$php}, {$cgi}, {$ssl}, {$suexec_user}, {$logtype}, {$errorlog}, {$cert}, {$ipv4}, {$autoipv6}, '{$options}', {$stats})");
bernd vhost-Modul kann jetzt SVN-...

bernd authored 16 years ago

267)     $id = mysql_insert_id();
bernd Logging

bernd authored 16 years ago

268)   }
bernd Webapps implementiert

bernd authored 16 years ago

269)   $oldvhost = get_vhost_details($id);
270)   /*
271)     these vars may be 0 or 1.
272)     So newval > oldval means that it has been switched on yet.
273)   */
274)   if ($vhost['is_dav'] > $oldvhost['is_dav'])
bernd vhost-Modul kann jetzt SVN-...

bernd authored 16 years ago

275)       make_dav_vhost($id);
bernd Webapps implementiert

bernd authored 16 years ago

276)   elseif ($vhost['is_svn'] > $oldvhost['is_svn'])
bernd vhost-Modul kann jetzt SVN-...

bernd authored 16 years ago

277)       make_svn_vhost($id);
bernd Webapps implementiert

bernd authored 16 years ago

278)   elseif ($vhost['is_webapp'] > $oldvhost['is_webapp'])
279)       make_webapp_vhost($id, $vhost['webapp_id']);
280)   elseif ($vhost['is_dav'] == 0 && $vhost['is_svn'] == 0 && $vhost['is_webapp'] == 0)
281)       make_regular_vhost($id);
bernd VHosts können bearbeitet we...

bernd authored 16 years ago

282) }
283) 
284) 
bernd Aliases editieren

bernd authored 16 years ago

285) function get_alias_details($id)
286) {
287)   $id = (int) $id;
288)   $uid = (int) $_SESSION['userinfo']['uid'];
289)   $result = db_query("SELECT * FROM vhosts.v_alias WHERE id={$id}");
290)   
291)   if (mysql_num_rows($result) != 1)
292)     system_failure('Interner Fehler beim Auslesen der Alias-Daten');
293)   
294)   $alias = mysql_fetch_assoc($result);
bernd domain = NULL ==> user-subd...

bernd authored 16 years ago

295)   
bernd auch aliases dürfen usernam...

bernd authored 16 years ago

296)   if ($alias['domain_id'] == NULL) {
bernd domain = NULL ==> user-subd...

bernd authored 16 years ago

297)     $alias['domain_id'] = -1;
bernd auch aliases dürfen usernam...

bernd authored 16 years ago

298)   }
bernd Aliases editieren

bernd authored 16 years ago

299) 
300)   /* Das bewirkt, dass nur die eigenen Aliase gesehen werden können */
301)   get_vhost_details( (int) $alias['vhost'] );
302) 
303)   return $alias;
304) }
305) 
306) 
307) function delete_alias($id)
308) {
309)   $id = (int) $id;
310)   $alias = get_alias_details($id);
311) 
bernd Logger mit Logleveln

bernd authored 14 years ago

312)   logger(LOG_INFO, 'modules/vhosts/include/vhosts', 'aliases', 'Removing alias #'.$id.' ('.$alias['hostname'].'.'.$alias['domain'].')');
bernd Aliases editieren

bernd authored 16 years ago

313)   db_query("DELETE FROM vhosts.alias WHERE id={$id}");
314) }
315) 
316) function save_alias($alias)
317) {
318)   if (! is_array($alias))
319)     system_failure('$alias kein array!');
bernd Neue aliase haben keine ID

bernd authored 14 years ago

320)   $id = (isset($alias['id']) ? (int) $alias['id'] : 0);
bernd Aliases editieren

bernd authored 16 years ago

321)   $hostname = maybe_null($alias['hostname']);
bernd Webalizer/Statistik-Funktio...

bernd authored 14 years ago

322)   $domain = (int) $alias['domain_id'];
bernd Aliases editieren

bernd authored 16 years ago

323)   if ($domain == 0)
324)     system_failure('$domain == 0');
bernd Webalizer/Statistik-Funktio...

bernd authored 14 years ago

325)   if ($alias['domain_id'] == -1)
bernd domain = NULL ==> user-subd...

bernd authored 16 years ago

326)     $domain = 'NULL';
bernd Aliases editieren

bernd authored 16 years ago

327)   $vhost = get_vhost_details( (int) $alias['vhost']);
328)   $options = mysql_real_escape_string( $alias['options'] );
329)   if ($id == 0) {
bernd Logger mit Logleveln

bernd authored 14 years ago

330)     logger(LOG_INFO, 'modules/vhosts/include/vhosts', 'aliases', 'Creating alias '.$alias['hostname'].'.'.$alias['domain'].' for VHost '.$vhost['id']);
bernd Aliases editieren

bernd authored 16 years ago

331)     db_query("INSERT INTO vhosts.alias (hostname, domain, vhost, options) VALUES ({$hostname}, {$domain}, {$vhost['id']}, '{$options}')");
332)   }
333)   else {
bernd Logger mit Logleveln

bernd authored 14 years ago

334)     logger(LOG_INFO, 'modules/vhosts/include/vhosts', 'aliases', 'Updating alias #'.$id.' ('.$alias['hostname'].'.'.$alias['domain'].')');
bernd Aliases editieren

bernd authored 16 years ago

335)     db_query("UPDATE vhosts.alias SET hostname={$hostname}, domain={$domain}, options='{$options}' WHERE id={$id} LIMIT 1");
336)   }
337) }
338) 
bernd neues VHosts-Modul (unbenut...

bernd authored 16 years ago

339) 
bernd SuExec-Useraccount einstellbar

bernd authored 14 years ago

340) function available_suexec_users()
341) {
342)   $uid = (int) $_SESSION['userinfo']['uid'];
343)   $result = db_query("SELECT uid, username FROM vhosts.available_users LEFT JOIN vhosts.v_useraccounts ON (uid = suexec_user) WHERE mainuser={$uid}");
344)   $ret = array();
345)   while ($i = mysql_fetch_assoc($result))
346)     $ret[] = $i;
347)   DEBUG('available suexec-users:');
348)   DEBUG($ret);
349)   return $ret;
350) 
351) }
bernd neues VHosts-Modul (unbenut...

bernd authored 16 years ago

352) 
bernd Neue Zertifikatsverwaltung

bernd authored 14 years ago

353) 
354) function user_ipaddrs()
355) {
356)   $uid = (int) $_SESSION['userinfo']['uid'];
357)   $result = db_query("SELECT ipaddr FROM vhosts.ipaddr_available WHERE uid={$uid}");
358)   $ret = array();
359)   while ($i = mysql_fetch_assoc($result))
360)   {
361)     $ret[] = $i['ipaddr'];
362)   }
363)   DEBUG($ret);
364)   return $ret;
365) }
366) 
367)