Also covered ProfileController.

This commit is contained in:
James Cole
2014-07-03 09:16:17 +02:00
parent 516fe54bf0
commit 924ec29eaf
6 changed files with 184 additions and 24 deletions

View File

@@ -1,8 +1,14 @@
<?php
use Firefly\Storage\User\UserRepositoryInterface as URI;
class ProfileController extends BaseController
{
public function __construct(URI $user) {
$this->user = $user;
}
public function index()
{
return View::make('profile.index');
@@ -37,11 +43,8 @@ class ProfileController extends BaseController
}
// update the user with the new password.
$password = Hash::make(Input::get('new1'));
/** @noinspection PhpUndefinedFieldInspection */
Auth::user()->password = $password;
/** @noinspection PhpUndefinedMethodInspection */
Auth::user()->save();
$this->user->updatePassword(Auth::user(),Input::get('new1'));
Session::flash('success', 'Password changed!');
return Redirect::route('profile');
}