Bug 13485 - Add a page to display links to restricted sites
Summary: Add a page to display links to restricted sites
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: master
Hardware: All All
: P5 - low new feature (vote)
Assignee: Maxime Beaulieu
QA Contact: Testopia
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-12-19 18:42 UTC by simith.doliveira
Modified: 2016-12-05 21:22 UTC (History)
9 users (show)

See Also:
Change sponsored?: Sponsored
Patch complexity: Medium patch
Bot Control: ---
When did the bot last check this:
Who signed the patch off:
Text to go in the release notes:


Attachments
Bug 13485 - Add a proxy page (7.44 KB, patch)
2014-12-19 18:48 UTC, simith.doliveira
Details | Diff | Splinter Review
Bug 13485 - Add a proxy page (7.44 KB, patch)
2014-12-19 19:45 UTC, simith.doliveira
Details | Diff | Splinter Review
[Signed-off] Bug 13485 - Add a proxy page (8.23 KB, patch)
2014-12-20 16:11 UTC, Marc Véron
Details | Diff | Splinter Review
Bug 12823: Alert about defining the SRU search field mappings (1.75 KB, patch)
2015-01-02 16:27 UTC, Kyle M Hall
Details | Diff | Splinter Review
[PASSED QA] Bug 13485 - Add a proxy page (8.21 KB, patch)
2015-01-02 16:29 UTC, Kyle M Hall
Details | Diff | Splinter Review
[PASSED QA] Bug 13485 [QA Followup] (2.03 KB, patch)
2015-01-02 16:29 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 13485 - Add a proxy page (7.27 KB, patch)
2015-07-07 15:19 UTC, Maxime Beaulieu
Details | Diff | Splinter Review
Bug 13485 [QA Followup] (1.12 KB, patch)
2015-07-07 15:19 UTC, Maxime Beaulieu
Details | Diff | Splinter Review
Bug 13485 - Atomic Update + Rename Proxy page to Restricted page (10.11 KB, patch)
2015-07-07 15:20 UTC, Maxime Beaulieu
Details | Diff | Splinter Review
Bug 13485 - Add a proxy page (9.55 KB, patch)
2015-08-05 11:54 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 13485: Use the Koha template plugin to access syspref values (2.62 KB, patch)
2015-08-05 11:54 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description simith.doliveira 2014-12-19 18:42:55 UTC
This patch adds a proxy page that allows users to access external resources when connected or from specific IP ranges.
If the user is not connected or is not from the specified IP, the connection page will be displayed.
Comment 1 simith.doliveira 2014-12-19 18:48:02 UTC Comment hidden (obsolete)
Comment 2 simith.doliveira 2014-12-19 19:45:35 UTC Comment hidden (obsolete)
Comment 3 simith.doliveira 2014-12-19 19:47:09 UTC
Sponsored-by: Chelsea biblio ( http://biblio.chelsea.ca )
Comment 4 simith.doliveira 2014-12-19 19:47:34 UTC
To test:

I) Apply the patch
II) Run updatedatabase.pl


scenario I)

1) Add some content in ProxyPageContent and ProxyPageTitle sysprefs.
2) Add your machine ip (ex. 127.0.0)   
3) Validate cgi-bin/koha/opac-proxypage.pl shows a page with ProxyPageContent and ProxyPageTitle contents.

scenario II)

1) Logout opac page 
2) Add some content in ProxyPageContent and ProxyPageTitle sysprefs.
3) Add other ip that your machine ip.   
4) Validate: cgi-bin/koha/opac-proxypage.pl shows a login page.
5) Validate: cgi-bin/koha/opac-proxypage.pl shows a page with ProxyPageContent and ProxyPageTitle contents after login.
Comment 5 Marc Véron 2014-12-20 16:11:40 UTC Comment hidden (obsolete)
Comment 6 David Cook 2014-12-22 01:47:54 UTC
Hi Simith:

Could you elaborate about the purpose of this proxy page?

Is it a place to put links that only logged in users should see?

I've been thinking about adding some proxy functionality where the user would click on an opac link (e.g. opac-proxy.pl?id=ebsco) and get redirected to an Ebsco page using credentials stored on the server.

It sounds like we might have similar goals?
Comment 7 Eric Bégin 2014-12-22 13:44:36 UTC
David,

You are correct. The proxy page is used for ressources that are restricted to connected users.

The main usage is to allow patrons to access resources available by providers using a HTTP Referer mechanism.

Note : This implementation doesn't include any password mechanism. Adding it would be possible. Borrowers attributes could be use to manage the username / passwords. For exemple, user accessing proxypage.pl?id=ebsco could look at ebscoUsername and ebscoPassword attributes.
Comment 8 David Cook 2014-12-22 23:19:40 UTC
(In reply to Eric Bégin from comment #7)
> David,
> 
> You are correct. The proxy page is used for ressources that are restricted
> to connected users.
> 
> The main usage is to allow patrons to access resources available by
> providers using a HTTP Referer mechanism.
> 
> Note : This implementation doesn't include any password mechanism. Adding it
> would be possible. Borrowers attributes could be use to manage the username
> / passwords. For exemple, user accessing proxypage.pl?id=ebsco could look at
> ebscoUsername and ebscoPassword attributes.

Thanks for confirming, Eric :).

