2016-01-10 03:23:35 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace BookStack\Providers;
|
|
|
|
|
|
|
|
use Auth;
|
2016-05-02 04:20:50 +08:00
|
|
|
use BookStack\Services\LdapService;
|
2016-01-10 03:23:35 +08: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()
|
|
|
|
{
|
|
|
|
Auth::provider('ldap', function($app, array $config) {
|
2016-05-02 04:20:50 +08:00
|
|
|
return new LdapUserProvider($config['model'], $app[LdapService::class]);
|
2016-01-10 03:23:35 +08:00
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|