示例#1
0
 public function GetFormHtml($arParams)
 {
     $wll = new WindowsLiveLogin();
     $wll->setAppId(self::GetOption('liveid_appid'));
     $wll->setSecret(self::GetOption('liveid_secret'));
     $_SESSION['BX_LIVEID_LAST_PAGE'] = $GLOBALS["APPLICATION"]->GetCurPageParam('', array('logout'));
     return '<noindex><a href="' . $wll->getLoginUrl() . '" rel="nofollow" class="bx-ss-button liveid-button"></a><span class="bx-spacer"></span><span>' . GetMessage("socserv_liveid_note") . '</span></noindex>';
 }
示例#2
0
 /**
  * Initialize the WindowsLiveLogin module from a settings file. 
  *
  *  'settingsFile' specifies the location of the XML settings file
  *  that contains the application ID, secret key, and security
  *  algorithm. The file is of the following format:
  *
  *  <windowslivelogin>
  *    <appid>APPID</appid>
  *    <secret>SECRET</secret>
  *    <securityalgorithm>wsignin1.0</securityalgorithm>
  *  </windowslivelogin>
  *
  *  In a Delegated Authentication scenario, you may also specify
  *  'returnurl' and 'policyurl' in the settings file, as shown in the
  *  Delegated Authentication samples.
  *
  *  We recommend that you store the WindowsLiveLogin settings file
  *  in an area on your server that cannot be accessed through the 
  *  Internet. This file contains important confidential information.
  */
 public static function initFromXml($settingsFile)
 {
     $o = new WindowsLiveLogin();
     $settings = $o->parseSettings($settingsFile);
     if (@$settings['debug'] == 'true') {
         $o->setDebug(true);
     } else {
         $o->setDebug(false);
     }
     if (@$settings['force_delauth_nonprovisioned'] == 'true') {
         $o->setForceDelAuthNonProvisioned(true);
     } else {
         $o->setForceDelAuthNonProvisioned(false);
     }
     $o->setAppId(@$settings['appid']);
     $o->setSecret(@$settings['secret']);
     $o->setOldSecret(@$settings['oldsecret']);
     $o->setOldSecretExpiry(@$settings['oldsecretexpiry']);
     $o->setSecurityAlgorithm(@$settings['securityalgorithm']);
     $o->setPolicyUrl(@$settings['policyurl']);
     $o->setReturnUrl(@$settings['returnurl']);
     $o->setBaseUrl(@$settings['baseurl']);
     $o->setSecureUrl(@$settings['secureurl']);
     $o->setConsentBaseUrl(@$settings['consenturl']);
     return $o;
 }