From 4dd2a44cf975cf71ad898cde271af040ba4d468a Mon Sep 17 00:00:00 2001 From: Daniel Berteaud Date: Tue, 19 Nov 2013 09:14:02 +0100 Subject: [PATCH] Use a DB entry to get the URI --- .../e-smith/templates/etc/opensondage/variables.php/10Url | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/root/etc/e-smith/templates/etc/opensondage/variables.php/10Url b/root/etc/e-smith/templates/etc/opensondage/variables.php/10Url index 6398cb5..acc23c8 100644 --- a/root/etc/e-smith/templates/etc/opensondage/variables.php/10Url +++ b/root/etc/e-smith/templates/etc/opensondage/variables.php/10Url @@ -1,14 +1,7 @@ { -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');"; +my $uri = $opensondage{'Uri'} || "$SystemName.$DomainName/opensondage/"; +$uri =~ s/https?:\/\///; +$OUT .= "define('STUDS_URL', '$uri');"; + }