https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40286
--- Comment #2 from David Cook <[email protected]> --- I'm not sure I understand the issue but sounds good to me? Alternatively, we could use this as an opportunity to do some refactoring. -- checkpw_internal() looks like it's used one place in C4::Auth::checkpw() and one place in C4::Auth_with_ldap::_do_changepassword(). And checkpw_internal() looks like it could be decomposed. At the moment, we're doing 3 things inside it. 1. Find patron (but Koha::Patrons->find_by_identifier() can already do this outside this function) 2. Check the password (via checkpw_hash()) 3. Set the userenv unless $no_set_userenv If we created a new function "C4::Auth::set_userenv({ patron => $patron })" or "C4::Context->set_userenv_from_patron" or something like that, then we don't really need checkpw_internal(). -- In the case of C4::Auth_with_ldap, we actually already have a borrowernumber and patron object before we even call checkpw_internal() anyway. We just need checkpw_hash() and maybe the userenv setting. The code in C4::Auth_wiith_ldap could use some TLC... -- You are receiving this mail because: You are watching all bug changes. _______________________________________________ Koha-bugs mailing list [email protected] https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
