[Koha-bugs] [Bug 11575] OPACBaseURL sometimes set by ENV variable and not system preference

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Tue Feb 25 06:26:45 CET 2014


http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11575

M. Tompsett <mtompset at hotmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #24556|0                           |1
        is obsolete|                            |

--- Comment #3 from M. Tompsett <mtompset at hotmail.com> ---
Created attachment 25601
  -->
http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=25601&action=edit
[SIGNED OFF] Bug 11575 - OPACBaseURL sometimes set by ENV variable and not
system preference

This patch changes how the OPACBaseURL parameter gets set in the subroutine
get_template_and_user in Auth.pm.

Currently, it's being set by the $ENV{'SERVER_NAME'} variable, which is
typically filled by the URL that the user uses to access a page. While this
works in many cases, this causes a problem when using a proxy server. The
SERVER_NAME will instead be the domain of the proxy server (for more
info, read the comments already on this bug on Bugzilla). There are
ways to compensate for proxy servers. However, such a solution seems
a bit convoluted...

Elsewhere in Koha, we use the system preference OPACBaseURL, so I think
it makes sense to use it here as well.

I did leave the $ENV{'SERVER_NAME'} as a full back if OPACBaseURL isn't
set, but that's it.

_TEST PLAN_

Before applying:

1) Clear your OPACBaseURL preference
2) Perform a search in the OPAC
3) Click on or hover over the orange RSS icon
4) Note that the URL you used to access the site is the URL used
for the RSS link
5) Add an OPACBaseURL that isn't the same as the actual OPAC URL
6) Note that the OPACBaseURL system preference has no effect here

After applying the patch:

7) Refresh the page
8) Note that the URL you see now is actually the OPACBaseURL system
preference that you set
9) Clear your OPACBaseURL system preference
10) Refresh your search page
11) Note that the URL has reverted back to the URL that you used
to access the page

Followed test plan, worked as expected. I have my apache
redirecting HTTP to HTTPS, and put my IP address in URL which
did trigger the OPAC as expected. The IP address was in the RSS
link as the test predicted after the patch. HTTPS in both cases.

Signed-off-by: Mark Tompsett <mtompset at hotmail.com>

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list