Bugzilla – Attachment 62348 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), 2.95 KB, created by
Aleisha Amohia
on 2017-04-19 02:35:12 UTC
(
hide
)
Description:
Bug 17218: Stop DB user from clicking 'New list' button
Filename:
MIME Type:
Creator:
Aleisha Amohia
Created:
2017-04-19 02:35:12 UTC
Size:
2.95 KB
patch
obsolete
>From 92e08965ae38c5476c1a0306b8c23253897b1578 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 >--- > .../prog/en/includes/virtualshelves-toolbar.inc | 20 ++++++++++++++++---- > virtualshelves/shelves.pl | 1 + > 2 files changed, 17 insertions(+), 4 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 0f034dc..a47e1db 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,16 @@ > <script type="text/javascript"> > //<![CDATA[ > >-[% IF op == 'view' %] >+$(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'); > } >@@ -20,15 +28,19 @@ > } > }); > }); >- > [% END %] > > //]]> > </script> > > <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> >- >+ <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 c328869..8e5d3a5 100755 >--- a/virtualshelves/shelves.pl >+++ b/virtualshelves/shelves.pl >@@ -324,6 +324,7 @@ $template->param( > messages => \@messages, > category => $category, > print => scalar $query->param('print') || 0, >+ loggedinuser => $loggedinuser, > csv_profiles => [ Koha::CsvProfiles->search({ type => 'marc' }) ], > ); > >-- >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