當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。