mirror of
https://github.com/OPSnet/Gazelle.git
synced 2026-10-05 22:13:03 -04:00
25 lines
525 B
PHP
25 lines
525 B
PHP
<?php
|
|
|
|
if (!$Viewer->permitted('admin_manage_permissions')) {
|
|
error(403);
|
|
}
|
|
|
|
$userMan = new Gazelle\Manager\User;
|
|
$user = $userMan->findById((int)($_REQUEST['userid']));
|
|
if (is_null($user)) {
|
|
error(404);
|
|
}
|
|
$userId = $user->id();
|
|
|
|
if (isset($_POST['action'])) {
|
|
authorize();
|
|
$user->modifyPermissionList(
|
|
array_filter($_POST, fn($p) => str_starts_with($p, 'perm_'), ARRAY_FILTER_USE_KEY)
|
|
);
|
|
}
|
|
|
|
echo $Twig->render('user/privilege-list.twig', [
|
|
'auth' => $Viewer->auth(),
|
|
'user' => $user,
|
|
]);
|