2008年10月14日星期二

[fw-mvc] Plugin and Redirector

Hy

I created a plugin to redirect the login page if dont are
authenticated.Now rather than redirect generates an infinite loop and
end with timeout.How can I do?

The code:

> class PluginAuth extends Zend_Controller_Plugin_Abstract {
>
> function routeStartup() {
>
>
>
> $auth = Zend_Auth::getInstance();
> if (!$auth->hasIdentity()) {
>
>
> $re =
> Zend_Controller_Action_HelperBroker::getStaticHelper('redirector');
> $re->setgotoUrl('/user/login/');
> $re->gotoUrl();
> }
>
> }
>
>
>
>
> }
PS:sorry for my english are italian

没有评论: