コード例 #1
0
ファイル: DefaultController.php プロジェクト: mafiu/listapp
 public function autoLogin($user)
 {
     $identity = new UserIdentity($user->username, "");
     $identity->hybridauth($user->username);
     if ($identity->errorCode == UserIdentity::ERROR_NONE) {
         $duration = 3600 * 24 * 30;
         // 30 days
         Yii::app()->user->login($identity, $duration);
         return true;
     } else {
         echo $identity->errorCode;
         return false;
     }
 }