-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Move to SSP UI --------- Co-authored-by: Marko Ivančić <[email protected]>
- Loading branch information
Showing
152 changed files
with
3,889 additions
and
13,315 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
use SimpleSAML\Locale\Translate; | ||
use SimpleSAML\Module\oidc\Codebooks\RoutesEnum; | ||
use SimpleSAML\Module\oidc\ModuleConfig; | ||
use SimpleSAML\XHTML\Template; | ||
|
||
/** @noinspection PhpParameterByRefIsNotUsedAsReferenceInspection Reference is actually used by SimpleSAMLphp */ | ||
function oidc_hook_adminmenu(Template &$template): void | ||
{ | ||
$menuKey = 'menu'; | ||
|
||
if (!isset($template->data[$menuKey]) || !is_array($template->data[$menuKey])) { | ||
return; | ||
} | ||
|
||
$moduleConfig = new ModuleConfig(); | ||
|
||
$oidcMenuEntry = [ | ||
ModuleConfig::MODULE_NAME => [ | ||
'url' => $moduleConfig->getModuleUrl(RoutesEnum::AdminMigrations->value), | ||
'name' => Translate::noop('OIDC'), | ||
], | ||
]; | ||
|
||
// Put OIDC entry before the 'Log out' entry, if it exists. | ||
$logoutEntryKey = 'logout'; | ||
$logoutEntryValue = null; | ||
if ( | ||
array_key_exists($logoutEntryKey, $template->data[$menuKey]) && | ||
is_array($template->data[$menuKey][$logoutEntryKey]) | ||
) { | ||
$logoutEntryValue = $template->data[$menuKey][$logoutEntryKey]; | ||
unset($template->data[$menuKey][$logoutEntryKey]); | ||
} | ||
|
||
$template->data[$menuKey] += $oidcMenuEntry; | ||
|
||
if ($logoutEntryValue !== null) { | ||
$template->data[$menuKey][$logoutEntryKey] = $logoutEntryValue; | ||
} | ||
|
||
$template->getLocalization()->addModuleDomain(ModuleConfig::MODULE_NAME); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.