Commit 92a7046b authored by lphuberdeau's avatar lphuberdeau

[MOD] Bulk loading for forums and removing legacy checks

parent fdf10a9d
......@@ -34,27 +34,7 @@ $forum_info = $commentslib->get_forum($_REQUEST["forumId"]);
//Check individual permissions for this forum
$smarty->assign('individual', 'n');
if ($userlib->object_has_one_permission($_REQUEST["forumId"], 'forum')) {
$smarty->assign('individual', 'y');
if ($tiki_p_admin != 'y') {
$perms = $userlib->get_permissions(0, -1, 'permName_desc', '', 'forums');
foreach ($perms["data"] as $perm) {
$permName = $perm["permName"];
if ($userlib->object_has_permission($user, $_REQUEST["forumId"], 'forum', $permName)) {
$$permName = 'y';
$smarty->assign("$permName", 'y');
} else {
$$permName = 'n';
$smarty->assign("$permName", 'n');
}
}
}
}
$tikilib->get_perm_object($_REQUEST["forumId"], 'forum');
// Now if the user is the moderator then give hime forum admin privs
if ($user) {
......@@ -228,20 +208,12 @@ if (isset($_REQUEST['app']) && isset($_REQUEST['msg'])) {
// Quickjumpt to other forums
if ($tiki_p_admin_forum == 'y' || $prefs['feature_forum_quickjump'] == 'y') {
$all_forums = $commentslib->list_forums(0, -1, 'name_asc', '');
Perms::bulk( array( 'type' => 'forum' ), 'object', $all_forums['data'], 'forumId' );
$temp_max = count($all_forums["data"]);
for ($i = 0; $i < $temp_max; $i++) {
if ($userlib->object_has_one_permission($all_forums["data"][$i]["forumId"], 'forum')) {
if ($tiki_p_admin == 'y'
|| $userlib->object_has_permission($user, $all_forums["data"][$i]["forumId"], 'forum', 'tiki_p_admin_forum')
|| $userlib->object_has_permission($user, $all_forums["data"][$i]["forumId"], 'forum', 'tiki_p_forum_read')) {
$all_forums["data"][$i]["can_read"] = 'y';
} else {
$all_forums["data"][$i]["can_read"] = 'n';
}
} else {
$all_forums["data"][$i]["can_read"] = 'y';
}
$forumperms = Perms::get( array( 'type' => 'forum', 'object' => $all_forums['data'][$i]['forumId'] ) );
$all_forums["data"][$i]["can_read"] = $forumperms->forum_read ? 'y' : 'n';
}
$smarty->assign('all_forums', $all_forums['data']);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment