a6f3794e221bc1fd6303cca3b84638fe92c14223
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-Option nur anzeigen we...

bernd authored 13 years ago

22) function ipv6_possible($serverid)
23) {
24)   $serverid = (int) $serverid;
25)   $result = db_query("SELECT v6_prefix FROM system.servers WHERE id={$serverid}");
26)   $server = mysql_fetch_assoc($result);
27)   return ($server['v6_prefix'] != NULL);
28) }
29) 
bernd VHosts können bearbeitet we...

bernd authored 16 years ago

30) function empty_vhost()
31) {
bernd neue Bilder, mehr SSL-Zerti...

bernd authored 14 years ago

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

bernd authored 16 years ago

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

bernd authored 16 years ago

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

bernd authored 14 years ago

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

bernd authored 16 years ago

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

bernd authored 14 years ago

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

bernd authored 14 years ago

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

bernd authored 16 years ago

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

bernd authored 14 years ago

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

bernd authored 16 years ago

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

bernd authored 14 years ago

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

bernd authored 16 years ago

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

bernd authored 14 years ago

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

bernd authored 14 years ago

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

bernd authored 14 years ago

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

bernd authored 14 years ago

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

bernd authored 14 years ago

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

bernd authored 16 years ago

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

bernd authored 14 years ago

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

bernd authored 16 years ago

58)   return $vhost;
59) }
60) 
61) 
bernd Aliases editieren

bernd authored 16 years ago

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

bernd authored 16 years ago

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

bernd authored 14 years ago

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

bernd authored 16 years ago

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

bernd authored 16 years ago

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

bernd authored 16 years ago

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

bernd authored 14 years ago

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

bernd authored 16 years ago

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

bernd authored 16 years ago

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

bernd authored 14 years ago

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

bernd authored 16 years ago

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

bernd authored 16 years ago

85)   foreach ($domainlist as $dom)
86)   {
bernd Aliases editieren

bernd authored 16 years ago

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

bernd authored 16 years ago

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

bernd authored 16 years ago

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

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

bernd authored 14 years ago

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

bernd authored 16 years ago

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

bernd authored 16 years ago

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

bernd authored 16 years ago

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

bernd authored 16 years ago

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

bernd authored 14 years ago

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

bernd authored 16 years ago

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

bernd authored 16 years ago

136)   return $ret;
137) }
138) 
bernd Aliases editieren

bernd authored 16 years ago

139) 
bernd Webapps implementiert

bernd authored 16 years ago

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

bernd authored 16 years ago

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

bernd authored 14 years ago

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

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

bernd authored 16 years ago

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

bernd authored 16 years ago

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

bernd authored 14 years ago

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

bernd authored 16 years ago

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

bernd authored 16 years ago

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

bernd authored 16 years ago

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

bernd authored 14 years ago

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

bernd authored 16 years ago

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

bernd authored 16 years ago

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

bernd authored 16 years ago

180) }
181) 
bernd Webapps implementiert

bernd authored 16 years ago

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

bernd authored 16 years ago

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

bernd authored 14 years ago

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

bernd authored 16 years ago

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

bernd authored 16 years ago

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

bernd authored 16 years ago

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

bernd authored 16 years ago

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

bernd authored 14 years ago

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

bernd authored 16 years ago

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

bernd authored 16 years ago

206) }
207) 
208) 
bernd VHosts können bearbeitet we...

bernd authored 16 years ago

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

bernd authored 14 years ago

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

bernd authored 16 years ago

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

bernd authored 16 years ago

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

bernd authored 14 years ago

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

bernd authored 16 years ago

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

bernd authored 16 years ago

220)   $docroot = maybe_null($vhost['docroot']);
221)   $php = maybe_null($vhost['php']);
bernd CGI abschaltbar

bernd authored 14 years ago

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

bernd authored 16 years ago

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

bernd authored 14 years ago

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

bernd authored 16 years ago

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

bernd authored 16 years ago

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

bernd authored 16 years ago

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

bernd authored 16 years ago

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

bernd authored 16 years ago

237)   $options = mysql_real_escape_string( $vhost['options'] );
238) 
bernd Neue Zertifikatsverwaltung

bernd authored 14 years ago

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

bernd authored 14 years ago

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

bernd authored 14 years ago

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

bernd authored 14 years ago

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

bernd authored 14 years ago

257) 
bernd Logging

bernd authored 16 years ago

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

bernd authored 14 years ago

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

bernd authored 14 years ago

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

261)   }
262)   else {
bernd Logger mit Logleveln

bernd authored 14 years ago

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

bernd authored 14 years ago

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

265)     $id = mysql_insert_id();
bernd Logging

bernd authored 16 years ago

266)   }
bernd Webapps implementiert

bernd authored 16 years ago

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

bernd authored 16 years ago

273)       make_dav_vhost($id);
bernd Webapps implementiert

bernd authored 16 years ago

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

bernd authored 16 years ago

275)       make_svn_vhost($id);
bernd Webapps implementiert

bernd authored 16 years ago

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

bernd authored 16 years ago

280) }
281) 
282) 
bernd Aliases editieren

bernd authored 16 years ago

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

bernd authored 16 years ago

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

bernd authored 16 years ago

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

bernd authored 16 years ago

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

bernd authored 16 years ago

296)   }
bernd Aliases editieren

bernd authored 16 years ago

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

bernd authored 14 years ago

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

bernd authored 16 years ago

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

bernd authored 14 years ago

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

bernd authored 16 years ago

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

bernd authored 14 years ago

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

bernd authored 16 years ago

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

bernd authored 14 years ago

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

bernd authored 16 years ago

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

bernd authored 16 years ago

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

bernd authored 14 years ago

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

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

bernd authored 14 years ago

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

bernd authored 16 years ago

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

bernd authored 16 years ago

337) 
bernd SuExec-Useraccount einstellbar

bernd authored 14 years ago

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

bernd authored 16 years ago

350) 
bernd Neue Zertifikatsverwaltung

bernd authored 14 years ago

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