Bugzilla – Attachment 72298 Details for
Bug 17218
New list add attempt while logged in as dbadmin on staff side should be prevented pre-emptively
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 17218: Stop DB user from clicking 'New list' button
Bug-17218-Stop-DB-user-from-clicking-New-list-butt.patch (text/plain), 3.45 KB, created by
Aleisha Amohia
on 2018-03-01 01:03:26 UTC
(
hide
)
Description:
Bug 17218: Stop DB user from clicking 'New list' button
Filename:
MIME Type:
Creator:
Aleisha Amohia
Created:
2018-03-01 01:03:26 UTC
Size:
3.45 KB
patch
obsolete
>From a0be72d674a9877aeec7d382dc32e4cd831fd22a Mon Sep 17 00:00:00 2001 >From: Aleisha Amohia <aleishaamohia@hotmail.com> >Date: Wed, 19 Apr 2017 02:33:02 +0000 >Subject: [PATCH] Bug 17218: Stop DB user from clicking 'New list' button > >To test: >1) Log in as DB user >2) Go to Lists -> New list >3) Attempt to create a new list >4) Notice that you are only stopped once you've submitted the form >5) Go back to lists, apply patch and refresh page >6) Notice the 'New list' button is now disabled >7) Click it and confirm alert shows up > >Sponsored-by: Catalyst IT > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> >--- > .../prog/en/includes/virtualshelves-toolbar.inc | 43 +++++++++++++++++++++- > virtualshelves/shelves.pl | 1 + > 2 files changed, 42 insertions(+), 2 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/virtualshelves-toolbar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/virtualshelves-toolbar.inc >index dacd451..e6b6952 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/virtualshelves-toolbar.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/virtualshelves-toolbar.inc >@@ -1,8 +1,47 @@ > [% INCLUDE 'blocking_errors.inc' %] >+<script type="text/javascript"> >+//<![CDATA[ > >-<div id="toolbar" class="btn-toolbar"> >- <div class="btn-group"><a id="newshelf" class="btn btn-default btn-sm" href="/cgi-bin/koha/virtualshelves/shelves.pl?op=add_form&referer=[% op %]"><i class="fa fa-plus"></i> New list</a></div> >+$(document).ready(function(){ >+ [% IF loggedinuser == 0 %] >+ $("#newshelf").click(function(e){ >+ e.preventDefault(); >+ alert(_("Lists cannot be created with the database administrator account.")); >+ }); >+ [% END %] >+}); >+ >+[% IF op == 'view' %] >+ function sendList(){ >+ open(CGIBIN+'virtualshelves/sendshelf.pl?shelfid=[% shelf.shelfnumber %]','win_form','scrollbars=no,resizable=no,height=300,width=450,top=50,left=100'); >+ } >+ >+ $(document).ready(function() { >+ $("#sendlist").click(function(){ >+ sendList(); >+ return false; >+ }); >+ $("#deleteshelf").click(function(e){ >+ if(confirm(_("Are you sure you want to delete this list?"))){ >+ return true; >+ } else { >+ e.preventDefault(); >+ } >+ }); >+ }); >+[% END %] > >+//]]> >+</script> >+ >+<div id="toolbar" class="btn-toolbar"> >+ <div class="btn-group"> >+ [% IF loggedinuser == 0 %] >+ <a id="newshelf" class="btn btn-default btn-sm" href="/cgi-bin/koha/virtualshelves/shelves.pl?op=add_form&referer=[% op %]" disabled="disabled"><i class="fa fa-plus"></i> New list</a> >+ [% ELSE %] >+ <a id="newshelf" class="btn btn-default btn-sm" href="/cgi-bin/koha/virtualshelves/shelves.pl?op=add_form&referer=[% op %]"><i class="fa fa-plus"></i> New list</a> >+ [% END %] >+ </div> > [% IF shelf AND op == 'view' %] > [% IF can_manage_shelf %] > <div class="btn-group"> >diff --git a/virtualshelves/shelves.pl b/virtualshelves/shelves.pl >index 192580f..d8eff3e 100755 >--- a/virtualshelves/shelves.pl >+++ b/virtualshelves/shelves.pl >@@ -351,6 +351,7 @@ $template->param( > category => $category, > print => scalar $query->param('print') || 0, > csv_profiles => [ Koha::CsvProfiles->search({ type => 'marc', used_for => 'export_records' }) ], >+ loggedinuser => $loggedinuser, > ); > > output_html_with_http_headers $query, $cookie, $template->output; >-- >2.1.4
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 17218
:
62348
|
66604
|
68155
|
68156
|
72298
|
72299
|
72495
|
72506
|
72507
|
72508