public static function getAuthUrl($mode = "page", $addScope = null) { if (Option::get("socialservices", "bitrix24net_id", "") != "") { $o = new \CSocServBitrix24Net(); if ($addScope !== null) { $o->addScope($addScope); } return $o->getUrl($mode); } return false; }
public function __construct($appID = false, $appSecret = false, $code = false) { if ($appID === false) { $appID = trim(CSocServBitrix24Net::GetOption("bitrix24net_id")); } if ($appSecret === false) { $appSecret = trim(CSocServBitrix24Net::GetOption("bitrix24net_secret")); } list($prefix, $suffix) = explode(".", $appID, 2); if ($prefix === 'site') { $this->addScope("client"); } elseif ($prefix == 'b24') { $this->addScope('profile'); } $this->httpTimeout = SOCSERV_DEFAULT_HTTP_TIMEOUT; $this->appID = $appID; $this->appSecret = $appSecret; $this->code = $code; }
$userSocServSendEnd = $_POST["ENDSEND"]; } if (isset($_POST["STARTTEXT"])) { $userSocServStartText = $_POST["STARTTEXT"]; } 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); } } require $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/epilog_after.php";