Bugzilla – Attachment 62567 Details for
Bug 18442
Permission error when logging into staff interface as db user
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18442 - Implemented assignment of the $userid variable before the haspermission call so that a defined $userid with a value is being passed to the haspermission() method.
Bug-18442---Implemented-assignment-of-the-userid-v.patch (text/plain), 2.55 KB, created by
Alex Buckley
on 2017-04-22 11:00:39 UTC
(
hide
)
Description:
Bug 18442 - Implemented assignment of the $userid variable before the haspermission call so that a defined $userid with a value is being passed to the haspermission() method.
Filename:
MIME Type:
Creator:
Alex Buckley
Created:
2017-04-22 11:00:39 UTC
Size:
2.55 KB
patch
obsolete
>From fd5c977597e91720235625f12f995e1776a3f64a Mon Sep 17 00:00:00 2001 >From: Alex Buckley <alexbuckley@catalyst.net.nz> >Date: Thu, 20 Apr 2017 11:29:28 +1200 >Subject: [PATCH] Bug 18442 - Implemented assignment of the $userid variable > before the haspermission call so that a defined $userid with a value is being > passed to the haspermission() method. >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >Previously the $userid variable was undefined when it was handed to the >haspermission() method and this was causing 'Error: You do not have >permission to access this page' errors when logging into the staff >interface as database user. However if you viewed the url in a new tab >you could view the staff interface. > >Test plan: >1. Drop and recreate your db > >2. Clear memcached > >3. Go through the installer (to speed up this test plan install all >sample data so you dont have to create libraries, patron categories etc. later) > >4. On the installer page login as the database user and notice that it >does not work on the first attempt ( you get 'Error: You do not have >permission to access this page') > >5. Try logging in as database user for a second time and notice you are >logged in successfully this time > >4. In staff interface create a patron account with superlibrarian permissions > >5. Logout of the staff interface > >6. Login as database user > >7. Notice you cant log in. You get the 'Error:: You do not have permission to access this >page' error > >8. Try a second attempt and notice you get the same error > >9. Open the URL in a new tab and notice the staff interface appears >showing that you are logged in > >10. log out and log back in as the superlibrarian user you created and >notice it works on first login attempt > >11. Apply patch > >12. Log out and try logging back in as database user and notice that you >can login successfully on first attempt > >13. Repeat steps 1,2,3 and login as database user and notice the login >works on first attempt > >Followed test plan, works as expected. >Signed-off-by: Marc Véron <veron@veron.ch> >--- > C4/Auth.pm | 1 + > 1 file changed, 1 insertion(+) > >diff --git a/C4/Auth.pm b/C4/Auth.pm >index 40b273a..d8fe030 100644 >--- a/C4/Auth.pm >+++ b/C4/Auth.pm >@@ -1020,6 +1020,7 @@ sub checkauth { > > # $return: 1 = valid user, 2 = superlibrarian > if ($return) { >+ $userid ||= $q_userid; > > #_session_log(sprintf "%20s from %16s logged in at %30s.\n", $userid,$ENV{'REMOTE_ADDR'},(strftime '%c', localtime)); > if ( $flags = haspermission( $userid, $flagsrequired ) ) { >-- >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 18442
:
62423
|
62448
|
62567
|
62710
|
62738
|
62739
|
62826
|
62827
|
62828