Пример #1
0
 /**
  * @param \RainLoop\Account|null $oAccount = null
  *
  * @return \RainLoop\Common\RainLoopFacebookRedirectLoginHelper|null
  */
 public function FacebookConnector($oAccount = null)
 {
     $oFacebook = false;
     $oConfig = $this->oActions->Config();
     $sAppID = \trim($oConfig->Get('social', 'fb_app_id', ''));
     if (\version_compare(PHP_VERSION, '5.4.0', '>=') && $oConfig->Get('social', 'fb_enable', false) && '' !== $sAppID && '' !== \trim($oConfig->Get('social', 'fb_app_secret', ''))) {
         \Facebook\FacebookSession::setDefaultApplication($sAppID, \trim($oConfig->Get('social', 'fb_app_secret', '')));
         $sRedirectUrl = $this->oHttp->GetFullUrl() . '?SocialFacebook';
         if (0 < \strlen($this->oActions->GetSpecAuthToken())) {
             $sRedirectUrl .= '&rlah=' . $this->oActions->GetSpecAuthToken();
         } else {
             if ($this->oHttp->HasQuery('rlah')) {
                 $this->oActions->SetSpecAuthToken($this->oHttp->GetQuery('rlah', ''));
                 $sRedirectUrl .= '&rlah=' . $this->oActions->GetSpecAuthToken();
             }
         }
         try {
             $oAccount = $this->oActions->GetAccount();
             $oFacebook = new \RainLoop\Common\RainLoopFacebookRedirectLoginHelper($sRedirectUrl);
             $oFacebook->initRainLoopData(array('rlAppId' => $sAppID, 'rlAccount' => $oAccount, 'rlUserHash' => \RainLoop\Utils::GetConnectionToken(), 'rlStorageProvaider' => $this->oActions->StorageProvider()));
         } catch (\Exception $oException) {
             $this->oActions->Logger()->WriteException($oException, \MailSo\Log\Enumerations\Type::ERROR);
         }
     }
     return false === $oFacebook ? null : $oFacebook;
 }
Пример #2
0
 /**
  * @return \RainLoop\Providers\Storage
  */
 public function StorageProvider()
 {
     return $this->oActions->StorageProvider();
 }