schokokeks.org GbR commited on 2013-06-04 16:40:45
Zeige 1 geänderte Dateien mit 5 Einfügungen und 1 Löschungen.
... | ... |
@@ -254,6 +254,7 @@ function make_webapp_vhost($id, $webapp) |
254 | 254 |
|
255 | 255 |
function check_hostname_collision($hostname, $domain) |
256 | 256 |
{ |
257 |
+ $uid = (int) $_SESSION['userinfo']['uid']; |
|
257 | 258 |
# Neuer vhost => Prüfe Duplikat |
258 | 259 |
$hostnamecheck = "hostname='".mysql_real_escape_string($hostname)."'"; |
259 | 260 |
if (! $hostname) { |
... | ... |
@@ -261,12 +262,15 @@ function check_hostname_collision($hostname, $domain) |
261 | 262 |
} |
262 | 263 |
$domaincheck = "domain=". (int) $domain ; |
263 | 264 |
if ($domain == -1) { |
264 |
- $domaincheck = "domain IS NULL"; |
|
265 |
+ $domaincheck = "domain IS NULL AND user={$uid}"; |
|
265 | 266 |
} |
266 | 267 |
$result = db_query("SELECT id FROM vhosts.vhost WHERE {$hostnamecheck} AND {$domaincheck}"); |
267 | 268 |
if (mysql_num_rows($result) > 0) { |
268 | 269 |
system_failure('Eine Konfiguration mit diesem Namen gibt es bereits.'); |
269 | 270 |
} |
271 |
+ if ($domain == -1) { |
|
272 |
+ return ; |
|
273 |
+ } |
|
270 | 274 |
$result = db_query("SELECT id, vhost FROM vhosts.alias WHERE {$hostnamecheck} AND {$domaincheck}"); |
271 | 275 |
if (mysql_num_rows($result) > 0) { |
272 | 276 |
$data = mysql_fetch_assoc($result); |
273 | 277 |