Adapt the URL if a vhost has its DocumentRoot on the app
This commit is contained in:
parent
ef7c6e3fc1
commit
2380ecd84c
|
@ -1 +1,14 @@
|
|||
define('STUDS_URL', '{$SystemName.$DomainName}');
|
||||
{
|
||||
use esmith::DomainsDB;
|
||||
my $d = esmith::DomainsDB->open_ro || die "Couldn't open DomainsDB";
|
||||
my $vhost = "$SystemName.$DomainName";
|
||||
foreach ($d->get_all_by_prop(type => 'domain'), $d->get_all_by_prop(type => 'vhost')){
|
||||
my $root = $_->prop('DocumentRoot') || '';
|
||||
if ($root eq '/usr/share/opensondage'){
|
||||
$vhost = $_->key;
|
||||
last;
|
||||
}
|
||||
}
|
||||
|
||||
$OUT .= "define('STUDS_URL', '$vhost');";
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue