2016-01-09 14:23:35 -05:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace BookStack\Providers;
|
|
|
|
|
|
|
|
use Auth;
|
2018-09-25 07:30:50 -04:00
|
|
|
use BookStack\Auth\Access\LdapService;
|
2016-01-09 14:23:35 -05:00
|
|
|
use Illuminate\Support\ServiceProvider;
|
|
|
|
|
|
|
|
class AuthServiceProvider extends ServiceProvider
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Bootstrap the application services.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function boot()
|
|
|
|
{
|
|
|
|
//
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Register the application services.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function register()
|
|
|
|
{
|
2018-01-28 11:58:52 -05:00
|
|
|
Auth::provider('ldap', function ($app, array $config) {
|
2016-05-01 16:20:50 -04:00
|
|
|
return new LdapUserProvider($config['model'], $app[LdapService::class]);
|
2016-01-09 14:23:35 -05:00
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|