Bugzilla – Attachment 151634 Details for
Bug 33815
Crash when librarian changes their own username in the staff interface
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 33815: Do not explode if logged in user modify their own userid
Bug-33815-Do-not-explode-if-logged-in-user-modify-.patch (text/plain), 1.42 KB, created by
Tomás Cohen Arazi (tcohen)
on 2023-05-24 14:55:38 UTC
(
hide
)
Description:
Bug 33815: Do not explode if logged in user modify their own userid
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2023-05-24 14:55:38 UTC
Size:
1.42 KB
patch
obsolete
>From 111f993d97b3a74d749078d020b8e8703d611b62 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 24 May 2023 09:29:30 +0200 >Subject: [PATCH] Bug 33815: Do not explode if logged in user modify their own > userid > >If the logged in librarian modifies their own userid they will get the >following error when submitting the form: >Can't call method "password_expired" on an undefined value at /kohadevbox/koha/C4/Auth.pm line 1780 > >We could handle this situation and flag the session as expired. Better >would be to deal with this specific user case and update the cookie (?) >--- > C4/Auth.pm | 9 +++++++++ > 1 file changed, 9 insertions(+) > >diff --git a/C4/Auth.pm b/C4/Auth.pm >index 8399bcdcc84..07afd24018a 100644 >--- a/C4/Auth.pm >+++ b/C4/Auth.pm >@@ -1774,6 +1774,15 @@ sub check_cookie_auth { > } elsif ( $userid ) { > $session->param( 'lasttime', time() ); > my $patron = Koha::Patrons->find({ userid => $userid }); >+ >+ # If the user modify their own userid >+ # Better than 500 but we could do better >+ unless ( $patron ) { >+ $session->delete(); >+ $session->flush; >+ return ("expired", undef); >+ } >+ > $patron = Koha::Patrons->find({ cardnumber => $userid }) > unless $patron; > return ("password_expired", undef ) if $patron->password_expired; >-- >2.34.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 33815
:
151609
|
151610
|
151633
|
151634
|
151635
|
151642
|
151643
|
151715
|
151716