• Модуль: socialservices
  • Путь к файлу: ~/bitrix/modules/socialservices/classes/general/dropbox.php
  • Класс: CSocServDropboxAuth
  • Вызов: CSocServDropboxAuth::getUrl
public function getUrl($location = 'opener', $addScope = null, $arParams = array())
{
	global $APPLICATION;

	$this->entityOAuth = $this->getEntityOAuth();
	if(IsModuleInstalled('bitrix24') && defined('BX24_HOST_NAME'))
	{
		$redirect_uri = static::CONTROLLER_URL."/redirect.php";
		$state = CDropboxOAuthInterface::GetRedirectURI()."?check_key=".CSocServAuthManager::getUniqueKey()."&state=";
		$backurl = $APPLICATION->GetCurPageParam('', array("logout", "auth_service_error", "auth_service_id", "backurl"));

		$stateIntoState = 'mode=' . $location;
		if (isset($arParams['BACKURL']))
		{
			$stateIntoState .= '&redirect_url=' . urlencode($arParams['BACKURL']);
		}
		else
		{
			$stateIntoState .= "&backurl=" . urlencode($backurl);
		}
		$state .= urlencode("state=" . urlencode($stateIntoState));
	}
	else
	{
		$state = 'site_id='.SITE_ID.'&backurl='.urlencode($APPLICATION->GetCurPageParam('check_key='.CSocServAuthManager::getUniqueKey(), array("logout", "auth_service_error", "auth_service_id", "backurl"))).'&mode='.$location.(isset($arParams['BACKURL']) ? '&redirect_url='.urlencode($arParams['BACKURL']) : '');
		$redirect_uri = CDropboxOAuthInterface::GetRedirectURI();
	}

	return $this->entityOAuth->GetAuthUrl($redirect_uri, $state);
}