本文整理汇总了PHP中CSocServAuthManager::SetUniqueKey方法的典型用法代码示例。如果您正苦于以下问题:PHP CSocServAuthManager::SetUniqueKey方法的具体用法?PHP CSocServAuthManager::SetUniqueKey怎么用?PHP CSocServAuthManager::SetUniqueKey使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CSocServAuthManager
的用法示例。
在下文中一共展示了CSocServAuthManager::SetUniqueKey方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Authorize
public function Authorize($identity = false, $var = false)
{
if ($var === false) {
$var = 'OPENID_IDENTITY_OPENID';
}
$step = COpenIDClient::GetOpenIDAuthStep($var);
if ($step > 0) {
$obOpenID = new COpenIDClient();
if ($step == 2) {
return $obOpenID->Authorize();
} elseif ($step == 1) {
if ($identity === false) {
$identity = $_REQUEST['OPENID_IDENTITY_OPENID'];
}
CSocServAuthManager::SetUniqueKey();
$return_to = CSocServUtil::GetCurUrl("auth_service_id=" . urlencode($_REQUEST["auth_service_id"]) . "&check_key=" . $_SESSION["UNIQUE_KEY"], array("SEF_APPLICATION_CUR_PAGE_URL", "auth_service_error", "auth_service_id", "login"));
if ($url = $obOpenID->GetRedirectUrl($identity, $return_to)) {
LocalRedirect($url, true);
} else {
LocalRedirect(CSocServUtil::GetCurUrl("auth_service_id=" . urlencode($_REQUEST["auth_service_id"]) . "&auth_service_error=1"));
}
return false;
}
}
return false;
}
示例2: Authorize
public function Authorize($identity=false, $var=false)
{
if($var === false)
$var = 'OPENID_IDENTITY_OPENID';
$step = COpenIDClient::GetOpenIDAuthStep($var);
if($step > 0)
{
$obOpenID = new COpenIDClient();
if($step == 2)
{
return $obOpenID->Authorize();
}
elseif($step == 1)
{
if($identity === false)
$identity = $_REQUEST['OPENID_IDENTITY_OPENID'];
CSocServAuthManager::SetUniqueKey();
$return_to = CSocServUtil::GetCurUrl("auth_service_id=".urlencode($_REQUEST["auth_service_id"])."&check_key=".$_SESSION["UNIQUE_KEY"]);
if($url = $obOpenID->GetRedirectUrl($identity, $return_to))
LocalRedirect($url, true);
else
return false;
}
}
return false;
}
示例3: getUrl
public function getUrl($location = 'opener', $addScope = null, $arParams = array())
{
global $APPLICATION;
$this->entityOAuth = $this->getEntityOAuth();
CSocServAuthManager::SetUniqueKey();
if (IsModuleInstalled('bitrix24') && defined('BX24_HOST_NAME')) {
$redirect_uri = static::CONTROLLER_URL . "/redirect.php";
$state = CYandexOAuthInterface::GetRedirectURI() . "?check_key=" . $_SESSION["UNIQUE_KEY"] . "&state=";
$backurl = $APPLICATION->GetCurPageParam('', array("logout", "auth_service_error", "auth_service_id", "backurl"));
$state .= urlencode("state=" . urlencode("backurl=" . urlencode($backurl) . '&mode=' . $location . (isset($arParams['BACKURL']) ? '&redirect_url=' . urlencode($arParams['BACKURL']) : '')));
} else {
$state = 'site_id=' . SITE_ID . '&backurl=' . urlencode($APPLICATION->GetCurPageParam('check_key=' . $_SESSION["UNIQUE_KEY"], array("logout", "auth_service_error", "auth_service_id", "backurl"))) . '&mode=' . $location . (isset($arParams['BACKURL']) ? '&redirect_url=' . urlencode($arParams['BACKURL']) : '');
$redirect_uri = CYandexOAuthInterface::GetRedirectURI();
}
return $this->entityOAuth->GetAuthUrl($redirect_uri, $state);
}
示例4: getUrl
public function getUrl($location = 'opener', $addScope = null, $arParams = array())
{
global $APPLICATION;
CSocServAuthManager::SetUniqueKey();
if (IsModuleInstalled('bitrix24') && defined('BX24_HOST_NAME')) {
$redirect_uri = self::CONTROLLER_URL . "/redirect.php";
$state = \CHTTP::URN2URI("/bitrix/tools/oauth/office365.php") . "?state=";
$backurl = urlencode($GLOBALS["APPLICATION"]->GetCurPageParam('check_key=' . $_SESSION["UNIQUE_KEY"], array("logout", "auth_service_error", "auth_service_id", "backurl"))) . (isset($arParams['BACKURL']) ? '&redirect_url=' . urlencode($arParams['BACKURL']) : '') . '&mode=' . $location;
$state .= urlencode(urlencode("backurl=" . $backurl));
} else {
$backurl = $APPLICATION->GetCurPageParam('check_key=' . $_SESSION["UNIQUE_KEY"], array("logout", "auth_service_error", "auth_service_id", "backurl"));
$redirect_uri = \CHTTP::URN2URI("/bitrix/tools/oauth/office365.php");
$state = 'site_id=' . SITE_ID . '&backurl=' . urlencode($backurl) . (isset($arParams['BACKURL']) ? '&redirect_url=' . urlencode($arParams['BACKURL']) : '') . '&mode=' . $location;
}
return $this->getEntityOAuth()->GetAuthUrl($redirect_uri, $state);
}
示例5: getUrl
public function getUrl($location = 'opener', $addScope = null, $arParams = array())
{
$this->entityOAuth = $this->getEntityOAuth();
if ($this->userId == null) {
$this->entityOAuth->setRefreshToken("skip");
}
if ($addScope !== null) {
$this->entityOAuth->addScope($addScope);
}
CSocServAuthManager::SetUniqueKey();
if (IsModuleInstalled('bitrix24') && defined('BX24_HOST_NAME')) {
$redirect_uri = static::CONTROLLER_URL . "/redirect.php";
$state = CSocServUtil::ServerName() . "/bitrix/tools/oauth/google.php?check_key=" . $_SESSION["UNIQUE_KEY"] . "&state=";
$backurl = $GLOBALS["APPLICATION"]->GetCurPageParam('', array("logout", "auth_service_error", "auth_service_id", "backurl"));
$state .= urlencode('provider=' . static::ID . "&state=" . urlencode("backurl=" . urlencode($backurl) . '&mode=' . $location . (isset($arParams['BACKURL']) ? '&redirect_url=' . urlencode($arParams['BACKURL']) : '')));
} else {
$state = 'provider=' . static::ID . '&site_id=' . SITE_ID . '&backurl=' . urlencode($GLOBALS["APPLICATION"]->GetCurPageParam('check_key=' . $_SESSION["UNIQUE_KEY"], array("logout", "auth_service_error", "auth_service_id", "backurl"))) . '&mode=' . $location . (isset($arParams['BACKURL']) ? '&redirect_url=' . urlencode($arParams['BACKURL']) : '');
$redirect_uri = CSocServUtil::ServerName() . "/bitrix/tools/oauth/google.php";
}
return $this->entityOAuth->GetAuthUrl($redirect_uri, $state);
}
示例6: authorize
public static function authorize()
{
\CSocServAuthManager::SetUniqueKey();
$redirectUri = static::getRedirectUri();
$url = static::getEngine()->getInterface()->GetAuthUrl($redirectUri, "backurl=" . urlencode($redirectUri . '?check_key=' . $_SESSION["UNIQUE_KEY"]));
$httpClient = new HttpClient(array("redirect" => false));
$result = $httpClient->get($url);
if ($httpClient->getStatus() == 302) {
return array("location" => $httpClient->getHeaders()->get("Location"));
}
throw new SystemException("Wrong response: " . $result);
}
示例7: define
define("STOP_STATISTICS", true);
define("BX_SECURITY_SHOW_MESSAGE", true);
require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_before.php";
global $USER;
$rnd = $_REQUEST["rnd"];
$userId = $USER->GetId();
__IncludeLang(dirname(__FILE__) . "/lang/" . LANGUAGE_ID . "/getdata.php");
if (!check_bitrix_sessid()) {
return;
}
if (!array_key_exists("GD_PLANNER_PARAMS", $_SESSION) || !array_key_exists($rnd, $_SESSION["GD_PLANNER_PARAMS"]) || !is_array($_SESSION["GD_PLANNER_PARAMS"][$rnd])) {
return;
}
$arGadgetParams = $_SESSION["GD_PLANNER_PARAMS"][$rnd];
CModule::IncludeModule('socialservices');
CSocServAuthManager::SetUniqueKey();
$clientId = $arGadgetParams["APP_ID"];
$clientSecret = $arGadgetParams["APP_SECRET"];
$domain = $portalURI = $arGadgetParams["PORTAL_URI"];
?>
<div class="bx-gadgets-planner">
<?php
if ($clientId == '' || $clientSecret == '' || $portalURI == '') {
exit;
}
$needAuthorize = false;
$accessToken = '';
$redirectURI = CSocServUtil::ServerName() . '/bitrix/tools/oauth/bitrix24.php';
$savedPortalURI = CUserOptions::GetOption('socialservices', 'bitrix24_task_planer_gadget_portal', '', $userId);
$requestCode = CUserOptions::GetOption('socialservices', 'bitrix24_task_planer_gadget_code', '', $userId);
if ($savedPortalURI !== $portalURI || $savedPortalURI == '') {