mirror of
https://github.com/flarum/core.git
synced 2025-10-14 08:24:28 +02:00
User Extender (prepareGroups functionality) (#2110)
This commit is contained in:
committed by
GitHub
parent
71abac0323
commit
37ebeb5705
@@ -31,6 +31,10 @@ class UserServiceProvider extends AbstractServiceProvider
|
||||
{
|
||||
$this->registerAvatarsFilesystem();
|
||||
$this->registerDisplayNameDrivers();
|
||||
|
||||
$this->app->singleton('flarum.user.group_processors', function () {
|
||||
return [];
|
||||
});
|
||||
}
|
||||
|
||||
protected function registerDisplayNameDrivers()
|
||||
@@ -72,6 +76,14 @@ class UserServiceProvider extends AbstractServiceProvider
|
||||
*/
|
||||
public function boot()
|
||||
{
|
||||
foreach ($this->app->make('flarum.user.group_processors') as $callback) {
|
||||
if (is_string($callback)) {
|
||||
$callback = $this->app->make($callback);
|
||||
}
|
||||
|
||||
User::addGroupProcessor($callback);
|
||||
}
|
||||
|
||||
User::setHasher($this->app->make('hash'));
|
||||
User::setGate($this->app->make(Gate::class));
|
||||
User::setDisplayNameDriver($this->app->make('flarum.user.display_name.driver'));
|
||||
|
Reference in New Issue
Block a user