8160df9ce16aba68fa0d9d2e4c0c20e4dd40e9c8
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 VHosts können bearbeitet we...

bernd authored 16 years ago

22) function empty_vhost()
23) {
bernd neue Bilder, mehr SSL-Zerti...

bernd authored 14 years ago

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

bernd authored 16 years ago

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

bernd authored 16 years ago

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

bernd authored 15 years ago

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

bernd authored 16 years ago

29)   
30)   $vhost['homedir'] = $_SESSION['userinfo']['homedir'];
31)   $vhost['docroot'] = NULL;
bernd PHP 5.3 als Default

bernd authored 14 years ago

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

bernd authored 14 years ago

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

bernd authored 16 years ago

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

bernd authored 14 years ago

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

bernd authored 16 years ago

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

bernd authored 14 years ago

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

bernd authored 16 years ago

38)   $vhost['is_dav'] = 0;
39)   $vhost['is_svn'] = 0;
40)   $vhost['is_webapp'] = 0;
bernd Neue Zertifikatsverwaltung

bernd authored 14 years ago

41)   $vhost['webapp_id'] = NULL;
42)   
43)   $vhost['cert'] = NULL;
bernd Einige notices (undefined i...

bernd authored 14 years ago

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

bernd authored 14 years ago

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

bernd authored 14 years ago

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

bernd authored 14 years ago

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

bernd authored 16 years ago

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

bernd authored 14 years ago

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

bernd authored 16 years ago

50)   return $vhost;
51) }
52) 
53) 
bernd Aliases editieren

bernd authored 16 years ago

54) function empty_alias()
55) {
56)   $alias['hostname'] = '';
57)   
bernd domain = NULL ==> user-subd...

bernd authored 16 years ago

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

bernd authored 15 years ago

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

bernd authored 16 years ago

60)   
61)   $alias['options'] = '';
62)   return $alias;
63) }
64) 
65) 
bernd VHosts können bearbeitet we...

bernd authored 16 years ago

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

bernd authored 16 years ago

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

bernd authored 15 years ago

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

bernd authored 16 years ago

69)   if ($domainlist == NULL)
70)     $domainlist = get_domain_list($_SESSION['customerinfo']['customerno'],
71)                                   $_SESSION['userinfo']['uid']);
72)   $selected = (int) $selected;
73) 
bernd VHosts können bearbeitet we...

bernd authored 16 years ago

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

bernd authored 15 years ago

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

bernd authored 16 years ago

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

bernd authored 16 years ago

77)   foreach ($domainlist as $dom)
78)   {
bernd Aliases editieren

bernd authored 16 years ago

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

bernd authored 16 years ago

80)     $ret .= "<option value=\"{$dom->id}\"{$s}>{$dom->fqdn}</option>\n";
81)   }
82)   $ret .= '</select>';
83)   return $ret;
84) }
85) 
86) 
87) 
88) function get_vhost_details($id)
89) {
90)   $id = (int) $id;
91)   $uid = (int) $_SESSION['userinfo']['uid'];
bernd VHosts-Modul mit neuem Layo...

bernd authored 16 years ago

92)   $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

93)   if (mysql_num_rows($result) != 1)
94)     system_failure('Interner Fehler beim Auslesen der Daten');
95) 
bernd Neue Zertifikatsverwaltung

bernd authored 14 years ago

96)   $ret = mysql_fetch_assoc($result);
97)   DEBUG($ret);
98)   return $ret;
bernd neues VHosts-Modul (unbenut...

bernd authored 16 years ago

99) }
100) 
101) 
102) function get_aliases($vhost)
103) {
104)   $result = db_query("SELECT id,fqdn,options FROM vhosts.v_alias WHERE vhost={$vhost}");
105)   $ret = array();
bernd Aliases editieren

bernd authored 16 years ago

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

bernd authored 16 years ago

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

bernd authored 16 years ago

108)   }
109)   return $ret;
110) }
111) 
112) 
113) 
114) function get_all_aliases($vhost)
115) {
bernd Weniger Datenbankzugriffe b...

bernd authored 14 years ago

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

bernd authored 16 years ago

117)   $aliases = get_aliases($vhost['id']);
118)   $ret = array();
119)   if (strstr($vhost['options'], 'aliaswww')) {
120)     array_push($ret, array('id' => 'www', 'fqdn' => 'www.'.$vhost['fqdn'], 'options' => (strstr($vhost['options'], 'forwardwww') ? 'forward' : '')));
121)   }
122)   foreach ($aliases as $item) {
123)     array_push($ret, $item);
124)     if (strstr($item['options'], 'aliaswww')) {
125)       array_push($ret, array('id' => 'www_'.$item['id'], 'fqdn' => 'www.'.$item['fqdn'], 'options' => (strstr($item['options'], 'forward') ? 'forward' : '')));
126)     }
127)   }
bernd neues VHosts-Modul (unbenut...

bernd authored 16 years ago

128)   return $ret;
129) }
130) 
bernd Aliases editieren

