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

25 lines
623 B
PHP

<?php
namespace Misuzu;
if(!$msz->getAuthInfo()->getPerms('user')->check(Perm::U_ROLES_MANAGE))
Template::throwError(403);
$roles = $msz->getRoles();
$pagination = new Pagination($roles->countRoles(), 10);
if(!$pagination->hasValidOffset())
Template::throwError(404);
$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,
]);