protected function action() { \UsersRegistration_Registrate::testCaptcha($this->getParam('captcha')); $this->api = \Extasy\Users\Social\TwitterApiFactory::getInstance(); $userTwitterProfile = $this->api->getCurrentSession(); \UsersRegistration::signup($this->getParam('login'), \Extasy\Columns\Password::generatePassword(), $this->getParam('email'), ['social_networks' => ['twitter' => $userTwitterProfile['id']]]); return true; }
protected function action() { try { UsersLogin::testLoginAttempts(); } catch (\Exception $e) { Record::add(__CLASS__, $e->getMessage(), $e); throw $e; } // $this->api = \Extasy\Users\Social\TwitterApiFactory::getInstance(); $userTwitterProfile = $this->api->getCurrentSession(); $uid = $userTwitterProfile['id']; $user = \Extasy\Users\Columns\SocialNetworks::getByUID($uid, 'twitter'); UsersLogin::testConfirmationCode($user); UsersLogin::forceLogin($user); $log = sprintf('Twitter login successfully finished. User ("%s", "%d") logged with uid ("%s" )', $user->login->getValue(), $user->id->getValue(), $userTwitterProfile['id']); Record::add(__CLASS__, $log); }
protected function action() { $twitterApi = \Extasy\Users\Social\TwitterApiFactory::getInstance(); return $twitterApi->getCurrentSession(); }