bernd authored 16 years ago

131) 
bernd Webapps implementiert

bernd authored 16 years ago

132) function list_available_webapps()
133) {
134)   $result = db_query("SELECT id,displayname FROM vhosts.global_webapps");
135)   $ret = array();
136)   while ($item = mysql_fetch_assoc($result))
137)     array_push($ret, $item);
138)   return $ret;
139) }
140) 
141) 
bernd VHosts können bearbeitet we...

bernd authored 16 years ago

142) function delete_vhost($id)
143) {
144)   $id = (int) $id;
145)   if ($id == 0)
146)     system_failure("id == 0");
147)   $vhost = get_vhost_details($id);
bernd Logger mit Logleveln

bernd authored 14 years ago

148)   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

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

bernd authored 16 years ago

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

bernd authored 16 years ago

153) 
154) function make_svn_vhost($id) 
155) {
156)   $id = (int) $id;
157)   if ($id == 0)
158)     system_failure("id == 0");
bernd Logger mit Logleveln

bernd authored 14 years ago

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

bernd authored 16 years ago

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

bernd authored 16 years ago

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

bernd authored 16 years ago

162) }
163) 
164) function make_dav_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 WebDAV');
bernd Docroot auch bei WebDAV anz...

bernd authored 16 years ago

170)   db_query("REPLACE INTO vhosts.dav (vhost, type, options) VALUES ({$id}, 'dav', 'nouserfile')");
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) 
bernd Webapps implementiert

bernd authored 16 years ago

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

bernd authored 16 years ago

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 regular');
bernd vhost-Modul kann jetzt SVN-...

bernd authored 16 years ago

180)   db_query("DELETE FROM vhosts.dav WHERE vhost={$id}");
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) 
184) 
185) function make_webapp_vhost($id, $webapp) 
186) {
187)   $id = (int) $id;
188)   $webapp = (int) $webapp;
189)   if ($id == 0)
190)     system_failure("id == 0");
bernd Webapps implementiert

bernd authored 16 years ago

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

bernd authored 14 years ago

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

bernd authored 16 years ago

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

bernd authored 16 years ago

198) }
199) 
200) 
bernd VHosts können bearbeitet we...

bernd authored 16 years ago

201) function save_vhost($vhost)
202) {
203)   if (! is_array($vhost))
204)     system_failure('$vhost kein array!');
205)   $id = (int) $vhost['id'];
206)   $hostname = maybe_null($vhost['hostname']);
bernd Webalizer/Statistik-Funktio...

bernd authored 14 years ago

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

bernd authored 16 years ago

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

bernd authored 16 years ago

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

bernd authored 14 years ago

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

bernd authored 16 years ago

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

bernd authored 16 years ago

212)   $docroot = maybe_null($vhost['docroot']);
213)   $php = maybe_null($vhost['php']);
bernd CGI abschaltbar

bernd authored 14 years ago

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

bernd authored 16 years ago

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

bernd authored 14 years ago

216)   $suexec_user = 'NULL';
217) 
218)   $available_suexec = available_suexec_users();
219)   foreach ($available_suexec AS $u)
220)     if ($u['uid'] == $vhost['suexec_user'])
221)       $suexec_user = $u['uid'];
222) 
bernd VHosts können bearbeitet we...

bernd authored 16 years ago

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

bernd authored 16 years ago

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

bernd authored 16 years ago

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

bernd authored 16 years ago

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

bernd authored 16 years ago

229)   $options = mysql_real_escape_string( $vhost['options'] );
230) 
bernd Neue Zertifikatsverwaltung

bernd authored 14 years ago

231)   $cert = 0;
232)   $certs = user_certs();
233)   foreach ($certs as $c)
234)     if ($c['id'] == $vhost['cert'])
235)       $cert = $c['id'];
236)   if ($cert == 0)
237)     $cert = 'NULL';
238) 
bernd IP-Adressen aktivieren

bernd authored 14 years ago

239)   $ipv4 = 'NULL';
240)   $ipv4_avail = user_ipaddrs();
241)   if (in_array($vhost['ipv4'], $ipv4_avail))
242)   {
243)     $ipv4 = maybe_null($vhost['ipv4']);
244)   }
bernd IPv6

bernd authored 14 years ago

245) 
246)   $autoipv6 = ( $vhost['autoipv6'] == 1) ? '1' : '0';
247) 
bernd Webalizer/Statistik-Funktio...

bernd authored 14 years ago

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

bernd authored 14 years ago

249) 
bernd Logging

bernd authored 16 years ago

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

bernd authored 14 years ago

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

bernd authored 14 years ago

252)     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

