Signed-off-by: James Cole <thegrumpydictator@gmail.com>
This commit is contained in:
James Cole
2016-09-01 18:31:39 +02:00
parent 598e97d028
commit f3a8a25872
11 changed files with 241 additions and 82 deletions

View File

@@ -12,6 +12,7 @@ declare(strict_types = 1);
namespace FireflyIII\Http\Controllers\Auth;
use Auth;
use Config;
use FireflyIII\Events\UserRegistration;
use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Http\Controllers\Controller;
@@ -108,6 +109,15 @@ class AuthController extends Controller
*/
public function register(Request $request)
{
// is allowed to?
$singleUserMode = FireflyConfig::get('single_user_mode', Config::get('firefly.configuration.single_user_mode'))->data;
if ($singleUserMode === true) {
$message = 'Registration is currently not available.';
return view('error', compact('message'));
}
$validator = $this->validator($request->all());
if ($validator->fails()) {
@@ -145,6 +155,19 @@ class AuthController extends Controller
return redirect($this->redirectPath());
}
/**
* Show the application login form.
*
* @return \Illuminate\Http\Response
*/
public function showLoginForm()
{
// is allowed to?
$singleUserMode = FireflyConfig::get('single_user_mode', Config::get('firefly.configuration.single_user_mode'))->data;
return view('auth.login', compact('singleUserMode'));
}
/**
* Show the application registration form.
*
@@ -154,6 +177,14 @@ class AuthController extends Controller
{
$showDemoWarning = env('SHOW_DEMO_WARNING', false);
// is allowed to?
$singleUserMode = FireflyConfig::get('single_user_mode', Config::get('firefly.configuration.single_user_mode'))->data;
if ($singleUserMode === true) {
$message = 'Registration is currently not available.';
return view('error', compact('message'));
}
return view('auth.register', compact('showDemoWarning'));
}