Password reset by user itself

Questions related to using nuBuilder Forte.

Re: Password reset by user itself

Postby Janusz » Sat Nov 09, 2019 4:58 pm

Hi Kev1n,
The first part works already perfectly :-) - thank you very much.
And just wanted to make similar approach for password entry in the reset.php part so I did following:
Code: Select all
//Show a html form with a password field and a submit button
if (!isset($_POST['password'])) {
    echo '
      <div class="container">
      <link rel="stylesheet" href="style.css" >
      <form method="post" action="reset.php">
        Enter New Password:
        <input type="password" name="password" size="35" />
        <div class="send-button">
          <input type="submit" value="Reset My Password" />
        </div>
      </form>
      </div>
      ';
    exit();
}

include("../resetpw/nuconfig.php");
$password = isset($_POST['password']) ? trim($_POST['password']) : '';
echo $password;

//Connect to MySQL database using PDO.
$pdo = new PDO("mysql:host=$nuConfigDBHost;dbname=$nuConfigDBName", $nuConfigDBUser, $nuConfigDBPassword);
//The user's id, which should be present in the GET variable "uid"
$userId = isset($_GET['uid']) ? trim($_GET['uid']) : '';
......

The password from the from is OK but it looks that the data from the html link is not processed so I have probably some collision between $_POST and $_GET :-(
Do you have some suggestions what should I do here?
Janusz
 
Posts: 253
Joined: Fri Dec 28, 2018 10:11 pm
Location: Krakow, Poland

Re: Password reset by user itself

Postby kev1n » Sat Nov 09, 2019 5:15 pm

I'm going to look into it a bit later.
kev1n
 
Posts: 353
Joined: Mon Oct 15, 2018 2:13 am

Re: Password reset by user itself

Postby kev1n » Sat Nov 09, 2019 6:05 pm

BTW, I'm adapting another "reset password"-script to make it work with nuBuilder. It's responsive and the GUI looks modern. I'm going to publish it when I'm done (hopefully today)

Here's already a preview:

preview.png
preview.png (17.3 KiB) Viewed 93 times
kev1n
 
Posts: 353
Joined: Mon Oct 15, 2018 2:13 am

Re: Password reset by user itself

Postby Janusz » Sat Nov 09, 2019 6:42 pm

Hi Kev1n,
It would be great - Your support on this forum is really exceptional - thank You very much.

Regarding the above code and the issue with new password entry in reset.php - so now I use random password generator:
Code: Select all
$password = bin2hex(openssl_random_pseudo_bytes(5));

and afterwards password is sent by e-mail to the user.
With that everything works perfectly.

THANK YOU VERY MUCH AGAIN FOR YOUR TIME AND SUPPORT :-)
Janusz
 
Posts: 253
Joined: Fri Dec 28, 2018 10:11 pm
Location: Krakow, Poland

Re: Password reset by user itself

Postby kev1n » Sun Nov 10, 2019 3:38 am

I'm almost done with the script, I just have to fine-tune it a little. The password process is going to look like this:

Reset Your Forgotten Password


If you forgot your nuBuilder password, you can easily reset it using the "Forgot Password?" link on the login page by doing the following steps. All you need is your email address.

1. Visit your nuBuilder website at the following address: https://your_nubuilder_url.com

s0.PNG
s0.PNG (8.44 KiB) Viewed 82 times


2. On the login page, click the “Forgot password?” link.

3. Enter the email address that is associated with your nuBuilder account and click “Send Reset Link".

s1.png
s1.png (19.4 KiB) Viewed 85 times


If the email address is found in the nuBuilder database, an email with a link to reset your password will be sent to this address.
If you do not receive an email please check your spam folder.

Screenshot_20191112-011858.png
Screenshot_20191112-011858.png (76.21 KiB) Viewed 71 times


4. Go to your email inbox and open the email with subject "Rest password". In order to obtain a new password, follow the link in the email.

The link will direct you to a reset password page.'

s3.png
s3.png (25.41 KiB) Viewed 85 times


5. Enter a new password.
(Enter the same password again in the field below to confirm.)

Click "Reset Password"

Screenshot_20191112-012313.png
Screenshot_20191112-012313.png (59.16 KiB) Viewed 71 times


6. Click the "Login" link to log in to nuBuilder with the new password.

s5.png
s5.png (20.76 KiB) Viewed 85 times
kev1n
 
Posts: 353
Joined: Mon Oct 15, 2018 2:13 am

Re: Password reset by user itself

Postby kev1n » Wed Nov 13, 2019 3:55 pm

kev1n
 
Posts: 353
Joined: Mon Oct 15, 2018 2:13 am

Re: Password reset by user itself

Postby Janusz » Wed Nov 13, 2019 9:05 pm

Kevin,
It works perfectly :-)
You really did huge work to prepare all these scripts with windows for user interface and to share ready to use module.

Thank You very much for Your exceptional support.
Janusz
 
Posts: 253
Joined: Fri Dec 28, 2018 10:11 pm
Location: Krakow, Poland

Re: Password reset by user itself

Postby kev1n » Thu Nov 14, 2019 12:51 am

You're welcome Janusz!
kev1n
 
Posts: 353
Joined: Mon Oct 15, 2018 2:13 am

Previous

Return to General