mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Small fix for #303
Signed-off-by: James Cole <thegrumpydictator@gmail.com>
This commit is contained in:
parent
f3a8a25872
commit
2ce5142b06
@ -110,8 +110,9 @@ 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) {
|
||||
$singleUserMode = FireflyConfig::get('single_user_mode', Config::get('firefly.configuration.single_user_mode'))->data;
|
||||
$userCount = User::count();
|
||||
if ($singleUserMode === true && $userCount > 0) {
|
||||
$message = 'Registration is currently not available.';
|
||||
|
||||
return view('error', compact('message'));
|
||||
@ -163,9 +164,14 @@ class AuthController extends Controller
|
||||
public function showLoginForm()
|
||||
{
|
||||
// is allowed to?
|
||||
$singleUserMode = FireflyConfig::get('single_user_mode', Config::get('firefly.configuration.single_user_mode'))->data;
|
||||
$singleUserMode = FireflyConfig::get('single_user_mode', Config::get('firefly.configuration.single_user_mode'))->data;
|
||||
$userCount = User::count();
|
||||
$allowRegistration = true;
|
||||
if ($singleUserMode === true && $userCount > 0) {
|
||||
$allowRegistration = false;
|
||||
}
|
||||
|
||||
return view('auth.login', compact('singleUserMode'));
|
||||
return view('auth.login', compact('allowRegistration'));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -178,8 +184,9 @@ 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) {
|
||||
$singleUserMode = FireflyConfig::get('single_user_mode', Config::get('firefly.configuration.single_user_mode'))->data;
|
||||
$userCount = User::count();
|
||||
if ($singleUserMode === true && $userCount > 0) {
|
||||
$message = 'Registration is currently not available.';
|
||||
|
||||
return view('error', compact('message'));
|
||||
|
@ -53,7 +53,7 @@
|
||||
<!-- /.col -->
|
||||
</div>
|
||||
</form>
|
||||
{% if not singleUserMode %}
|
||||
{% if allowRegistration %}
|
||||
<a href="{{ URL.to('/register') }}" class="text-center">Register a new account</a><br>
|
||||
{% endif %}
|
||||
<a href="{{ URL.to('/password/reset') }}">I forgot my password</a>
|
||||
|
Loading…
Reference in New Issue
Block a user