Example #1
0
 public final function isme(OpenpearMaintainer $maintainer)
 {
     if ($this->user instanceof OpenpearMaintainer && $this->user->id() == $maintainer->id()) {
         return true;
     }
     return false;
 }
Example #2
0
 public function maintainer()
 {
     if ($this->maintainer instanceof OpenpearMaintainer === false) {
         try {
             $this->maintainer = OpenpearMaintainer::get_maintainer($this->maintainer_id());
         } catch (Exception $e) {
         }
     }
     return $this->maintainer;
 }
Example #3
0
 public function author()
 {
     // setting author
     if ($this->author instanceof OpenpearMaintainer === false) {
         try {
             $this->author = OpenpearMaintainer::get_maintainer($this->author_id());
         } catch (Exception $e) {
             return new OpenpearMaintainer();
         }
     }
     return $this->author;
 }
Example #4
0
 /**
  * 新規登録
  * @context boolean $openid
  */
 public function signup()
 {
     // TODO 仕様の確認
     if ($this->in_sessions('openid_identity')) {
         $this->vars('openid', true);
         $this->vars('openid_identity', $this->in_sessions('openid_identity'));
     } else {
         $this->vars('openid', false);
     }
     $account = new OpenpearMaintainer();
     try {
         if ($this->is_post()) {
             $account->cp($this->vars());
             $account->new_password($this->in_vars('new_password'));
             $account->new_password_conf($this->in_vars('new_password_conf'));
             $account->save();
             if ($this->is_sessions('openid_identity')) {
                 $openid_maintainer = new OpenpearOpenidMaintainer();
                 $openid_maintainer->maintainer_id($account->id());
                 $openid_maintainer->url($this->in_sessions('openid_identity'));
                 $openid_maintainer->save();
                 $this->rm_sessions('openid_identity');
             }
             $this->user($account);
             parent::login();
             $this->redirect_by_map("success_redirect");
         }
     } catch (Exception $e) {
         Dao::rollback_all();
         Log::debug($e);
     }
     $this->cp($account);
 }