Welcome to the nuBuilder Forums!

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

Password reset by user itself

Questions related to using nuBuilder Forte.
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: Password reset by user itself

Unread post 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?
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: Password reset by user itself

Unread post by kev1n »

I'm going to look into it a bit later.
kev1n
nuBuilder Team
Posts: 4307
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 448 times
Contact:

Re: Password reset by user itself

Unread post 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
You do not have the required permissions to view the files attached to this post.
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: Password reset by user itself

Unread post 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 :-)
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: Password reset by user itself

Unread post 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
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: Password reset by user itself

Unread post by kev1n »

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: Password reset by user itself

Unread post 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.
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: Password reset by user itself

Unread post by kev1n »

You're welcome Janusz!
Post Reply