Page 1 of 1

Setting passwords and login data

Posted: Sun Apr 03, 2022 5:51 pm
by sputs
Hi,

I have a couple of questions regarding user management.

In a subform (like below), an entity (hospital or other) can add/change nubuilder users accounts. Questions:

1) How would I encrypt the password on change/submit?
2) Can I based on the parent form (there are two different parent forms) set the access-level upon creating a new user?
3) How do I copy the email address into sus_code and sus_login_name?
Screenshot from 2022-04-03 17-44-44.png
Thank you!

Re: Setting passwords and login data

Posted: Sun Apr 03, 2022 6:54 pm
by kev1n
Hi,

1. Look at the After Save event of the user form to see how it's done.
(Direct access to the code is e.g. http://localhost/nubuilder4/index.php?f ... =nuuser_AS )

2 + 3: Also use the After Save event to run an update query.

Let me know if you need further information.

Re: Setting passwords and login data

Posted: Sun Apr 03, 2022 7:16 pm
by sputs
Thank you!

Re: Setting passwords and login data

Posted: Sun Apr 03, 2022 7:26 pm
by sputs
Regarding 2. How do I tell the user admin subform to set a specific access level based on the parent form?
I have two different parent forms, each requiring a different type of access level.

One sus_zzzzsys_access_id= 001
the other sus_zzzzsys_access_id= 002

Re: Setting passwords and login data

Posted: Sun Apr 03, 2022 7:35 pm
by kev1n
The PHP code will be run for the parent form only. So you know which access level to set.

Re: Setting passwords and login data

Posted: Sun Apr 03, 2022 7:47 pm
by sputs
Ok, yes. The code is not executed. So that doesn't work. Found a rather complicated workaround.