I have recently added an admin module to my application. This application has separate authentication from the main site(the admin tools may be used later across different sites for different applications and the admin users are stored in a separate table), and this is causing issues. Because of the the singleton nature of Zend_Auth, I'm overwriting my Zend_Auth instance at critical times, and blowing up my application. So...
I'd like to try to determine which module is being requested in the bootstrap and load only the appropriate front controller plugin. Is there a way to determine which module is being requested at this point of execution, or is there a better solution? How? Below is the method in the bootstrap to initialize the front controller plugins.
protected function _initFrontControllerPluginWithOptions() { $this->bootstrap(array('frontController', 'ResourceLoader', 'session', ));
//get site specifics
$sessionInfo = $this->getOption("resources");
if ($namespace = $sessionInfo['session']['name']) {
$data = array("cookieName" => $namespace);
} else {
throw new Exception("Authplugin can't find session namespace");
}
$frontController = $this->getResource("frontController");
//register plugins
$frontController->registerPlugin(new GS_Admin_Plugin_Auth_Admin($data));
$frontController->registerPlugin(new GS_Model_Plugin_Auth_User($data));
}