Hi Stephen, you can use Koha::AuthUtils::hash_password to encode password and then Koha::Patron->update_password($userid, $newPassword) you can see it in members/member-password.pl script on lines 73 and 76 in 16.11 code Hope that helps Josef po 26. 3. 2018 v 17:09 odesílatel Graham, Stephen <s.graham4@herts.ac.uk> napsal:
Hi All – if I wanted to programmatically change a user’s password what would the best way of doing this? I’ve just been looking at the various Perl modules for our version of Koha (16.11). modules such as C4:Members, C4:Member:Attributes etc, but cannot see any methods that can reset the password. Looking at the opac-passwd.pl CGI script which is called when changing a user password, I see that it uses a SQL update to change the password. Is this the best route to go if I wanted to change a password?
Cheers, Stephen
--------------------------------------
Stephen Graham
Library Technology Consultant
Content and Collections Team
Library and Computing Services
University of Hertfordshire
Tel: 01707 286111
Ext: 77751
Email: s.graham4@herts.ac.uk
_______________________________________________ Koha-devel mailing list Koha-devel@lists.koha-community.org http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/