mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-11-17 07:08:19 +00:00
New stuff pertaining to the import procedure and user registration.
This commit is contained in:
@@ -6,6 +6,12 @@ use Firefly\Storage\User\UserRepositoryInterface as URI;
|
||||
class UserController extends BaseController
|
||||
{
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param URI $user
|
||||
* @param EHI $email
|
||||
*/
|
||||
public function __construct(URI $user, EHI $email)
|
||||
{
|
||||
$this->user = $user;
|
||||
@@ -13,11 +19,22 @@ class UserController extends BaseController
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the login view.
|
||||
*
|
||||
* @return \Illuminate\View\View
|
||||
*/
|
||||
public function login()
|
||||
{
|
||||
return View::make('user.login');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Login.
|
||||
*
|
||||
* @return \Illuminate\Http\RedirectResponse|\Illuminate\View\View
|
||||
*/
|
||||
public function postLogin()
|
||||
{
|
||||
$rememberMe = Input::get('remember_me') == '1';
|
||||
@@ -33,6 +50,11 @@ 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) {
|
||||
@@ -41,6 +63,16 @@ class UserController extends BaseController
|
||||
return View::make('user.register');
|
||||
}
|
||||
|
||||
/**
|
||||
* If allowed, register the user.
|
||||
*
|
||||
* Then:
|
||||
*
|
||||
* - Send password OR
|
||||
* - Send reset code.
|
||||
*
|
||||
* @return $this|\Illuminate\View\View
|
||||
*/
|
||||
public function postRegister()
|
||||
{
|
||||
if (Config::get('auth.allow_register') !== true) {
|
||||
@@ -58,17 +90,34 @@ 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.
|
||||
*
|
||||
* @return \Illuminate\View\View
|
||||
*/
|
||||
public function postRemindme()
|
||||
{
|
||||
$user = $this->user->findByEmail(Input::get('email'));
|
||||
@@ -85,16 +134,13 @@ class UserController extends BaseController
|
||||
|
||||
}
|
||||
|
||||
public function verify($verification)
|
||||
{
|
||||
$user = $this->user->findByVerification($verification);
|
||||
if ($user) {
|
||||
$this->email->sendPasswordMail($user);
|
||||
return View::make('user.registered');
|
||||
}
|
||||
return View::make('error')->with('message', 'Yo no hablo verification code!');
|
||||
}
|
||||
|
||||
/**
|
||||
* Send a user a password based on his reset code.
|
||||
*
|
||||
* @param $reset
|
||||
*
|
||||
* @return $this|\Illuminate\View\View
|
||||
*/
|
||||
public function reset($reset)
|
||||
{
|
||||
$user = $this->user->findByReset($reset);
|
||||
|
||||
Reference in New Issue
Block a user