Audit module: audit log and address bans
This commit is contained in:
1 parent
b75403e5ea
commit
d2ea1bacac
41 files changed
+2137
-5
No files matched your search
@@ -142,4 +142,44 @@ final class ModuleRegistry
|
||||
|
||||
return $items;
|
||||
}
|
||||
|
||||
/**
|
||||
* Audit-log names of what is done: the modules' own plus the core's.
|
||||
*
|
||||
* @return array<string, array{0: string, 1?: list<string>}>
|
||||
*/
|
||||
public function actions(): array
|
||||
{
|
||||
$actions = [];
|
||||
|
||||
foreach ($this->active() as $module) {
|
||||
$actions = [...$actions, ...$module->actions()];
|
||||
}
|
||||
|
||||
return $actions;
|
||||
}
|
||||
|
||||
/** @return array<string, string> */
|
||||
public function views(): array
|
||||
{
|
||||
$views = ['dashboard' => 'Opened the dashboard'];
|
||||
|
||||
foreach ($this->active() as $module) {
|
||||
$views = [...$views, ...$module->views()];
|
||||
}
|
||||
|
||||
return $views;
|
||||
}
|
||||
|
||||
/** @return list<string> middleware of the active modules for `before` or `after` the site's own */
|
||||
public function middleware(string $position): array
|
||||
{
|
||||
$middleware = [];
|
||||
|
||||
foreach ($this->active() as $module) {
|
||||
array_push($middleware, ...($module->middleware()[$position] ?? []));
|
||||
}
|
||||
|
||||
return $middleware;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user