Example #1
0
 public function setup()
 {
     parent::setUp();
     $this->api = new TestFacebookApi();
     FacebookApiFactory::setInstance($this->api);
     Helper::dbFixtures([Network::TableName => [['name' => 'facebook'], ['name' => 'vkontakte']], SocialNetworks::UIDTable => [['user_id' => 1, 'network_id' => 1, 'uid' => self::UID]]]);
 }
Example #2
0
 protected function action()
 {
     \UsersRegistration_Registrate::testCaptcha($this->getParam('captcha'));
     $this->api = \Extasy\Users\Social\FacebookApiFactory::getInstance();
     $userFacebookProfile = $this->api->getCurrentSession();
     \UsersRegistration::signup($this->getParam('login'), \Extasy\Columns\Password::generatePassword(), $this->getParam('email'), ['social_networks' => ['facebook' => $userFacebookProfile['id']]]);
     return true;
 }
Example #3
0
 protected function action()
 {
     try {
         UsersLogin::testLoginAttempts();
     } catch (\Exception $e) {
         Record::add(__CLASS__, $e->getMessage(), $e);
         throw $e;
     }
     //
     $this->api = \Extasy\Users\Social\FacebookApiFactory::getInstance();
     $userFacebookProfile = $this->api->getCurrentSession();
     $uid = $userFacebookProfile['id'];
     $user = \Extasy\Users\Columns\SocialNetworks::getByUID($uid, 'facebook');
     UsersLogin::testConfirmationCode($user);
     UsersLogin::forceLogin($user);
     $log = sprintf('Facebook login successfully finished. User ("%s", "%d") logged with uid ("%s" )', $user->login->getValue(), $user->id->getValue(), $userFacebookProfile['id']);
     Record::add(__CLASS__, $log);
 }
Example #4
0
 protected function action()
 {
     $facebookApi = \Extasy\Users\Social\FacebookApiFactory::getInstance();
     return $facebookApi->getCurrentSession();
 }