| @@ 146-153 (lines=8) @@ | ||
| 143 | $passwordChanged = true; |
|
| 144 | $user->password = Hash::make($password); |
|
| 145 | } |
|
| 146 | else |
|
| 147 | {
|
|
| 148 | $error = Lang::get('base.auth.wrong_password');
|
|
| 149 | $validator->messages()->add('old-password', Lang::get('base.auth.wrong_password'));
|
|
| 150 | ||
| 151 | // Redirect to the user page |
|
| 152 | return Redirect::route('profile')->withInput()->withErrors($validator)->with('error', $error);
|
|
| 153 | } |
|
| 154 | } |
|
| 155 | ||
| 156 | // is new image uploaded? |
|
| @@ 265-272 (lines=8) @@ | ||
| 262 | return Redirect::route($redirect)->with('success', $success);
|
|
| 263 | } |
|
| 264 | } |
|
| 265 | else |
|
| 266 | {
|
|
| 267 | $error = Lang::get('base.auth.wrong_password');
|
|
| 268 | $validator->messages()->add('old-password', Lang::get('base.auth.wrong_password'));
|
|
| 269 | ||
| 270 | // Redirect to the user page |
|
| 271 | return Redirect::route('change-password')->withInput()->withErrors($validator)->with('error', $error);
|
|
| 272 | } |
|
| 273 | ||
| 274 | // Prepare the error message |
|
| 275 | } catch (Exception $e) {
|
|