views:

27

answers:

1

I have created a plugin, that ckecks authorization status and gives access for using application. This plugin works fine, but in whole project. I want to make it works only in admin module. How can I do this? I have defined plugin in application.ini:

resources.frontController.plugins.authcheck = Application_Plugin_AuthCheck

Thanks for your help.

A: 

One way:

admin.resources.frontController.plugins.authcheck = Application_Plugin_AuthCheck

Second way: check in plugin module's name:

if ($this->getRequest()->getModuleName() == 'admin') {
    //process
}
Alexander.Plutov