当前位置: 首页>>代码示例>>PHP>>正文


PHP CSocServAuthManager::SetUniqueKey方法代码示例

本文整理汇总了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;
 }
开发者ID:spas-viktor,项目名称:books,代码行数:26,代码来源:openid.php

示例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;
	}
开发者ID:nProfessor,项目名称:Mytb,代码行数:29,代码来源:openid.php

示例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);
 }
开发者ID:Satariall,项目名称:izurit,代码行数:16,代码来源:yandex.php

示例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);
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:16,代码来源:office365.php

示例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);
 }
开发者ID:webgksupport,项目名称:alpina,代码行数:21,代码来源:google.php

示例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);
 }
开发者ID:webgksupport,项目名称:alpina,代码行数:12,代码来源:service.php

示例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 == '') {
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:31,代码来源:getdata.php


注:本文中的CSocServAuthManager::SetUniqueKey方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。