Welcome to the nuBuilder Forums!

Register and log in to access exclusive forums and content available only to registered users.

Change password not working!

Questions related to using nuBuilder Forte.
Post Reply
marc
Posts: 92
Joined: Mon May 14, 2018 3:26 pm

Change password not working!

Unread post by marc »

Hi,

As a user, I cannot change my password in the "Change Login" menu. I enter my old PW, then the new one twice. "Password changed" (or similar) appears. When I log in, only the old password works. The new password will not be accepted.

Does this work for you :?:
Janusz
nuBuilder Team
Posts: 506
Joined: Fri Dec 28, 2018 1:41 pm
Location: Krakow, Poland
Has thanked: 8 times
Been thanked: 18 times

Re: Change password not working!

Unread post by Janusz »

Hi,
In my case the standard solution for password change is not working for users. The window is not appearing - but in your case I understand it does. So maybe not exactly the same case. But anyway here is the solution I did and works perfectly.
https://forums.nubuilder.cloud/viewtopic.php?f=19&t=9841

I prepared additional simple form with code taken from globeadmin User form and it works without any problem from users login.

Properies/Browse/SQL

Code: Select all

SELECT * 
FROM zzzzsys_user 
LEFT JOIN zzzzsys_access ON zzzzsys_access_id = sus_zzzzsys_access_id
ORDER BY sus_name
PHP before save

Code: Select all

if('#check_password#' != ''){
    
    if('#new_password#' != '#check_password#'){
        nuDisplayError('<b>Enter New Password</b> and <b>Reenter New Password</b> must match');
    }
    
}

PHP after save

Code: Select all

if('#check_password#' != ''){

	$pw	= md5('#check_password#');
	nuRunQuery("UPDATE zzzzsys_user SET sus_login_password = '$pw' WHERE zzzzsys_user_id = '#RECORD_ID#'");

}
If you like nuBuilder, please leave a review on SourceForge
kev1n
nuBuilder Team
Posts: 4307
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 448 times
Contact:

Re: Change password not working!

Unread post by kev1n »

@Marc. I confirm, the "change login" functionality appears to be broken in the current version. (just tested with a fresh standalone installation)

@Janusz: Is there a form_id 'nupassword' in your table zzzzsys_form?

SELECT * FROM `zzzzsys_form` WHERE `zzzzsys_form_id` = 'nupassword'
Janusz
nuBuilder Team
Posts: 506
Joined: Fri Dec 28, 2018 1:41 pm
Location: Krakow, Poland
Has thanked: 8 times
Been thanked: 18 times

Re: Change password not working!

Unread post by Janusz »

Yes it is - and looks like following:

https://drive.google.com/open?id=12FzKT ... e-MPetY5Og
If you like nuBuilder, please leave a review on SourceForge
admin
Site Admin
Posts: 2815
Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 25 times

Re: Change password not working!

Unread post by admin »

marc,

It seems to work for me BUT you'll need to add the Password Form to the User's Access Level.
pw.JPG

Steven
You do not have the required permissions to view the files attached to this post.
johan
Posts: 399
Joined: Sun Feb 27, 2011 11:16 am
Location: Belgium
Been thanked: 3 times

Re: Change password not working!

Unread post by johan »

Hi
I'm having the same problem.
I've enabled nupassword and user can see the form to change his password.
When I fill in the fields (current - new - repeat) and save the form, user still can login with old password.

I've just updated nuBuilder to the current version.
kev1n
nuBuilder Team
Posts: 4307
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 448 times
Contact:

Re: Change password not working!

Unread post by kev1n »

Same here. A user cannot change the password himself. After pressing "Save", the new password is not saved in the database.
change_pw.png
You do not have the required permissions to view the files attached to this post.
kev1n
nuBuilder Team
Posts: 4307
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 448 times
Contact:

Re: Change password not working!

Unread post by kev1n »

Ok - here comes a fix:

Open the nuPassword form via the Developer Console (F12).

Paste this code and hit the return key:

Code: Select all

nuForm('nuPassword','-1','', '')
Modify this part of the code in BS PHP event:

Code: Select all

$p	= nuProcedure('nuCheckPasswordPolicy');

if($_POST['nuProcedureEval'] != 'Procedure <b></b> - run inside '){

	eval($p);
	
	if($check == false){
		return;
	}

}

Save the changes and enjoy a working save password dialog!

Info for the developer: This fix wouldn't be necessary if nuProcedure() returned an empty string in case the passed function does not exist.
Post Reply