本文整理汇总了PHP中CSocServAuthManager::Authorize方法的典型用法代码示例。如果您正苦于以下问题:PHP CSocServAuthManager::Authorize方法的具体用法?PHP CSocServAuthManager::Authorize怎么用?PHP CSocServAuthManager::Authorize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CSocServAuthManager
的用法示例。
在下文中一共展示了CSocServAuthManager::Authorize方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: htmlspecialcharsbx
$arResult["~USER_LOGIN"] = $_COOKIE[COption::GetOptionString("main", "cookie_name", "BITRIX_SM") . "_LOGIN"];
}
$arResult["USER_LOGIN"] = $arResult["LAST_LOGIN"] = htmlspecialcharsbx($arResult["~USER_LOGIN"]);
$arResult["~LAST_LOGIN"] = $arResult["~USER_LOGIN"];
$arResult["AUTH_SERVICES"] = false;
$arResult["CURRENT_SERVICE"] = false;
if (!$USER->IsAuthorized() && CModule::IncludeModule("socialservices")) {
$oAuthManager = new CSocServAuthManager();
$arServices = $oAuthManager->GetActiveAuthServices($arResult);
if (!empty($arServices)) {
$arResult["AUTH_SERVICES"] = $arServices;
if (isset($_REQUEST["auth_service_id"]) && $_REQUEST["auth_service_id"] != '' && isset($arResult["AUTH_SERVICES"][$_REQUEST["auth_service_id"]])) {
$arResult["CURRENT_SERVICE"] = $_REQUEST["auth_service_id"];
if (isset($_REQUEST["auth_service_error"]) && $_REQUEST["auth_service_error"] != '') {
$arResult['ERROR_MESSAGE'] = $oAuthManager->GetError($arResult["CURRENT_SERVICE"], $_REQUEST["auth_service_error"]);
} elseif (!$oAuthManager->Authorize($_REQUEST["auth_service_id"])) {
$ex = $APPLICATION->GetException();
if ($ex) {
$arResult['ERROR_MESSAGE'] = $ex->GetString();
}
}
}
}
}
$arResult["RND"] = $this->randString();
$arResult["SECURE_AUTH"] = false;
if (!CMain::IsHTTPS() && COption::GetOptionString('main', 'use_encrypted_auth', 'N') == 'Y') {
$sec = new CRsaSecurity();
if ($arKeys = $sec->LoadKeys()) {
$sec->SetKeys($arKeys);
$sec->AddToForm('system_auth_form' . $arResult["RND"], array('USER_PASSWORD'));
示例2: array
<?php
/*
This is callback page for Bitrix24.Net OAuth 2.0 authentication.
Bitrix24.Net redirects only to specific back url set in the OAuth application.
The page opens in popup window after user authorized on Bitrix24.Net.
*/
define("NOT_CHECK_PERMISSIONS", true);
if (isset($_REQUEST["state"]) && is_string($_REQUEST["state"])) {
$arState = array();
parse_str($_REQUEST["state"], $arState);
if (isset($arState['site_id']) && is_string($arState['site_id'])) {
$site = substr(preg_replace("/[^a-z0-9_]/i", "", $arState['site_id']), 0, 2);
define("SITE_ID", $site);
}
}
require_once $_SERVER['DOCUMENT_ROOT'] . "/bitrix/modules/main/include/prolog_before.php";
if (CModule::IncludeModule("socialservices")) {
$oAuthManager = new CSocServAuthManager();
$oAuthManager->Authorize("Bitrix24Net");
}
require_once $_SERVER['DOCUMENT_ROOT'] . "/bitrix/modules/main/include/epilog_after.php";
示例3: array
<?
/*
This is callback page for Google OAuth 2.0 authentication.
Google redirects only to specific back url set in the OAuth application.
The page opens in popup window after user authorized on Google.
*/
define("NOT_CHECK_PERMISSIONS", true);
if(isset($_REQUEST["state"]) && is_string($_REQUEST["state"]))
{
$arState = array();
parse_str($_REQUEST["state"], $arState);
if(isset($arState['site_id']))
{
$site = substr(preg_replace("/[^a-z0-9_]/i", "", $arState['site_id']), 0, 2);
define("SITE_ID", $site);
}
}
require_once($_SERVER['DOCUMENT_ROOT']."/freetrix/modules/main/include/prolog_before.php");
if(CModule::IncludeModule("socialservices"))
{
$oAuthManager = new CSocServAuthManager();
$oAuthManager->Authorize("Freetrix24OAuth");
}
require_once($_SERVER['DOCUMENT_ROOT']."/freetrix/modules/main/include/epilog_after.php");
?>
示例4: array
<?php
/*
This is callback page for Dropbox OAuth 2.0 authentication.
Dropbox redirects only to specific back url set in the OAuth application.
The page opens in popup window after user authorized on LiveID.
*/
define("NOT_CHECK_PERMISSIONS", true);
if (isset($_REQUEST["state"]) && is_string($_REQUEST["state"])) {
$arState = array();
parse_str($_REQUEST["state"], $arState);
if (isset($arState['site_id']) && is_string($arState['site_id'])) {
$site = substr(preg_replace("/[^a-z0-9_]/i", "", $arState['site_id']), 0, 2);
define("SITE_ID", $site);
}
}
require_once $_SERVER['DOCUMENT_ROOT'] . "/bitrix/modules/main/include/prolog_before.php";
if (CModule::IncludeModule("socialservices")) {
$oAuthManager = new CSocServAuthManager();
$oAuthManager->Authorize("Box");
}
require_once $_SERVER['DOCUMENT_ROOT'] . "/bitrix/modules/main/include/epilog_after.php";
示例5: array
<?php
/*
This is callback page for MyMailRu OAuth 2.0 authentication.
MyMailRu redirects only to specific back url set in the OAuth application.
The page opens in popup window after user authorized on MyMailRu.
*/
define("NOT_CHECK_PERMISSIONS", true);
if (isset($_REQUEST["state"]) && is_string($_REQUEST["state"])) {
$arState = array();
parse_str($_REQUEST["state"], $arState);
if (isset($arState['site_id']) && is_string($arState['site_id'])) {
$site = substr(preg_replace("/[^a-z0-9_]/i", "", $arState['site_id']), 0, 2);
define("SITE_ID", $site);
}
}
require_once $_SERVER['DOCUMENT_ROOT'] . "/bitrix/modules/main/include/prolog_before.php";
if (CModule::IncludeModule("socialservices")) {
$oAuthManager = new CSocServAuthManager();
$oAuthManager->Authorize("Odnoklassniki");
}
require_once $_SERVER['DOCUMENT_ROOT'] . "/bitrix/modules/main/include/epilog_after.php";
示例6: array
<?php
/*
This is callback page for MyMailRu OAuth 2.0 authentication.
MyMailRu redirects only to specific back url set in the OAuth application.
The page opens in popup window after user authorized on MyMailRu.
*/
define("NOT_CHECK_PERMISSIONS", true);
if (isset($_REQUEST["state"]) && is_string($_REQUEST["state"])) {
$arState = array();
parse_str($_REQUEST["state"], $arState);
if (isset($arState['site_id'])) {
$site = substr(preg_replace("/[^a-z0-9_]/i", "", $arState['site_id']), 0, 2);
define("SITE_ID", $site);
}
}
require_once $_SERVER['DOCUMENT_ROOT'] . "/bitrix/modules/main/include/prolog_before.php";
if (CModule::IncludeModule("socialservices")) {
$oAuthManager = new CSocServAuthManager();
$oAuthManager->Authorize("MyMailRu");
}
require_once $_SERVER['DOCUMENT_ROOT'] . "/bitrix/modules/main/include/epilog_after.php";
示例7: array
<?php
/*
This is callback page for LiveID OAuth 2.0 authentication.
LiveID redirects only to specific back url set in the OAuth application.
The page opens in popup window after user authorized on LiveID.
*/
define("NOT_CHECK_PERMISSIONS", true);
if (isset($_REQUEST["state"]) && is_string($_REQUEST["state"])) {
$arState = array();
parse_str($_REQUEST["state"], $arState);
if (isset($arState['site_id']) && is_string($arState['site_id'])) {
$site = substr(preg_replace("/[^a-z0-9_]/i", "", $arState['site_id']), 0, 2);
define("SITE_ID", $site);
}
}
require_once $_SERVER['DOCUMENT_ROOT'] . "/bitrix/modules/main/include/prolog_before.php";
if (CModule::IncludeModule("socialservices")) {
$oAuthManager = new CSocServAuthManager();
$oAuthManager->Authorize("LiveIDOAuth");
}
require_once $_SERVER['DOCUMENT_ROOT'] . "/bitrix/modules/main/include/epilog_after.php";
示例8: array
<?
/*
This is callback page for Google OAuth 2.0 authentication.
Google redirects only to specific back url set in the OAuth application.
The page opens in popup window after user authorized on Google.
*/
if(isset($_REQUEST["state"]))
{
$arState = array();
parse_str($_REQUEST["state"], $arState);
if(isset($arState['site_id']))
define("SITE_ID", $arState['site_id']);
}
require_once($_SERVER['DOCUMENT_ROOT']."/bitrix/modules/main/include/prolog_before.php");
$bNewUserReg = (COption::GetOptionString("main", "new_user_registration", "N") == "Y");
if(!$USER->IsAuthorized() && $bNewUserReg && CModule::IncludeModule("tr.socialservices"))
{
$oAuthManager = new CSocServAuthManager();
$oAuthManager->Authorize("GoogleOAuth");
}
require_once($_SERVER['DOCUMENT_ROOT']."/bitrix/modules/main/include/epilog_after.php");
?>
示例9: array
<?php
/*
This is callback page for Dropbox OAuth 2.0 authentication.
Dropbox redirects only to specific back url set in the OAuth application.
The page opens in popup window after user authorized on Dropbox.
*/
define("NOT_CHECK_PERMISSIONS", true);
if (isset($_REQUEST["state"]) && is_string($_REQUEST["state"])) {
$arState = array();
parse_str($_REQUEST["state"], $arState);
if (isset($arState['site_id']) && is_string($arState['site_id'])) {
$site = substr(preg_replace("/[^a-z0-9_]/i", "", $arState['site_id']), 0, 2);
define("SITE_ID", $site);
}
}
require_once $_SERVER['DOCUMENT_ROOT'] . "/bitrix/modules/main/include/prolog_before.php";
if (CModule::IncludeModule("socialservices")) {
$oAuthManager = new CSocServAuthManager();
$oAuthManager->Authorize("Dropbox");
}
require_once $_SERVER['DOCUMENT_ROOT'] . "/bitrix/modules/main/include/epilog_after.php";
示例10: array
$provider = "GoogleOAuth";
if(isset($_REQUEST["state"]) && is_string($_REQUEST["state"]))
{
$arState = array();
parse_str($_REQUEST["state"], $arState);
if(isset($arState['site_id']))
{
$site = substr(preg_replace("/[^a-z0-9_]/i", "", $arState['site_id']), 0, 2);
define("SITE_ID", $site);
}
if(isset($arState['provider']) && $arState['provider'] == 'GooglePlusOAuth')
{
$provider = 'GooglePlusOAuth';
}
}
define('SOCSERV_CURRENT_PROVIDER', $provider);
require_once($_SERVER['DOCUMENT_ROOT']."/bitrix/modules/main/include/prolog_before.php");
if(CModule::IncludeModule("socialservices"))
{
$oAuthManager = new CSocServAuthManager();
$oAuthManager->Authorize(SOCSERV_CURRENT_PROVIDER);
}
require_once($_SERVER['DOCUMENT_ROOT']."/bitrix/modules/main/include/epilog_after.php");
?>
示例11: array
<?php
/*
This is callback page for Google OAuth 2.0 authentication.
Google redirects only to specific back url set in the OAuth application.
The page opens in popup window after user authorized on Google.
*/
define("NOT_CHECK_PERMISSIONS", true);
if (isset($_REQUEST["state"]) && is_string($_REQUEST["state"])) {
$arState = array();
parse_str($_REQUEST["state"], $arState);
if (isset($arState['site_id'])) {
$site = substr(preg_replace("/[^a-z0-9_]/i", "", $arState['site_id']), 0, 2);
define("SITE_ID", $site);
}
}
require_once $_SERVER['DOCUMENT_ROOT'] . "/bitrix/modules/main/include/prolog_before.php";
if (CModule::IncludeModule("socialservices")) {
$oAuthManager = new CSocServAuthManager();
$oAuthManager->Authorize("Bitrix24OAuth");
}
require_once $_SERVER['DOCUMENT_ROOT'] . "/bitrix/modules/main/include/epilog_after.php";
示例12: array
<?php
/*
This is callback page for Yandex OAuth 2.0 authentication.
Dropbox redirects only to specific back url set in the OAuth application.
The page opens in popup window after user authorized on Yandex.
*/
define("NOT_CHECK_PERMISSIONS", true);
if (isset($_REQUEST["state"]) && is_string($_REQUEST["state"])) {
$arState = array();
parse_str($_REQUEST["state"], $arState);
if (isset($arState['site_id']) && is_string($arState['site_id'])) {
$site = substr(preg_replace("/[^a-z0-9_]/i", "", $arState['site_id']), 0, 2);
define("SITE_ID", $site);
}
}
require_once $_SERVER['DOCUMENT_ROOT'] . "/bitrix/modules/main/include/prolog_before.php";
if (CModule::IncludeModule("socialservices")) {
$oAuthManager = new CSocServAuthManager();
$oAuthManager->Authorize("YandexOAuth");
}
require_once $_SERVER['DOCUMENT_ROOT'] . "/bitrix/modules/main/include/epilog_after.php";