mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Small fix for #303
Signed-off-by: James Cole <thegrumpydictator@gmail.com>
This commit is contained in:
@@ -110,8 +110,9 @@ class AuthController extends Controller
|
|||||||
public function register(Request $request)
|
public function register(Request $request)
|
||||||
{
|
{
|
||||||
// is allowed to?
|
// 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;
|
||||||
if ($singleUserMode === true) {
|
$userCount = User::count();
|
||||||
|
if ($singleUserMode === true && $userCount > 0) {
|
||||||
$message = 'Registration is currently not available.';
|
$message = 'Registration is currently not available.';
|
||||||
|
|
||||||
return view('error', compact('message'));
|
return view('error', compact('message'));
|
||||||
@@ -163,9 +164,14 @@ class AuthController extends Controller
|
|||||||
public function showLoginForm()
|
public function showLoginForm()
|
||||||
{
|
{
|
||||||
// is allowed to?
|
// 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);
|
$showDemoWarning = env('SHOW_DEMO_WARNING', false);
|
||||||
|
|
||||||
// is allowed to?
|
// 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;
|
||||||
if ($singleUserMode === true) {
|
$userCount = User::count();
|
||||||
|
if ($singleUserMode === true && $userCount > 0) {
|
||||||
$message = 'Registration is currently not available.';
|
$message = 'Registration is currently not available.';
|
||||||
|
|
||||||
return view('error', compact('message'));
|
return view('error', compact('message'));
|
||||||
|
@@ -53,7 +53,7 @@
|
|||||||
<!-- /.col -->
|
<!-- /.col -->
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
{% if not singleUserMode %}
|
{% if allowRegistration %}
|
||||||
<a href="{{ URL.to('/register') }}" class="text-center">Register a new account</a><br>
|
<a href="{{ URL.to('/register') }}" class="text-center">Register a new account</a><br>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<a href="{{ URL.to('/password/reset') }}">I forgot my password</a>
|
<a href="{{ URL.to('/password/reset') }}">I forgot my password</a>
|
||||||
|
Reference in New Issue
Block a user