我正在一个网站上工作,在CV部分用户有一些文章只有登录用户才能下载。我想对登录Action或preDispatch()进行更改以设置来宾用户下载文章的会话。为Zend框架中的某些操作设置的会话
有人可以告诉我怎么做,或给我一些参考链接?
这里是我的preDispatch()方法:
public function preDispatch()
{
$userInfo=$this->_auth->getStorage()->read();
$identity= $this->_auth->getIdentity();
if(!$this->_auth->hasIdentity())
{
return $this->_helper->redirector('login','login');
}
if(!isset($userInfo["member_id"]) || strlen($userInfo["member_id"])==0)
{
return $this->_helper->redirector('forbidden','login');
}
$this->_accessType=2;
}