2008年9月29日星期一

Re: [fw-auth] redirect problem

Well,

I have a plugin which a preDispach function.
Within the predispach I have the following

    if ($isDispatchable && !$this->_acl->isAllowed($role, $resource, $action)) {
      if (!$this->_auth->hasIdentity()) {
        // Not logged in, send to login page
        $module = $this->_noauth['module'];
        $controller = $this->_noauth['controller'];
        $action     = $this->_noauth['action'];

      } else {
        // Permission to access resource denied.  Send to error page.
        $module     = $this->_noauth['module'];
        $controller = $this->_noauth['controller'];
        $action     = $this->_noauth['action'];
      }
    }
    $request->setModuleName($module);
    $request->setControllerName($controller);
    $request->setActionName($action);


Is it just a  matter of changing this code?

On Mon, Sep 29, 2008 at 2:00 PM, Bradley Holt <bradley.holt@foundline.com> wrote:
You would have to implement this in your application's logic - I don't know of anything in Zend Framework that does this specifically. When you forward to the login page, include parameters indicating the page from which you forwarded. When the login is complete, use those parameters to forward back to that original page (you may have to save those parameters to a session variable so they persist across multiple login attempts).


On Mon, Sep 29, 2008 at 6:52 AM, Jigal sanders <jigalroecha@gmail.com> wrote:
Hello everyone,

I am using Zend_Acl in combination with login.
Every time when I try to go to a page, the system checks if I am logged in. In case I'm not, it redirects me to a login page. Here I can enter my credentials and log in again.
But when I am logged in it doesn't redirect me to the page I wanted to get originally. How can I make sure it redirects me to the page i wanted originally?

Thanks,

J. Sanders



--
Bradley Holt
bradley.holt@foundline.com





没有评论: