/** * 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(); }
/** * 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(); }