示例#1
0
	public function getUrl($mode = "page")
	{
		$redirect_uri = CSocServUtil::GetCurUrl('auth_service_id='.self::ID);

		$state =
			'site_id='.SITE_ID
			.'&backurl='.urlencode($GLOBALS["APPLICATION"]->GetCurPageParam(
				'check_key='.CSocServAuthManager::GetUniqueKey(),
				array(
					"logout", "auth_service_error", "auth_service_id", "check_key"
				)
			))
			.'&mode='.$mode;

		return $this->getEntityOAuth()->GetAuthUrl($redirect_uri, $state);
	}
示例#2
0
 public static function getAuthorizeLink($engine)
 {
     $interface = static::getEngine()->getInterface();
     if (!$interface->checkAccessToken()) {
         if ($interface->getNewAccessToken()) {
             static::getEngine()->setAuthSettings($interface->getResult());
         }
     }
     $checkKey = "";
     if (Loader::includeModule("socialservices")) {
         $checkKey = \CSocServAuthManager::GetUniqueKey();
     }
     return static::SERVICE_URL . static::REGISTER . "?action=authorize&engine=" . urlencode($engine) . "&client_id=" . urlencode(static::getEngine()->getClientId()) . "&auth=" . urlencode($interface->getToken()) . "&check_key=" . urlencode($checkKey);
 }