displayed nextcloud user menu like moodle and wp applications - not for admins!

revert-4e64f57c
elena 2023-03-08 11:53:01 +00:00
parent 5d5ef2f884
commit 6db2b8c60f
1 changed files with 11 additions and 2 deletions

View File

@ -23,6 +23,7 @@
$api_url = "https://" . preg_replace('/^nextcloud\./', 'api.', $_SERVER['HTTP_HOST']);
$avatar_url = "https://" . preg_replace('/^nextcloud\./', 'sso.', $_SERVER['HTTP_HOST']) . "/auth/realms/master/avatar-provider";
$profile_url = "https://" . preg_replace('/^nextcloud\./', 'sso.', $_SERVER['HTTP_HOST']) . "/auth/realms/master/account";
$showsettings = in_array($_['user_uid'], ['admin', 'ddadmin']) ? true : false;
// Remove user menu Settings item for non-administrator users
if(!array_key_exists('core_apps', $_["settingsnavigation"])){
@ -153,14 +154,22 @@
</a>
</li>
<?php foreach ($_['settingsnavigation'] as $entry):?>
<?php if ($entry['id'] == 'logout') { ?>
<?php if ($showsettings) { ?>
<li data-id="<?php p($entry['id']); ?>">
<a href="<?php print_unescaped($entry['href']); ?>"
<?php if ($entry["active"]): ?> class="active"<?php endif; ?>>
<img alt="" src="<?php print_unescaped($entry['icon'] . '?v=' . $_['versionHash']); ?>">
<?php p($entry['name']) ?>
</a>
</li>
<?php } else if ($entry['id'] == 'logout') { ?>
<li data-id="<?php p($entry['id']); ?>">
<a href="<?php print_unescaped($entry['href']); ?>">
<div class="ddiconcontainer">
<i class="icon fa fa-sign-out fa-fw ddicon" aria-hidden="true"></i> </div>
<?php p($entry['name']) ?>
</a>
</li>
</li>
<?php } ?>
<?php endforeach; ?>
</ul>