Bug 37919 - Unable to report on patrons with borrowers.auth_method password
Summary: Unable to report on patrons with borrowers.auth_method password
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: Reports (show other bugs)
Version: Main
Hardware: All All
: P5 - low major
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on: 37508
Blocks:
  Show dependency treegraph
 
Reported: 2024-09-13 14:28 UTC by David Roberts
Modified: 2024-10-03 19:07 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Roberts 2024-09-13 14:28:42 UTC
As a result of Bug 37508, it isn't possible to use the reports module to identify which users are MFA enabled using e.g. the following SQL which used to work:

SELECT 
  p.borrowernumber, 
  p.firstname, 
  p.surname, 
  p.cardnumber, 
  p.branchcode, 
  IF(
    power(2, 2) & flags, 
    'yes', 
    'no'
  ) as Staff, 
  IF(
    power(2, 0) & flags, 
    'yes', 
    'no'
  ) as Superlibrarian 
FROM 
  borrowers p 
WHERE 
  p.flags > 0 
  AND p.auth_method = 'password' 
  AND p.dateexpiry > CURDATE() 
HAVING 
  Staff = 'yes' 
  OR Superlibrarian = 'yes' 
ORDER BY 
  p.branchcode
Comment 1 Brendan Lawlor 2024-10-03 19:07:02 UTC
A workaround for this is to change = to LIKE

Change this line:
AND p.auth_method = 'password'

to:
AND p.auth_method LIKE 'passwor'