don't show SU link for yourself
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
namespace Froxlor\UI\Callbacks;
|
||||
|
||||
use Froxlor\UI\Panel\UI;
|
||||
@@ -21,8 +22,9 @@ use Froxlor\UI\Panel\UI;
|
||||
|
||||
class Impersonate
|
||||
{
|
||||
public static function admin(string $data, array $attributes): array
|
||||
public static function admin(string $data, array $attributes): mixed
|
||||
{
|
||||
if (UI::getCurrentUser()['adminid'] != $attributes['adminid']) {
|
||||
$linker = UI::getLinker();
|
||||
return [
|
||||
'type' => 'link',
|
||||
@@ -37,6 +39,8 @@ class Impersonate
|
||||
]
|
||||
];
|
||||
}
|
||||
return $data;
|
||||
}
|
||||
|
||||
public static function customer(string $data, array $attributes): array
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user