253)   }
254)   else {
bernd Logger mit Logleveln

bernd authored 14 years ago

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

bernd authored 14 years ago

256)     $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

257)     $id = mysql_insert_id();
bernd Logging

bernd authored 16 years ago

258)   }
bernd Webapps implementiert

bernd authored 16 years ago

259)   $oldvhost = get_vhost_details($id);
260)   /*
261)     these vars may be 0 or 1.
262)     So newval > oldval means that it has been switched on yet.
263)   */
264)   if ($vhost['is_dav'] > $oldvhost['is_dav'])
bernd vhost-Modul kann jetzt SVN-...

bernd authored 16 years ago

265)       make_dav_vhost($id);
bernd Webapps implementiert

bernd authored 16 years ago

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

bernd authored 16 years ago

267)       make_svn_vhost($id);
bernd Webapps implementiert

bernd authored 16 years ago

268)   elseif ($vhost['is_webapp'] > $oldvhost['is_webapp'])
269)       make_webapp_vhost($id, $vhost['webapp_id']);
270)   elseif ($vhost['is_dav'] == 0 && $vhost['is_svn'] == 0 && $vhost['is_webapp'] == 0)
271)       make_regular_vhost($id);
bernd VHosts können bearbeitet we...

bernd authored 16 years ago

272) }
273) 
274) 
bernd Aliases editieren

bernd authored 16 years ago

275) function get_alias_details($id)
276) {
277)   $id = (int) $id;
278)   $uid = (int) $_SESSION['userinfo']['uid'];
279)   $result = db_query("SELECT * FROM vhosts.v_alias WHERE id={$id}");
280)   
281)   if (mysql_num_rows($result) != 1)
282)     system_failure('Interner Fehler beim Auslesen der Alias-Daten');
283)   
284)   $alias = mysql_fetch_assoc($result);
bernd domain = NULL ==> user-subd...

bernd authored 16 years ago

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

bernd authored 16 years ago

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

bernd authored 16 years ago

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

bernd authored 16 years ago

288)   }
bernd Aliases editieren

bernd authored 16 years ago

289) 
290)   /* Das bewirkt, dass nur die eigenen Aliase gesehen werden können */
291)   get_vhost_details( (int) $alias['vhost'] );
292) 
293)   return $alias;
294) }
295) 
296) 
297) function delete_alias($id)
298) {
299)   $id = (int) $id;
300)   $alias = get_alias_details($id);
301) 
bernd Logger mit Logleveln

bernd authored 14 years ago

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

bernd authored 16 years ago

303)   db_query("DELETE FROM vhosts.alias WHERE id={$id}");
304) }
305) 
306) function save_alias($alias)
307) {
308)   if (! is_array($alias))
309)     system_failure('$alias kein array!');
bernd Neue aliase haben keine ID

bernd authored 14 years ago

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

bernd authored 16 years ago

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

bernd authored 14 years ago

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

bernd authored 16 years ago

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

bernd authored 14 years ago

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

bernd authored 16 years ago

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

bernd authored 16 years ago

317)   $vhost = get_vhost_details( (int) $alias['vhost']);
318)   $options = mysql_real_escape_string( $alias['options'] );
319)   if ($id == 0) {
bernd Logger mit Logleveln

bernd authored 14 years ago

320)     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

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

bernd authored 14 years ago

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

bernd authored 16 years ago

325)     db_query("UPDATE vhosts.alias SET hostname={$hostname}, domain={$domain}, options='{$options}' WHERE id={$id} LIMIT 1");
326)   }
327) }
328) 
bernd neues VHosts-Modul (unbenut...

bernd authored 16 years ago

329) 
bernd SuExec-Useraccount einstellbar

bernd authored 14 years ago

330) function available_suexec_users()
331) {
332)   $uid = (int) $_SESSION['userinfo']['uid'];
333)   $result = db_query("SELECT uid, username FROM vhosts.available_users LEFT JOIN vhosts.v_useraccounts ON (uid = suexec_user) WHERE mainuser={$uid}");
334)   $ret = array();
335)   while ($i = mysql_fetch_assoc($result))
336)     $ret[] = $i;
337)   DEBUG('available suexec-users:');
338)   DEBUG($ret);
339)   return $ret;
340) 
341) }
bernd neues VHosts-Modul (unbenut...

bernd authored 16 years ago

342) 
bernd Neue Zertifikatsverwaltung

bernd authored 14 years ago

343) 
344) function user_ipaddrs()
345) {
346)   $uid = (int) $_SESSION['userinfo']['uid'];
347)   $result = db_query("SELECT ipaddr FROM vhosts.ipaddr_available WHERE uid={$uid}");
348)   $ret = array();
349)   while ($i = mysql_fetch_assoc($result))
350)   {
351)     $ret[] = $i['ipaddr'];
352)   }
353)   DEBUG($ret);
354)   return $ret;
355) }
356) 
357)