Page 2 of 2

Re: Password reset by user itself

Posted: Sat Nov 09, 2019 8:28 am
by Janusz
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?

Re: Password reset by user itself

Posted: Sat Nov 09, 2019 8:45 am
by kev1n
I'm going to look into it a bit later.

Re: Password reset by user itself

Posted: Sat Nov 09, 2019 9:35 am
by kev1n
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

Re: Password reset by user itself

Posted: Sat Nov 09, 2019 10:12 am
by Janusz
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 :-)

Re: Password reset by user itself

Posted: Sat Nov 09, 2019 7:08 pm
by kev1n
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
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
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
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
5. Enter a new password.
(Enter the same password again in the field below to confirm.)

Click "Reset Password"
Screenshot_20191112-012313.png
6. Click the "Login" link to log in to nuBuilder with the new password.
s5.png

Re: Password reset by user itself

Posted: Wed Nov 13, 2019 7:25 am
by kev1n

Re: Password reset by user itself

Posted: Wed Nov 13, 2019 12:35 pm
by Janusz
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.

Re: Password reset by user itself

Posted: Wed Nov 13, 2019 4:21 pm
by kev1n
You're welcome Janusz!