%PDF- %PDF-
| Direktori : /proc/self/root/proc/self/root/home/bitrix/www/app/ |
| Current File : //proc/self/root/proc/self/root/home/bitrix/www/app/user_check_phone.php |
<?php
/* @global CMain $APPLICATION */
/* @global CUser $USER */
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/header.php");
$arResult[] = array();
$arResult['APP_RESULT'] = array('OK' => true, 'ERROR_MESSAGE' => '');
if ($_SERVER["REQUEST_METHOD"] == "POST" && isset($_REQUEST['PHONE']))
{
$by = 'id'; $order = 'desc';
$dbUsers = CUser::GetList($by, $order, array(
'UF_USER_PHONE' => $_REQUEST['PHONE'],
'ACTIVE' => 'Y'
));
if ($arUser = $dbUsers->Fetch())
{
$arResult['APP_RESULT']['EXISTS'] = 'Y';
}
else
{
$arResult['APP_RESULT']['EXISTS'] = 'N';
}
}
else
{
$arResult['APP_RESULT']['OK'] = false;
$arResult['APP_RESULT']['ERROR_MESSAGE'] = 'ERROR';
}
echo json_encode($arResult['APP_RESULT']);
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/footer.php");