Skip to content

Instantly share code, notes, and snippets.

@michal
Created September 12, 2010 21:00
Show Gist options
  • Save michal/576453 to your computer and use it in GitHub Desktop.
Save michal/576453 to your computer and use it in GitHub Desktop.
<?php
class Endo_Controller_Plugin_Modular extends Zend_Controller_Plugin_Abstract
{
public function preDispatch(Zend_Controller_Request_Abstract $request)
{
$module = $request->getModuleName();
$module = empty($module) ? 'frontend' : $request->getModuleName();
$namespace = Zend_Auth_Storage_Session::NAMESPACE_DEFAULT;
$member = Zend_Auth_Storage_Session::MEMBER_DEFAULT
. '-' . $module;
$storage = new Zend_Auth_Storage_Session($namespace, $member);
Zend_Auth::getInstance()->setStorage($storage);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment