Welcome to the nuBuilder Forums!
Join our community by registering and logging in.
As a member, you'll get access to exclusive forums, resources, and content available only to registered users.
Join our community by registering and logging in.
As a member, you'll get access to exclusive forums, resources, and content available only to registered users.
How does user change their own password?
-
- Posts: 15
- Joined: Fri Nov 23, 2012 11:31 pm
How does user change their own password?
How does a non-globeadmin user change their own password?
I am using nubuilder-v2.7.4.11-12.10.24-Build529 on Ubuntu 12.10 browsing with Chromium 22.0.1229.94.
What is the standard way to enable a user to change their own password? Do I have to setup all the bits to enable them access to the Users form, but only for the current user? Is there a recipe for this? Or am I missing something?
I am using nubuilder-v2.7.4.11-12.10.24-Build529 on Ubuntu 12.10 browsing with Chromium 22.0.1229.94.
What is the standard way to enable a user to change their own password? Do I have to setup all the bits to enable them access to the Users form, but only for the current user? Is there a recipe for this? Or am I missing something?
Re: How does user change their own password?
tschutter,
There is no facility at this point, you could create your own or make it the admin's job.
http://forums.nubuilder.cloud/viewtopic.p ... 061#p11061
Steven
There is no facility at this point, you could create your own or make it the admin's job.
http://forums.nubuilder.cloud/viewtopic.p ... 061#p11061
Steven
Re: How does user change their own password?
tschutter,
You could create a new form with sql
Add In the custom code of the form:
Set 2 textfields on that form sus_name(read only) and sus_login_password
Now the user can update his own password.
Johan
You could create a new form with sql
Code: Select all
SELECT * FROM `zzsys_user` WHERE zzsys_user_id = '#zzsys_user_id#'
Code: Select all
if('#sus_login_password_was#' != '#sus_login_password#'){
$s = "update zzsys_user set sus_login_password = md5(CONCAT('nu',sus_login_password)) ";
$s .= "WHERE zzsys_user_id = '#newID#'";
nuRunQuery($s);
}
Now the user can update his own password.
Johan
-
- Posts: 23
- Joined: Tue May 08, 2012 8:24 pm
Re: How does user change their own password?
Johan-
I'm trying to implement this.
Which sub-tab of Custom Code would this go in?

"After Save"?
Has anyone else successfully done this?
Many thanks!
I'm trying to implement this.
Which sub-tab of Custom Code would this go in?

"After Save"?
Has anyone else successfully done this?
Many thanks!
-
- Posts: 84
- Joined: Mon Jul 04, 2011 12:52 am
Re: How does user change their own password?
mlgeek,
One option would be to make a form (example for zzsys_variable- It does not matter)
make one text field ..name it password_holder
add After Save:
Make a button and on the Button properties set 'Form To Launch via Browse' the form u made, and set 'Record ID' -1 (impotant).
Give the user access to the button.
Now a user can change his password.
This is a general idea ..u should play around with md5 like johan mentioned, and maybe add a second field just to check that the user are entering the same value twice
zazzium
One option would be to make a form (example for zzsys_variable- It does not matter)
make one text field ..name it password_holder
add After Save:
Code: Select all
$pass = $_POST['password_holder'];
$user = '#zzsys_user_id#';
$sql = "UPDATE zzsys_user SET sus_login_password = '$pass'";
$sql .= " WHERE zzsys_user_id = '$user'";
nuRunQuery($sql);
Give the user access to the button.
Now a user can change his password.
This is a general idea ..u should play around with md5 like johan mentioned, and maybe add a second field just to check that the user are entering the same value twice
zazzium
-
- Posts: 23
- Joined: Tue May 08, 2012 8:24 pm
-
- Posts: 23
- Joined: Tue May 08, 2012 8:24 pm
Re: How does user change their own password?
Solved, I think.
I ended up doing what johan had suggested. It is worth noting, though, that what he suggested was essentially making a copy of the existing USERS form (a set-up form that is not, by default, available to edit in-browser.
In hopes that this is useful to someone else:
I had hoped that the user would be able to skip the Browse/Search screen and go straight to the record edit screen if I specified the Record ID for the button as #zzsys_user_id#, but that doesn't seem to work- it results in an edit screen that shows all fields as blank. I suspect I'm doing something very stupid here, though, and that I'll kick myself when I figure it out.
I ended up doing what johan had suggested. It is worth noting, though, that what he suggested was essentially making a copy of the existing USERS form (a set-up form that is not, by default, available to edit in-browser.
In hopes that this is useful to someone else:
- Created new Form, change_password
Code: Select all
SELECT * FROM zzsys_user WHERE zzsys_user_id='#zzsys_user_id#'
- Created needed fields:
- Set sus_login_password_was to never display:
- Set sus_name and sus_login_name to read-only on the Text tab for each field.
- In the form's Custom Code tab, used johan's template in After Save
Code: Select all
if('#sus_login_password_was#' != '#sus_login_password#'){ $s = "update zzsys_user set sus_login_password = md5(CONCAT('nu',sus_login_password)) "; $s .= "WHERE zzsys_user_id = '#newID#'"; nuRunQuery($s); }
- Created index button for "Change Your Password" that launches this new form.
I had hoped that the user would be able to skip the Browse/Search screen and go straight to the record edit screen if I specified the Record ID for the button as #zzsys_user_id#, but that doesn't seem to work- it results in an edit screen that shows all fields as blank. I suspect I'm doing something very stupid here, though, and that I'll kick myself when I figure it out.
-
- Posts: 84
- Joined: Mon Jul 04, 2011 12:52 am
Re: How does user change their own password?
My suggestion is doing exactly thatI had hoped that the user would be able to skip the Browse/Search screen and go straight to the record edit screen
-
- Posts: 10
- Joined: Thu Jan 03, 2013 10:21 am
Re: How does user change their own password?
Thanks Zazzium, that trick of yours is gonna come in really handy!