コード例 #1
0
ファイル: component.php プロジェクト: spas-viktor/books
     $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
0
ファイル: bitrix24net.php プロジェクト: Satariall/izurit
<?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
0
ファイル: bitrix24.php プロジェクト: ASDAFF/open_bx
<?
/*
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
0
ファイル: box.php プロジェクト: mrdeadmouse/u136006
<?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
0
ファイル: odnoklassniki.php プロジェクト: mrdeadmouse/u136006
<?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
0
ファイル: mailru.php プロジェクト: spas-viktor/books
<?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
0
ファイル: liveid.php プロジェクト: Satariall/izurit
<?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
0
ファイル: google.php プロジェクト: nProfessor/Mytb
<?
/*
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
0
ファイル: dropbox.php プロジェクト: Satariall/izurit
<?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
0
ファイル: office365.php プロジェクト: webgksupport/alpina
<?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("Office365");
}
require_once $_SERVER['DOCUMENT_ROOT'] . "/bitrix/modules/main/include/epilog_after.php";
コード例 #11
0
ファイル: google.php プロジェクト: ASDAFF/entask.ru
$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");
?>
コード例 #12
0
ファイル: vkontakte.php プロジェクト: nProfessor/Mytb
<?
/*
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("socialservices"))
{
	$oAuthManager = new CSocServAuthManager();
	$oAuthManager->Authorize("Vkontakte");
}

require_once($_SERVER['DOCUMENT_ROOT']."/bitrix/modules/main/include/epilog_after.php");
?>
コード例 #13
0
ファイル: bitrix24.php プロジェクト: spas-viktor/books
<?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";
コード例 #14
0
ファイル: yandex.php プロジェクト: Satariall/izurit
<?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";