Fix sso disabled password inconsistencies
This commit is contained in:
parent
8fd2d5bfa5
commit
b5ba5f6188
|
@ -250,8 +250,8 @@ return [
|
|||
'min_password_length' => env('PASSWORD_MINIMUM_LENGTH', 8),
|
||||
|
||||
// Whether the Password field should be enabled on registration.
|
||||
// If this is disabled, it means that no password can be set on registration so the user will
|
||||
// not be able to log in unless linked to an oauth provider.
|
||||
// This is useful when using oauth, disabling it also disables normal
|
||||
// registration without oauth.
|
||||
'enable_password' => (bool)env('ENABLE_PASSWORD', true),
|
||||
|
||||
// Whether the DECT field should be enabled
|
||||
|
|
|
@ -37,6 +37,7 @@ function guest_register()
|
|||
$config = config();
|
||||
$request = request();
|
||||
$session = session();
|
||||
$is_oauth = $session->has('oauth2_connect_provider');
|
||||
|
||||
$msg = '';
|
||||
$nick = '';
|
||||
|
@ -76,8 +77,10 @@ function guest_register()
|
|||
}
|
||||
|
||||
if (
|
||||
!auth()->can('register')
|
||||
|| (!$authUser && !config('registration_enabled') && !$session->get('oauth2_allow_registration'))
|
||||
!auth()->can('register') // No registration permission
|
||||
// Not authenticated and
|
||||
|| (!$authUser && !config('registration_enabled') && !$session->get('oauth2_allow_registration')) // Registration disabled
|
||||
|| (!$authUser && !$enable_password && !$is_oauth) // Password disabled and not oauth
|
||||
) {
|
||||
error(__('Registration is disabled.'));
|
||||
|
||||
|
|
|
@ -188,6 +188,9 @@ msgstr "Passwort vergessen"
|
|||
msgid "Please sign up, if you want to help us!"
|
||||
msgstr "Bitte registriere Dich, wenn Du helfen möchtest!"
|
||||
|
||||
msgid "Registration is only available via external login."
|
||||
msgstr "Die Registrierung ist nur über einen externen Login möglich."
|
||||
|
||||
#: resources/views/pages/login.twig:90 includes/pages/guest_login.php:61
|
||||
msgid "Registration is disabled."
|
||||
msgstr "Registrierung ist abgeschaltet."
|
||||
|
|
|
@ -100,8 +100,12 @@
|
|||
<div class="col-sm-6 text-center">
|
||||
<h2>{{ __('Register') }}</h2>
|
||||
{% if has_permission_to('register') and config('registration_enabled') %}
|
||||
<p>{{ __('Please sign up, if you want to help us!') }}</p>
|
||||
<a href="{{ url('register') }}" class="btn btn-primary">{{ __('Register') }} »</a>
|
||||
{% if config('enable_password') %}
|
||||
<p>{{ __('Please sign up, if you want to help us!') }}</p>
|
||||
<a href="{{ url('register') }}" class="btn btn-primary">{{ __('Register') }} »</a>
|
||||
{% else %}
|
||||
<p>{{ __('Registration is only available via external login.') }}</p>
|
||||
{% endif %}
|
||||
{% else %}
|
||||
{{ m.alert(__('Registration is disabled.'), 'danger') }}
|
||||
{% endif %}
|
||||
|
|
Loading…
Reference in New Issue