misuzu/public-legacy/manage/users/roles.php

29 lines
649 B
PHP

<?php
namespace Misuzu;
if(!$msz->getAuthInfo()->getPerms('user')->check(Perm::U_ROLES_MANAGE)) {
echo render_error(403);
return;
}
$roles = $msz->getRoles();
$pagination = new Pagination($roles->countRoles(), 10);
if(!$pagination->hasValidOffset()) {
echo render_error(404);
return;
}
$rolesAll = [];
$roleInfos = $roles->getRoles(pagination: $pagination);
foreach($roleInfos as $roleInfo)
$rolesAll[] = [
'info' => $roleInfo,
'members' => $roles->countRoleUsers($roleInfo),
];
Template::render('manage.users.roles', [
'manage_roles' => $rolesAll,
'manage_roles_pagination' => $pagination,
]);