• Модуль: dav
  • Путь к файлу: ~/bitrix/modules/dav/classes/general/groupdavclient.php
  • Класс: CDavGroupdavClient
  • Вызов: CDavGroupdavClient::AuthenticateGoogleLogin
private function AuthenticateGoogleLogin($arBasicRequest, $request, $response, $verb = "Authorization")
{
	$request1 = $this->CreateBasicRequest("POST", "/accounts/ClientLogin");
	$request1->SetHeader("Content-Type", "application/x-www-form-urlencoded");
	$request1->SetBody('accountType='.urlencode('HOSTED_OR_GOOGLE').'&Email='.urlencode($this->userName).'&Passwd='.urlencode($this->userPassword).'&service='.urlencode('cl').'&source='.urlencode("none-none-1"));

	if ($this->debug)
	{
		$f = fopen($_SERVER["DOCUMENT_ROOT"]."/++++++++.+++", "a");
		fwrite($f, "n>>>>>>>>>>>>>>>>>> GOOGLEREQUEST >>>>>>>>>>>>>>>>n");
		fwrite($f, $request1 ? $request1->ToString() : "???");
		fwrite($f, "n<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<SendRequest($request1);
	$response1 = $this->GetResponse();

	if ($this->debug)
	{
		$f = fopen($_SERVER["DOCUMENT_ROOT"]."/++++++++.+++", "a");
		fwrite($f, "n>>>>>>>>>>>>>>>>>> GOOGLERESPONCE >>>>>>>>>>>>>>>>n");
		fwrite($f, $response1 ? $response1->Dump() : "???");
		fwrite($f, "n<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<GetStatus('code')) && (intval($statusCode) == 200))
	{
		preg_match('/Auth=(.*)/', $response1->GetBody(), $matches);
		if (isset($matches[1]))
		{
			$this->googleAuth = $matches[1];
			$request->SetHeader($verb, sprintf("GoogleLogin auth=%s", $this->googleAuth));
		}
		else
		{
			return null;
		}
	}
	else
	{
		return null;
	}

	return $request;
}