I might take a look at adding that later down the track, depending if we have anyone needing it. We have a client or two who are looking at something along these lines, but nothing has been 100% decided yet.
Comment 9 Kyle M Hall 2015-01-02 16:27:05 UTC Comment hidden (obsolete)
Comment 10 Kyle M Hall 2015-01-02 16:29:37 UTC Comment hidden (obsolete)
Comment 11 Kyle M Hall 2015-01-02 16:29:43 UTC Comment hidden (obsolete)
Comment 12 Kyle M Hall 2015-01-02 16:31:26 UTC
(In reply to David Cook from comment #8)
> (In reply to Eric Bégin from comment #7)
> > David,
> > 
> > You are correct. The proxy page is used for ressources that are restricted
> > to connected users.
> > 
> > The main usage is to allow patrons to access resources available by
> > providers using a HTTP Referer mechanism.
> > 
> > Note : This implementation doesn't include any password mechanism. Adding it
> > would be possible. Borrowers attributes could be use to manage the username
> > / passwords. For exemple, user accessing proxypage.pl?id=ebsco could look at
> > ebscoUsername and ebscoPassword attributes.
> 
> Thanks for confirming, Eric :).
> 
> I might take a look at adding that later down the track, depending if we
> have anyone needing it. We have a client or two who are looking at something
> along these lines, but nothing has been 100% decided yet.

To make this more extensible, we could simply evaluate the ProxyPageContent pref as TT, and then one could take advantage of all the TT plugins such as Koha.Preference.
Comment 13 Chris Cormack 2015-01-02 19:36:08 UTC
Changed the bug report, this does no proxying at all. So the title was really confusing
Comment 14 David Cook 2015-01-04 21:50:36 UTC
(In reply to Chris Cormack from comment #13)
> Changed the bug report, this does no proxying at all. So the title was
> really confusing

I think that makes a lot of sense. On that note, it might be worthwhile changing "opac-proxypage.pl" to something more representative of the functionality as well, although I suppose this is already passed QA...
Comment 15 Tomás Cohen Arazi 2015-06-26 13:03:39 UTC
I agree that having the feature is good for academic libraries. Could you please address Chris' concern about it not proxying at all? Just work a bit on renaming the script and sysprefs and let me know so we have this pushed ASAP.
If you want to, we can discuss it on a dev meeting. just let me know, but lets have this feature pushed soon :-D
Comment 16 Maxime Beaulieu 2015-07-07 15:19:13 UTC Comment hidden (obsolete)
Comment 17 Maxime Beaulieu 2015-07-07 15:19:31 UTC Comment hidden (obsolete)
Comment 18 Maxime Beaulieu 2015-07-07 15:20:46 UTC Comment hidden (obsolete)
Comment 19 Jonathan Druart 2015-08-05 11:52:35 UTC
I think it would have been better to use network list (192.168.1.255) instead of the start of the ips to allow.

Note that superlibrarian can access to the page, even if the user is not connected from the ips allowed, is it expected?

I will submit a follow-up to access pref from the templates, squash the patches (not to add and remove files in the same patch set).
Comment 20 Jonathan Druart 2015-08-05 11:54:19 UTC
Created attachment 41377 [details] [review]
Bug 13485 - Add a proxy page

To test:

I) Apply the patch
II) Run updatedatabase.pl

scenario I)

1) Add some content in ProxyPageContent and ProxyPageTitle sysprefs.
2) Add your machine ip (ex. 127.0.0)
3) Validate cgi-bin/koha/opac-proxypage.pl shows a page with ProxyPageContent and ProxyPageTitle contents.

scenario II)

1) Logout opac page
2) Add some content in ProxyPageContent and ProxyPageTitle sysprefs.
3) Add other ip that your machine ip.
4) Validate: cgi-bin/koha/opac-proxypage.pl shows a login page.
5) Validate: cgi-bin/koha/opac-proxypage.pl shows a page with ProxyPageContent and ProxyPageTitle contents after login.

Followed both scenarios, works as expected.
Signed-off-by: Marc Veron <veron@veron.ch>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Bug 13485 [QA Followup]

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Bug 13485 - Atomic Update + Rename Proxy page to Restricted page

Test plan:

I) Apply the patch
II) Run updatedatabase.pl

scenario I)

1) Add some content in RestrictedPageContent and RestrictedPageTitle sysprefs.
2) Add your machine ip (ex. 127.0.0)
3) Validate cgi-bin/koha/opac-restrictedpage.pl shows a page with RestrictedPageContent and RestrictedPageTitle contents.

scenario II)

1) Logout opac page
2) Add some content in RestrictedPageContent and RestrictedPageTitle sysprefs.
3) Add a diffrent ip.
4) Validate: cgi-bin/koha/opac-restrictedpage.pl shows a login page.
5) Validate: cgi-bin/koha/opac-restrictedpage.pl shows a page with RestrictedPageContent and RestrictedPageTitle contents after login.

	new file:   installer/data/mysql/atomicupdate/Bug13485_RestrictedSitesPage.sql
	modified:   installer/data/mysql/sysprefs.sql
	modified:   koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref
	renamed:    koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-proxypage.tt -> koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-restrictedpage.tt
	renamed:    opac/opac-proxypage.pl -> opac/opac-restrictedpage.pl

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 21 Jonathan Druart 2015-08-05 11:54:26 UTC
Created attachment 41378 [details] [review]
Bug 13485: Use the Koha template plugin to access syspref values

And remove the useless use of the KohaDates plugin

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 22 Tomás Cohen Arazi 2015-08-11 18:18:12 UTC
Patches pushed to master.

Thanks Simith, and everyone involved!