2022-09-13 13:14:49 +00:00
|
|
|
<?php
|
|
|
|
namespace Misuzu;
|
|
|
|
|
2023-08-30 22:37:21 +00:00
|
|
|
use Misuzu\Perm;
|
|
|
|
|
2024-12-02 02:28:08 +00:00
|
|
|
if(!isset($msz) || !($msz instanceof \Misuzu\MisuzuContext))
|
|
|
|
die('Script must be called through the Misuzu route dispatcher.');
|
|
|
|
|
2024-11-30 04:09:29 +00:00
|
|
|
if(!$msz->authInfo->getPerms('global')->check(Perm::G_FORUM_CATEGORIES_MANAGE))
|
2023-08-31 15:59:53 +00:00
|
|
|
Template::throwError(403);
|
2022-09-13 13:14:49 +00:00
|
|
|
|
2024-11-30 04:09:29 +00:00
|
|
|
$permsInfos = $msz->perms->getPermissionInfo(categoryNames: Perm::INFO_FOR_FORUM_CATEGORY);
|
2023-08-30 22:37:21 +00:00
|
|
|
$permsLists = Perm::createList(Perm::LISTS_FOR_FORUM_CATEGORY);
|
2022-09-13 13:14:49 +00:00
|
|
|
|
2023-08-30 22:37:21 +00:00
|
|
|
if(filter_has_var(INPUT_POST, 'perms'))
|
|
|
|
Template::set('calculated_perms', Perm::convertSubmission(
|
|
|
|
filter_input(INPUT_POST, 'perms', FILTER_DEFAULT, FILTER_REQUIRE_ARRAY),
|
|
|
|
Perm::INFO_FOR_FORUM_CATEGORY
|
|
|
|
));
|
2022-09-13 13:14:49 +00:00
|
|
|
|
2023-08-30 22:37:21 +00:00
|
|
|
Template::render('manage.forum.listing', [
|
|
|
|
'perms_lists' => $permsLists,
|
|
|
|
'perms_infos' => $permsInfos,
|
|
|
|
]);
|