D
D
Daniil Galkin2019-03-20 17:00:27
1C-Bitrix
Daniil Galkin, 2019-03-20 17:00:27

How to block access to the site for certain users?

How can I make sure that a certain group of users cannot log in to the site?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Artyom Luchnikov, 2019-03-20
@DgalkinD

You need to catch the authorization event OnBeforeUserLogin . In the event handler, check if the user belongs to a specific group. If it does, then throw an exception and return false, like so:

$APPLICATION->throwException('Под этим пользователем нельзя авторизовываться');
return false;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question