X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/ddb7f33868ea499ab8f48a7062f145e8c0fbe02f..refs/pull/1824/head:/app/Http/Controllers/Auth/RegisterController.php diff --git a/app/Http/Controllers/Auth/RegisterController.php b/app/Http/Controllers/Auth/RegisterController.php index 304d3bed2..8e4dd57c3 100644 --- a/app/Http/Controllers/Auth/RegisterController.php +++ b/app/Http/Controllers/Auth/RegisterController.php @@ -89,7 +89,7 @@ class RegisterController extends Controller */ protected function checkRegistrationAllowed() { - if (!setting('registration-enabled')) { + if (!setting('registration-enabled') || config('auth.method') === 'ldap') { throw new UserRegistrationException(trans('auth.registrations_disabled'), '/login'); } } @@ -103,7 +103,11 @@ class RegisterController extends Controller { $this->checkRegistrationAllowed(); $socialDrivers = $this->socialAuthService->getActiveDrivers(); - return view('auth.register', ['socialDrivers' => $socialDrivers]); + $samlEnabled = (config('saml2.enabled') === true) && (config('saml2.auto_register') === true); + return view('auth.register', [ + 'socialDrivers' => $socialDrivers, + 'samlEnabled' => $samlEnabled, + ]); } /**