1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-07-28 17:02:04 +03:00

Added files missed in previous commit

This commit is contained in:
Dan Brown
2020-02-02 10:59:03 +00:00
parent 3470a6a140
commit e743cd3f60
21 changed files with 139 additions and 229 deletions

View File

@ -20,14 +20,15 @@ class RegistrationService
$this->emailConfirmationService = $emailConfirmationService;
}
/**
* Check whether or not registrations are allowed in the app settings.
* @throws UserRegistrationException
*/
public function checkRegistrationAllowed()
{
if (!setting('registration-enabled') || config('auth.method') === 'ldap') {
$authMethod = config('auth.method');
$authMethodsWithRegistration = ['standard'];
if (!setting('registration-enabled') || !in_array($authMethod, $authMethodsWithRegistration)) {
throw new UserRegistrationException(trans('auth.registrations_disabled'), '/login');
}
}