R
R
ragnar_ok2019-05-28 13:29:57
1C-Bitrix
ragnar_ok, 2019-05-28 13:29:57

How to display a forum with access "No access" to an unauthorized user?

How to show an unauthorized user a forum with access "No access" in the list of forums?
Component: bitrix:forum.index
At the same time, as far as I understand, when you try to follow the link leading to this forum, you should display the authorization page ( ?login=yes ).
Judging by the fact that in the resulting array (arResult) there is no forum with "No access" for an unauthorized user, the list of forums is formed in component.php. But where?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
ragnar_ok, 2019-05-28
@ragnar_ok

/bitrix/components/bitrix/forum.index/component.php:139
You need to change the logic of the filter:

if (!CForumUser::IsAdmin()):
    $arFilter["PERMS"] = $USER->GetGroups() === "2" ? [] : array($USER->GetGroups(), 'A');
    $arFilter["ACTIVE"] = "Y";
  endif;

E
Evgeny Nikolaev, 2019-05-28
@nikolaevevge

The check can be organized via if (!CUser::GetID()) {// logic for not authorized
} else {// logic for authorized
}
The solution I described does not pretend to be standard, with bitrix about half a year.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question