<div dir="ltr">Hi Stephen, you can use<div><br></div><div>Koha::AuthUtils::hash_password to encode password and then Koha::Patron->update_password($userid, $newPassword)</div><div><br></div><div>you can see it in members/<a href="http://member-password.pl">member-password.pl</a> script on lines 73 and 76 in 16.11 code</div><div>Hope that helps</div><div><br></div><div>Josef</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr">po 26. 3. 2018 v 17:09 odesílatel Graham, Stephen <<a href="mailto:s.graham4@herts.ac.uk">s.graham4@herts.ac.uk</a>> napsal:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">





<div lang="EN-GB" link="#0563C1" vlink="#954F72">
<div class="m_-7019448756764211630WordSection1">
<p class="MsoNormal">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 <a href="http://opac-passwd.pl" target="_blank">opac-passwd.pl</a> 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?<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Cheers, Stephen<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><span>--------------------------------------<u></u><u></u></span></p>
<p class="MsoNormal"><span>Stephen Graham<u></u><u></u></span></p>
<p class="MsoNormal"><span>Library Technology Consultant<u></u><u></u></span></p>
<p class="MsoNormal"><span>Content and Collections Team<u></u><u></u></span></p>
<p class="MsoNormal"><span>Library and Computing Services<u></u><u></u></span></p>
<p class="MsoNormal"><span>University of Hertfordshire<u></u><u></u></span></p>
<p class="MsoNormal"><span>Tel: 01707 286111<u></u><u></u></span></p>
<p class="MsoNormal"><span>Ext: 77751<u></u><u></u></span></p>
<p class="MsoNormal"><span>Email: <a href="mailto:s.graham4@herts.ac.uk" target="_blank">s.graham4@herts.ac.uk</a><u></u><u></u></span></p>
<p class="MsoNormal"><span><u></u> <u></u></span></p>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div>

_______________________________________________<br>
Koha-devel mailing list<br>
<a href="mailto:Koha-devel@lists.koha-community.org" target="_blank">Koha-devel@lists.koha-community.org</a><br>
<a href="http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel" rel="noreferrer" target="_blank">http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel</a><br>
website : <a href="http://www.koha-community.org/" rel="noreferrer" target="_blank">http://www.koha-community.org/</a><br>
git : <a href="http://git.koha-community.org/" rel="noreferrer" target="_blank">http://git.koha-community.org/</a><br>
bugs : <a href="http://bugs.koha-community.org/" rel="noreferrer" target="_blank">http://bugs.koha-community.org/</a></blockquote></div>