|
5 | 5 | namespace SimpleSAML\Module\admin\Controller; |
6 | 6 |
|
7 | 7 | use SimpleSAML\Configuration; |
| 8 | +use SimpleSAML\Event\Dispatcher\ModuleEventDispatcherFactory; |
8 | 9 | use SimpleSAML\Locale\Translate; |
9 | 10 | use SimpleSAML\Module; |
| 11 | +use SimpleSAML\Module\admin\Event\ConfigPageEvent; |
| 12 | +use SimpleSAML\Module\admin\Event\SanityCheckEvent; |
10 | 13 | use SimpleSAML\Session; |
11 | 14 | use SimpleSAML\Utils; |
12 | 15 | use SimpleSAML\XHTML\Template; |
@@ -162,6 +165,10 @@ public function main(/** @scrutinizer ignore-unused */ Request $request): Respon |
162 | 165 | 'modulelist' => $this->getModuleList(), |
163 | 166 | ]; |
164 | 167 |
|
| 168 | + $eventDispatcher = ModuleEventDispatcherFactory::getInstance(); |
| 169 | + /** @var CronEvent $event */ |
| 170 | + $event = $eventDispatcher->dispatch(new ConfigPageEvent($t)); |
| 171 | + $t = $event->getTemplate(); |
165 | 172 | Module::callHooks('configpage', $t); |
166 | 173 | $this->menu->addOption('logout', $this->authUtils->getAdminLogoutURL(), Translate::noop('Log out')); |
167 | 174 | return $this->menu->insert($t); |
@@ -398,8 +405,25 @@ protected function getPrerequisiteChecks(): array |
398 | 405 |
|
399 | 406 |
|
400 | 407 | // Add module specific checks via the sanitycheck hook that a module can provide. |
| 408 | + $eventDispatcher = ModuleEventDispatcherFactory::getInstance(); |
| 409 | + /** @var SanityCheckEvent $event */ |
| 410 | + $event = $eventDispatcher->dispatch(new SanityCheckEvent()); |
| 411 | + |
401 | 412 | $hookinfo = [ 'info' => [], 'errors' => [] ]; |
402 | 413 | Module::callHooks('sanitycheck', $hookinfo); |
| 414 | + |
| 415 | + // Merge results from the event into $hookinfo. Can be removed when hook infrastructure is removed. |
| 416 | + $hookinfo = [ |
| 417 | + 'info' => array_merge( |
| 418 | + $event->getInfo(), |
| 419 | + $hookinfo['info'], |
| 420 | + ), |
| 421 | + 'errors' => array_merge( |
| 422 | + $event->getErrors(), |
| 423 | + $hookinfo['errors'], |
| 424 | + ), |
| 425 | + ]; |
| 426 | + |
403 | 427 | foreach (['info', 'errors'] as $resulttype) { |
404 | 428 | foreach ($hookinfo[$resulttype] as $result) { |
405 | 429 | $matrix[] = [ |
|
0 commit comments