[Bug 27311] New: Don't pass borrowernumber to check_password plugin hook
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27311 Bug ID: 27311 Summary: Don't pass borrowernumber to check_password plugin hook Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Plugin architecture Assignee: koha-bugs@lists.koha-community.org Reporter: magnus@libriotech.no QA Contact: testopia@bugs.koha-community.org check_password is implemented in two places: 1. In Koha::Patron::set_password https://git.koha-community.org/Koha-community/Koha/src/branch/master/Koha/Pa... 2. In Koha::Patron::store https://git.koha-community.org/Koha-community/Koha/src/branch/master/Koha/Pa... The call to the plugin inside Koha::Patron::store comes before this line: $self = $self->SUPER::store; which means there is not yet a borrowernumber to pass to the plugin, and this never worked. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27311 Magnus Enger <magnus@libriotech.no> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=27309 -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27311 Magnus Enger <magnus@libriotech.no> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |22706 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22706 [Bug 22706] Add plugin hooks to allow custom password strength checking modules -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27311 Magnus Enger <magnus@libriotech.no> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff Patch complexity|--- |Small patch -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27311 --- Comment #1 from Magnus Enger <magnus@libriotech.no> --- Created attachment 114721 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=114721&action=edit Bug 27311 - Don't pass borrowernumber to check_password Bug 22706 added the check_password plugin hook, taking both a borrowernumber and the raw password as arguments. The hook is called in two places in Koha::Patron, but because of how the code that calls the hook is placed, passing borrowernumber to the plugin inside "sub store" never worked. This patch removes the passing of the borrowernumber from both calls. A tiny plugin that uses the check_password hooks can ve found here: https://github.com/Libriotech/koha-plugin-pin To test: - Enable plugins - Optionally install the PIN plugin - Add and edit users in all possible ways, including -- Setting a password for a new user -- Changing a password in the staff client -- Changing a password in the OPAC -- Creating a disabled user account Sign off, if all this works as expected. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27311 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@bugs.koha-c | |ommunity.org --- Comment #2 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- I understand why you remove it from ->store (because in the creation block), but why from set_password? -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27311 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |magnus@libriotech.no |ity.org | -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27311 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dcook@prosentient.com.au --- Comment #3 from David Cook <dcook@prosentient.com.au> --- (In reply to Magnus Enger from comment #0)
which means there is not yet a borrowernumber to pass to the plugin, and this never worked.
I was just about to say this when I noticed the bug reference... -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27311 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lucas@bywatersolutions.com Status|Needs Signoff |Failed QA --- Comment #4 from Lucas Gass <lucas@bywatersolutions.com> --- 1. Shouldn't this have a test to account for the change? 2. Processing additional checks * Commit title does not start with 'Bug XXXXX: ' - 68f151152e1 -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org