Пример #1
0
 public function getUser()
 {
     if ($this->_user === false && $this->validate()) {
         $this->_user = User::findIdentity(UsersAuth::getUserId($this->auth_id, $this->service));
     }
     return $this->_user;
 }
Пример #2
0
 public static function getUserId($auth_id, $service)
 {
     if ($user_id = UsersAuth::findOne(['auth_id' => $auth_id, 'service' => $service])) {
         return $user_id->user_id;
     }
     return NULL;
 }
Пример #3
0
 public function actionSignupAuth($auth_id, $service)
 {
     $modeluser = new LoginForm();
     $modelauth = new UsersAuth();
     if ($modeluser->load(Yii::$app->request->post()) && $modelauth->load(['UsersAuth' => ['auth_id' => $auth_id, 'service' => $service]]) && $modeluser->login() && $modelauth->signup()) {
         return $this->goBack();
     }
     return $this->render('signupAuth', ['model' => $modeluser]);
 }