mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Fixed budget controller. [skip ci]
This commit is contained in:
@@ -44,19 +44,23 @@ class ProfileController extends BaseController
|
||||
/** @noinspection PhpUndefinedFieldInspection */
|
||||
if (!Hash::check(Input::get('old'), Auth::user()->password)) {
|
||||
Session::flash('error', 'Invalid current password!');
|
||||
|
||||
return View::make('profile.change-password');
|
||||
}
|
||||
if (strlen(Input::get('new1')) == 0 || strlen(Input::get('new2')) == 0) {
|
||||
Session::flash('error', 'Do fill in a password!');
|
||||
|
||||
return View::make('profile.change-password');
|
||||
}
|
||||
if (Input::get('new1') == Input::get('old')) {
|
||||
Session::flash('error', 'The idea is to change your password.');
|
||||
|
||||
return View::make('profile.change-password');
|
||||
}
|
||||
|
||||
if (Input::get('new1') !== Input::get('new2')) {
|
||||
Session::flash('error', 'New passwords do not match!');
|
||||
|
||||
return View::make('profile.change-password');
|
||||
}
|
||||
|
||||
@@ -65,6 +69,7 @@ class ProfileController extends BaseController
|
||||
$this->user->updatePassword(Auth::user(), Input::get('new1'));
|
||||
|
||||
Session::flash('success', 'Password changed!');
|
||||
|
||||
return Redirect::route('profile');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user