Beispiel #1
0
 /**
  * OpenID でログインする
  * @request string $openid_url openid認証サーバのURL
  */
 public function login_by_openid()
 {
     if ($this->is_login()) {
         $this->redirect_by_map('index');
     }
     if ($openid = OpenpearOpenIDAuth::login($this)) {
         try {
             $openid_maintainer = C(OpenpearOpenidMaintainer)->find_get(Q::eq('url', $openid));
             $this->user($openid_maintainer->maintainer());
             if ($this->login()) {
                 $redirect_to = $this->in_sessions('logined_redirect_to');
                 $this->rm_sessions('logined_redirect_to');
                 if (!empty($redirect_to)) {
                     $this->redirect($redirect_to);
                 }
                 $this->redirect_by_map("login_redirect");
             }
         } catch (NotfoundDaoException $e) {
             $this->sessions('openid_identity', $openid);
             $this->redirect_by_map('signup');
         } catch (Exception $e) {
             throw $e;
         }
     }
     $this->do_login();
 }
Beispiel #2
0
 public function maintainer_openid_add()
 {
     if ($openid = OpenpearOpenIDAuth::login($this)) {
         try {
             $openid_maintainer = C(OpenpearOpenidMaintainer)->find_get(Q::eq('url', $openid));
         } catch (NotfoundDaoException $e) {
             $openid_maintainer = new OpenpearOpenidMaintainer();
             $openid_maintainer->maintainer_id($this->user()->id());
             $openid_maintainer->url($openid);
             $openid_maintainer->save();
         }
     }
     $this->redirect_by_map('maintainer_edit', $this->user()->name());
 }