mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-12-20 18:21:21 +00:00
Code clean up and reformat.
This commit is contained in:
@@ -23,6 +23,18 @@ class UserController extends BaseController
|
||||
return View::make('user.login');
|
||||
}
|
||||
|
||||
/**
|
||||
* Logout user.
|
||||
*
|
||||
* @return \Illuminate\Http\RedirectResponse
|
||||
*/
|
||||
public function logout()
|
||||
{
|
||||
Auth::logout();
|
||||
Session::flush();
|
||||
|
||||
return Redirect::route('index');
|
||||
}
|
||||
|
||||
/**
|
||||
* Login.
|
||||
@@ -32,10 +44,7 @@ class UserController extends BaseController
|
||||
public function postLogin()
|
||||
{
|
||||
$rememberMe = Input::get('remember_me') == '1';
|
||||
$data = [
|
||||
'email' => Input::get('email'),
|
||||
'password' => Input::get('password')
|
||||
];
|
||||
$data = ['email' => Input::get('email'), 'password' => Input::get('password')];
|
||||
$result = Auth::attempt($data, $rememberMe);
|
||||
if ($result) {
|
||||
return Redirect::route('index');
|
||||
@@ -46,20 +55,6 @@ class UserController extends BaseController
|
||||
return View::make('user.login');
|
||||
}
|
||||
|
||||
/**
|
||||
* If allowed, show the register form.
|
||||
*
|
||||
* @return $this|\Illuminate\View\View
|
||||
*/
|
||||
public function register()
|
||||
{
|
||||
if (Config::get('auth.allow_register') !== true) {
|
||||
return View::make('error')->with('message', 'Not possible');
|
||||
}
|
||||
|
||||
return View::make('user.register');
|
||||
}
|
||||
|
||||
/**
|
||||
* If allowed, register the user.
|
||||
*
|
||||
@@ -85,7 +80,6 @@ class UserController extends BaseController
|
||||
$user = $repository->register(Input::all());
|
||||
|
||||
|
||||
|
||||
//$user = $this->user->register(Input::all());
|
||||
if ($user) {
|
||||
if (Config::get('auth.verify_mail') === true) {
|
||||
@@ -101,29 +95,6 @@ class UserController extends BaseController
|
||||
return View::make('user.register');
|
||||
}
|
||||
|
||||
/**
|
||||
* Logout user.
|
||||
*
|
||||
* @return \Illuminate\Http\RedirectResponse
|
||||
*/
|
||||
public function logout()
|
||||
{
|
||||
Auth::logout();
|
||||
Session::flush();
|
||||
|
||||
return Redirect::route('index');
|
||||
}
|
||||
|
||||
/**
|
||||
* Show form to help user get a new password.
|
||||
*
|
||||
* @return \Illuminate\View\View
|
||||
*/
|
||||
public function remindme()
|
||||
{
|
||||
return View::make('user.remindme');
|
||||
}
|
||||
|
||||
/**
|
||||
* If need to verify, send new reset code.
|
||||
* Otherwise, send new password.
|
||||
@@ -157,6 +128,30 @@ class UserController extends BaseController
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* If allowed, show the register form.
|
||||
*
|
||||
* @return $this|\Illuminate\View\View
|
||||
*/
|
||||
public function register()
|
||||
{
|
||||
if (Config::get('auth.allow_register') !== true) {
|
||||
return View::make('error')->with('message', 'Not possible');
|
||||
}
|
||||
|
||||
return View::make('user.register');
|
||||
}
|
||||
|
||||
/**
|
||||
* Show form to help user get a new password.
|
||||
*
|
||||
* @return \Illuminate\View\View
|
||||
*/
|
||||
public function remindme()
|
||||
{
|
||||
return View::make('user.remindme');
|
||||
}
|
||||
|
||||
/**
|
||||
* Send a user a password based on his reset code.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user