Permissions f. Categories
Hi again,
I have a problem with setting permissions for categories.
Restricting access to pages in categories works, if a user clicks a page in a category which is set to a usergroup he is not assigned to he gets an errorpage.
But he can still download files in those categories.
Doesnt tiki-downloadfile.php check if he´s allowed to access the category?
Can I make it checking it ?
I searched the code already, tiki-index.php does the following:
// Check to see if page is categorized
$objId = urldecode($page);
if ($tiki_p_admin != 'y' && $feature_categories == 'y' && !$object_has_perms) {
// Check to see if page is categorized
$perms_array = $categlib->get_object_categories_perms($user, 'wiki page', $objId);
if ($perms_array) {
$is_categorized = TRUE;
foreach ($perms_array as $perm => $value) {
$$perm = $value;
}
} else {
$is_categorized = FALSE;
}
if ($is_categorized && isset($tiki_p_view_categories) && $tiki_p_view_categories != 'y') {
if (!isset($user)){
$smarty->assign('msg',$smarty->fetch('modules/mod-login_boxI.tpl'));
$smarty->assign('errortitle',tra("Please login"));
} else {
$smarty->assign('msg',tra("Permission denied you cannot view this page"));
}
$smarty->display("error.tpl");
die;
}
} elseif ($feature_categories == 'y') {
$is_categorized = $categlib->is_categorized('wiki page',$objId);
} else {
$is_categorized = FALSE;
}
If i want to use this, I guess I have to get the $file instead of $page or something ?
Or is this completely nonsense ?
Help.
Thx,
Martin
(TW 1.8.6, MySQL5.0, Apache2.01)