Love Fuel?
Donate
About
Forums
Discussions
Login
FuelPHP Forums
Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
General
Auth change password
yeste64
August 2014
Hello,
I want to change the user's password. For this, I use the function
Auth::change_password($old_password, $new_password, $username);
But it works with all values in "old_password".
I don't understand why..
Harro
August 2014
What type of Auth? Which Fuel version?
yeste64
August 2014
I'm using Simpleauth with the version 1.7.2 of Fuel
Harro
August 2014
I can't immediately see how that would happen.
Could you create an issue for this at
https://github.com/fuel/auth/issues
?
yeste64
August 2014
Before that, maybe I've not configured or used good the auth package, no ?
I've added "auth" in my config.php file in "always_load" section
I've created a "auth.php" config file with
...
'driver' => 'Simpleauth',
...
And a simpleauth.php config file with my groups and my roles
And then I use the auth functions to perform all actions I need, included the change of user's password.
Something missing ?
yeste64
August 2014
One precision after some tests :
The password is changed only when the old_password is correct but I haven't got any error when I enter a wrong old password.
yeste64
August 2014
I've found the problem ...
Here my code :
try
{
Auth::change_password(
$old_password,
$new_password,
$user->username
);
Response::redirect('user');
}
catch (Exception $e)
{
Session::set_flash('error', $e->getMessage());
}
But the change_password() function return a Boolean and not an Exception...
Sorry and thank you for your help
:)
Harro
August 2014
Accepted Answer
That is indeed what is documented:
http://docs.fuelphp.com/packages/auth/simpleauth/usage.html#/method_change_password
Add a Comment
Howdy, Stranger!
It looks like you're new here. If you want to get involved, click one of these buttons!
Sign In
Apply for Membership
Categories
All Discussions
5,088
General
↳ General
3,364
↳ Job Board
13
↳ Installation & Setup
214
Packages
↳ Oil
213
↳ Orm
700
↳ Auth
260
Development
↳ Tips and Tutorials
126
↳ Code share
145
↳ Applications
52
In this Discussion
Harro
August 2014
yeste64
August 2014