Bugzilla – Attachment 85804 Details for
Bug 22370
OPAC users should not be allowed to view staff news items
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 22370: Prevent OPAC users from seeing staff news from URL
Bug-22370-Prevent-OPAC-users-from-seeing-staff-new.patch (text/plain), 1.34 KB, created by
Katrin Fischer
on 2019-02-28 06:42:00 UTC
(
hide
)
Description:
Bug 22370: Prevent OPAC users from seeing staff news from URL
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2019-02-28 06:42:00 UTC
Size:
1.34 KB
patch
obsolete
>From 75534be058b447fa3a2de2092a5f4f8b44f0dd69 Mon Sep 17 00:00:00 2001 >From: Aleisha Amohia <aleishaamohia@hotmail.com> >Date: Tue, 19 Feb 2019 21:00:31 +0000 >Subject: [PATCH] Bug 22370: Prevent OPAC users from seeing staff news from URL > >To test: >1) Have some OPAC and staff only news items >2) On the OPAC view a single news item >3) Change the ID in the URL to the ID of a staff news item >4) Notice you can view the news item without any problems >5) Apply the patch and refresh the page >6) An error should show that the news item doesn't exist >7) Confirm you can still view OPAC news items individually > >Sponsored-by: Catalyst IT > >Signed-off-by: Josef Moravec <josef.moravec@gmail.com> > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> >--- > opac/opac-main.pl | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >diff --git a/opac/opac-main.pl b/opac/opac-main.pl >index fbfd925d49..965618c5d3 100755 >--- a/opac/opac-main.pl >+++ b/opac/opac-main.pl >@@ -67,7 +67,7 @@ my $news_id = $input->param('news_id'); > my @all_koha_news; > > if (defined $news_id){ >- @all_koha_news = Koha::News->search({ idnew => $news_id }); >+ @all_koha_news = Koha::News->search({ idnew => $news_id, lang => { '!=', 'koha' } }); # get news that is not staff-only news > if (scalar @all_koha_news > 0){ > $template->param( news_item => @all_koha_news ); > } else { >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 22370
:
85314
|
85797
| 85804