From 7b73242850bd12c3b6d0d442f506d8e081790333 Mon Sep 17 00:00:00 2001 From: Daniel Berteaud Date: Mon, 18 Nov 2013 20:47:58 +0100 Subject: [PATCH] Find the URI from a DB entry --- root/etc/e-smith/templates/etc/dl.php/10Url | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/root/etc/e-smith/templates/etc/dl.php/10Url b/root/etc/e-smith/templates/etc/dl.php/10Url index 65471fe..64b64d2 100644 --- a/root/etc/e-smith/templates/etc/dl.php/10Url +++ b/root/etc/e-smith/templates/etc/dl.php/10Url @@ -1,14 +1,6 @@ { -use esmith::DomainsDB; -my $d = esmith::DomainsDB->open_ro || die "Couldn't open DomainsDB"; -my $vhost = "$SystemName.$DomainName/dl"; -foreach ($d->get_all_by_prop(type => 'domain'), $d->get_all_by_prop(type => 'vhost')){ - my $root = $_->prop('DocumentRoot') || ''; - if ($root eq '/usr/share/dl'){ - $vhost = $_->key; - last; - } -} +my $uri = $dl{'Uri'} || "https://$SystemName.$DomainName/dl"; +$uri .= '/' if ($uri !~ !/$!); -$OUT .= "\$masterPath = '$vhost'"; +$OUT .= "\$masterPath = '$uri';"; }