Exemplo n.º 1
0
            }
            if (isset($_POST["ENDTEXT"])) {
                $userSocServEndText = $_POST["ENDTEXT"];
            }
            if ($userSocServSendStart === 'Y' || $userSocServSendEnd === 'Y') {
                CUserOptions::SetOption("socialservices", "user_socserv_enable", 'Y', false, $userId);
            } else {
                CUserOptions::SetOption("socialservices", "user_socserv_enable", 'N', false, $userId);
            }
            CUserOptions::SetOption("socialservices", "user_socserv_array", $arUserSocServ, false, $userId);
            CUserOptions::SetOption("socialservices", "user_socserv_start_day", $userSocServSendStart, false, $userId);
            CUserOptions::SetOption("socialservices", "user_socserv_end_day", $userSocServSendEnd, false, $userId);
            CUserOptions::SetOption("socialservices", "user_socserv_start_text", $userSocServStartText, false, $userId);
            CUserOptions::SetOption("socialservices", "user_socserv_end_text", $userSocServEndText, false, $userId);
        }
    } elseif ($_REQUEST['action'] == "registernetwork") {
        $domain = ToLower(rtrim(trim($_REQUEST['url']), '/'));
        if (preg_match("/^http[s]{0,1}:\\/\\/[^\\/]+/", $domain)) {
            $res = CSocServBitrix24Net::registerSite($domain);
        } else {
            $res = array("error" => GetMessage("B24NET_REG_WRONG_URL"));
        }
        Header('Content-Type: application/json');
        echo \Bitrix\Main\Web\Json::encode($res);
    } elseif ($_REQUEST['action'] == "networkclosepopup") {
        \Bitrix\Socialservices\Network::setAdminPopupSession();
        Header('Content-Type: application/json');
        echo \Bitrix\Main\Web\Json::encode(array("result" => 1));
    }
}
require $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/epilog_after.php";