Пример #1
0
 protected function action()
 {
     \UsersRegistration_Registrate::testCaptcha($this->getParam('captcha'), 'kcaptcha');
     $this->api = \Extasy\Users\Social\OdnoklassnikiApiFactory::getInstance();
     $userOdProfile = $this->api->getCurrentSession();
     \UsersRegistration::signup($this->getParam('login'), \Extasy\Columns\Password::generatePassword(), $this->getParam('email'), ['social_networks' => ['odnoklassniki' => $userOdProfile['id']]]);
     return true;
 }
Пример #2
0
 protected function action()
 {
     try {
         UsersLogin::testLoginAttempts();
     } catch (\Exception $e) {
         Record::add(__CLASS__, $e->getMessage(), $e);
         throw $e;
     }
     //
     $this->api = \Extasy\Users\Social\OdnoklassnikiApiFactory::getInstance();
     $userOdnoklassnikiProfile = $this->api->getCurrentSession();
     $uid = $userOdnoklassnikiProfile['id'];
     $user = \Extasy\Users\Columns\SocialNetworks::getByUID($uid, 'odnoklassniki');
     UsersLogin::testConfirmationCode($user);
     UsersLogin::forceLogin($user);
     $log = sprintf('Odnoklassniki login successfully finished. User ("%s", "%d") logged with uid ("%s" )', $user->login->getValue(), $user->id->getValue(), $userOdnoklassnikiProfile['id']);
     Record::add(__CLASS__, $log);
 }