users changing their own passwords

users changing their own passwords

Postby mlawton » Tue Jul 05, 2016 9:43 am

I would like to enable my users to change their own passwords, rather than my having to change the passwords for them. I have created a form to update zzzsys_user and have restricted it to display only the record for the current logged in user (using #nu_user_id#). So far so good. But I need to know the encryption algorithm used by nubuilder in order to save the correctly encrypted password in zzzsys_user. I assumed it is MD5 but it appears it is not, as I have tried it and MD5 creates the same string length but a different value than what is stored by nubuilder when I change a password using the Users form logged in as globeadmin.

Alternatively, if someone has another approach that would achieve my goal, please let me know. Thanks.

Update: I solved this myself. Looking at the 'use' form in the zzzsys_form table, I can see the code used to generate the password (md5, but with a concatenated text value). However, I also realized there is a much simpler way to achieve my goal. I created a button that calls the 'use' form, passing the #nu_user_id# as the record id. I also updated the zzzsys_object table and added a select statement in the sob_all_display_condition column to hide the user group field on that form for regular users.
mlawton
 
Posts: 16
Joined: Tue May 10, 2016 1:46 am

Re: users changing their own passwords

Postby admin » Wed Jul 06, 2016 12:34 pm

Good thinking.
admin
Site Admin
 
Posts: 3132
Joined: Mon Jun 15, 2009 9:53 am

Re: users changing their own passwords

Postby SteveHolland » Sat Jan 28, 2017 10:00 pm

Very useful post. In my car-reconditioning database the qualified users now have a button to change the password for the showroom visitor login. For this I entered the record id of the visitors' login name instead of #zzzsys_user_id#. The button now leads directly to the visitors' login details. I hesitate on removing the user group details as I'm not sure of the right procedure to do that part of the posted tip...
SteveHolland
 
Posts: 8
Joined: Tue Jun 28, 2016 7:39 pm
Location: Rotterdam, The Netherlands

Re: users changing their own passwords

Postby admin » Mon Jan 30, 2017 6:15 am

SteveHolland,

Just leave the user group details there, why delete them?

Steven
admin
Site Admin
 
Posts: 3132
Joined: Mon Jun 15, 2009 9:53 am


Return to Custom Code