1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-01-21 04:01:30 +01:00
phorge-phorge/src/applications/auth/engine/PhabricatorAuthSessionEngineExtensionModule.php
epriestley 46881c4ce5 Add a session engine extension point
Summary: Ref T7673. This is really just so I can force admin.phacility.com logout when you log out of an instance, but there are a few other things we could move here eventually, like the WILLREGISTERUSER event.

Test Plan: Logged out of an instance, got logged out of parent (see next change).

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T7673

Differential Revision: https://secure.phabricator.com/D15629
2016-04-05 15:19:47 -07:00

49 lines
1.1 KiB
PHP

<?php
final class PhabricatorAuthSessionEngineExtensionModule
extends PhabricatorConfigModule {
public function getModuleKey() {
return 'sessionengine';
}
public function getModuleName() {
return pht('Engine: Session');
}
public function renderModuleStatus(AphrontRequest $request) {
$viewer = $request->getViewer();
$extensions = PhabricatorAuthSessionEngineExtension::getAllExtensions();
$rows = array();
foreach ($extensions as $extension) {
$rows[] = array(
get_class($extension),
$extension->getExtensionKey(),
$extension->getExtensionName(),
);
}
$table = id(new AphrontTableView($rows))
->setNoDataString(
pht('There are no registered session engine extensions.'))
->setHeaders(
array(
pht('Class'),
pht('Key'),
pht('Name'),
))
->setColumnClasses(
array(
null,
null,
'wide pri',
));
return id(new PHUIObjectBoxView())
->setHeaderText(pht('SessionEngine Extensions'))
->setTable($table);
}
}