コード例 #1
0
ファイル: person.php プロジェクト: stonyyi/anahita
 /**
  * if a token is passed in the reqeust, then it allows reading.
  *
  * (non-PHPdoc)
  *
  * @see ComActorsControllerPermissionAbstract::canRead()
  */
 public function canRead()
 {
     if ($this->_mixer->getRequest()->get('layout') == 'signup' && $this->isRegistrationOpen()) {
         return $this->_viewer->guest();
     } elseif ($this->_mixer->getRequest()->get('layout') == 'add') {
         return $this->_viewer->admin();
     }
     return parent::canRead();
 }
コード例 #2
0
ファイル: person.php プロジェクト: walteraries/anahita
 /**
  * if a token is passed in the reqeust, then it allows reading  
  * 
  * (non-PHPdoc)
  * @see ComActorsControllerPermissionAbstract::canRead()
  */
 public function canRead()
 {
     //if there's a
     if ($this->token) {
         $user = $this->getService('repos://site/users.user')->find(array('activation' => $this->token));
         if ($user) {
             $this->setItem($this->getRepository()->find(array('userId' => $user->id)));
             $this->getItem()->enabled = true;
             $user->activation = null;
             $user->block = false;
             $user->save();
         }
     }
     return parent::canRead();
 }