Bugzilla – Attachment 52762 Details for
Bug 16805
Log in with database admin user breaks OPAC
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 16805: Log in with database admin user breaks OPAC
Bug-16805-Log-in-with-database-admin-user-breaks-O.patch (text/plain), 3.36 KB, created by
Mark Tompsett
on 2016-06-23 19:01:23 UTC
(
hide
)
Description:
Bug 16805: Log in with database admin user breaks OPAC
Filename:
MIME Type:
Creator:
Mark Tompsett
Created:
2016-06-23 19:01:23 UTC
Size:
3.36 KB
patch
obsolete
>From e6281f089565180c6239b72e4767929f98a406b0 Mon Sep 17 00:00:00 2001 >From: Mark Tompsett <mtompset@hotmail.com> >Date: Thu, 23 Jun 2016 14:51:26 -0400 >Subject: [PATCH] Bug 16805: Log in with database admin user breaks OPAC > >TEST PLAN >--------- >1) Log into OPAC with database admin user. > -- see error given in comment #0 >2) Apply patch >3) Log into OPAC with database admin user. > -- logs in, but gives warning with a nice logout button. >4) run koha qa test tools. >--- > C4/Letters.pm | 9 ++++----- > koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt | 12 ++++++++++++ > opac/opac-user.pl | 4 ++++ > 3 files changed, 20 insertions(+), 5 deletions(-) > >diff --git a/C4/Letters.pm b/C4/Letters.pm >index 1d0c3c0..b328ed2 100644 >--- a/C4/Letters.pm >+++ b/C4/Letters.pm >@@ -312,21 +312,20 @@ sub delalert { > sub getalert { > my ( $borrowernumber, $type, $externalid ) = @_; > my $dbh = C4::Context->dbh; >- my $query = "SELECT a.*, b.branchcode FROM alert a JOIN borrowers b USING(borrowernumber) WHERE"; >+ my $query = "SELECT a.*, b.branchcode FROM alert a JOIN borrowers b USING(borrowernumber) WHERE 1"; > my @bind; > if ($borrowernumber and $borrowernumber =~ /^\d+$/) { >- $query .= " borrowernumber=? AND "; >+ $query .= " AND borrowernumber=?"; > push @bind, $borrowernumber; > } > if ($type) { >- $query .= " type=? AND "; >+ $query .= " AND type=?"; > push @bind, $type; > } > if ($externalid) { >- $query .= " externalid=? AND "; >+ $query .= " AND externalid=?"; > push @bind, $externalid; > } >- $query =~ s/ AND $//; > my $sth = $dbh->prepare($query); > $sth->execute(@bind); > return $sth->fetchall_arrayref({}); >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt >index f31f47e..0ce42fd 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt >@@ -27,6 +27,18 @@ > </div> > <div class="span10"> > <div id="userdetails" class="maincontent"> >+ >+ [% IF adminWarning %] >+ <div id="adminwarning" class="dialog alert"> >+ <p> >+<strong><i class="fa fa-exclamation-triangle"> </i> Warning:</strong> >+You are logged in as the database administrative user. This is not recommended because some parts of Koha will not function as expected when using this account. Please log in instead with a regular account. >+<a class="btn btn-small" href="/cgi-bin/koha/opac-main.pl?logout.x=1"> >+<i class="fa fa-sign-out"> </i> Log out</a> >+ </p> >+ </div> >+ [% END %] >+ > [% IF ( bor_messages ) %] > <div class="alert alert-info"> > <h3>Messages for you</h3> >diff --git a/opac/opac-user.pl b/opac/opac-user.pl >index 413c26d..a23a032 100755 >--- a/opac/opac-user.pl >+++ b/opac/opac-user.pl >@@ -80,6 +80,10 @@ my $canrenew = 1; > > $template->param( shibbolethAuthentication => C4::Context->config('useshibboleth') ); > >+if (!$borrowernumber) { >+ $template->param( adminWarning => 1 ); >+} >+ > # get borrower information .... > my ( $borr ) = GetMemberDetails( $borrowernumber ); > >-- >1.9.1
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 16805
:
52762
|
52764
|
52827
|
52845
|
52846
|
52847
|
52877
|
52878
|
52879
|
52880
|
52881
|
52882