From: Galen Charlton Date: Mon, 2 Jun 2008 02:43:30 +0000 (-0500) Subject: calculate OPACBaseURL instead of using syspref X-Git-Tag: v3.00.00-stableRC1~229 X-Git-Url: http://koha-dev.rot13.org:8081/gitweb/?a=commitdiff_plain;h=5e5ce6b7f9aa188209b0d9f6fd3b4f6e14d490cb;p=koha-ffzg.git calculate OPACBaseURL instead of using syspref Calculate OPACBaseURL from the CGI environment variables instead of using the system preference. As a result of this patch, it should be possible to change the hostname, protocol, or port of the OPAC without having to reset a system preference. Also added a FIXME to opac/unapi - the URL of the SRU/W server has no necessary relationship to the URL of the OPAC. Once this patch is confirmed, the syspref can be removed. Signed-off-by: Joshua Ferraro --- diff --git a/C4/Auth.pm b/C4/Auth.pm index 3951892e57..6545681a1a 100755 --- a/C4/Auth.pm +++ b/C4/Auth.pm @@ -317,7 +317,9 @@ sub get_template_and_user { TagsEnabled => C4::Context->preference("TagsEnabled"), GoogleJackets => C4::Context->preference("GoogleJackets"), AuthorisedValueImages => C4::Context->preference("AuthorisedValueImages"), - OPACBaseURL=> C4::Context->preference("OPACBaseURL"), + OPACBaseURL=> ($in->{'query'}->https() ? "https://" : "http://") . + $ENV{'SERVER_NAME'} . + ($ENV{'SERVER_PORT'} eq "80" ? '' : ":$ENV{'SERVER_PORT'}"), ); } $template->param(listloop=>[{shelfname=>"Freelist", shelfnumber=>110}]); diff --git a/koha-tmpl/opac-tmpl/prog/en/includes/masthead.inc b/koha-tmpl/opac-tmpl/prog/en/includes/masthead.inc index adbdd39040..bdfd7f7007 100644 --- a/koha-tmpl/opac-tmpl/prog/en/includes/masthead.inc +++ b/koha-tmpl/opac-tmpl/prog/en/includes/masthead.inc @@ -115,10 +115,10 @@