0)
{
$obOpenID = new COpenIDClient();
if($step == 2)
{
return $obOpenID->Authorize();
}
elseif($step == 1)
{
if($identity === false || is_array($identity))
{
$identity = $_REQUEST[$var];
}
$return_to = CSocServUtil::GetCurUrl("auth_service_id=".urlencode($_REQUEST["auth_service_id"])."&check_key=".\CSocServAuthManager::getUniqueKey(), 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;
}
public function GetFormHtml($arParams)
{
return '
'.'OpenID:'.'
'.bitrix_sessid_post().'
';
}
}
class CSocServYandex extends CSocServOpenID
{
public function Authorize($identity=false, $var=false)
{
if($identity === false || is_array($identity))
$identity = "http://openid.yandex.ru/".$_REQUEST['OPENID_IDENTITY_YANDEX'];
return parent::Authorize($identity, 'OPENID_IDENTITY_YANDEX');
}
public function GetFormHtml($arParams)
{
$login = '';
$matches = array();
if(preg_match('#openid.yandex.ru/([^/$]+)#i', $arParams["~LAST_LOGIN"], $matches))
$login = $matches[1];
return '
@yandex.ru
'.bitrix_sessid_post().'
';
}
}
class CSocServMailRu extends CSocServOpenID
{
public function Authorize($identity=false, $var=false)
{
if($identity === false || is_array($identity))
$identity = "http://openid.mail.ru/mail/".$_REQUEST['OPENID_IDENTITY_MAILRU'];
return parent::Authorize($identity, 'OPENID_IDENTITY_MAILRU');
}
public function GetFormHtml($arParams)
{
$login = '';
$matches = array();
if(preg_match('#openid.mail.ru/mail/([^/$]+)#i', $arParams["~LAST_LOGIN"], $matches))
$login = $matches[1];
return '
@mail.ru
'.bitrix_sessid_post().'
';
}
}
class CSocServLivejournal extends CSocServOpenID
{
public function Authorize($identity=false, $var=false)
{
if($identity === false || is_array($identity))
$identity = $_REQUEST['OPENID_IDENTITY_LIVEJOURNAL'].".livejournal.com";
return parent::Authorize($identity, 'OPENID_IDENTITY_LIVEJOURNAL');
}
public function GetFormHtml($arParams)
{
$login = '';
$matches = array();
if(preg_match('#([^\.]+).livejournal.com#i', $arParams["~LAST_LOGIN"], $matches))
$login = $matches[1];
return '
.livejournal.com
'.bitrix_sessid_post().'
';
}
}
class CSocServLiveinternet extends CSocServOpenID
{
public function Authorize($identity=false, $var=false)
{
if($identity === false || is_array($identity))
$identity = "http://www.liveinternet.ru/users/".$_REQUEST['OPENID_IDENTITY_LIVEINTERNET']."/";
return parent::Authorize($identity, 'OPENID_IDENTITY_LIVEINTERNET');
}
public function GetFormHtml($arParams)
{
$login = '';
$matches = array();
if(preg_match('#www.liveinternet.ru/users/([^/$]+)#i', $arParams["~LAST_LOGIN"], $matches))
$login = $matches[1];
return '
liveinternet.ru/users/
'.bitrix_sessid_post().'
';
}
}
class CSocServBlogger extends CSocServOpenID
{
public function Authorize($identity=false, $var=false)
{
if($identity === false || is_array($identity))
$identity = "http://".$_REQUEST['OPENID_IDENTITY_BLOGGER'].".blogspot.com/";
return parent::Authorize($identity, 'OPENID_IDENTITY_BLOGGER');
}
public function GetFormHtml($arParams)
{
$login = '';
$matches = array();
if(preg_match('#([^\.]+).blogspot.com#i', $arParams["~LAST_LOGIN"], $matches))
$login = $matches[1];
return '
.blogspot.com
'.bitrix_sessid_post().'
';
}
}
class CSocServRambler extends CSocServOpenID
{
public function Authorize($identity=false, $var=false)
{
if($identity === false || is_array($identity))
$identity = "http://id.rambler.ru/users/".$_REQUEST['OPENID_IDENTITY_RAMBLER'];
return parent::Authorize($identity, 'OPENID_IDENTITY_RAMBLER');
}
public function GetFormHtml($arParams)
{
$login = '';
$matches = array();
if(preg_match('#id.rambler.ru/users/([^/$]+)#i', $arParams["~LAST_LOGIN"], $matches))
$login = $matches[1];
return '
@rambler.ru
'.bitrix_sessid_post().'
';
}
}
?>