0

Trying to do site with administration on Zend Framework 2, set the authorization at mysite / admin / login. How to deny access if the authorization is not completed all the way after mysite / admin / ...?

In ZF1 for this I used «BaseController», but ZF2 want to check session in class Module.

class Module
{
    public function onBootstrap($e)
    {
        $app = $e->getApplication();
        $sm = $app->getServiceManager();
        $config = $sm->get('Configuration');

        // DB Adapter
        $adapter = $sm->get('Zend\Db\Adapter\Adapter');
        GlobalAdapterFeature::setStaticAdapter($adapter);

        // Session
        $sessionConfig = new SessionConfig();
        $sessionConfig->setOptions($config['session']);
        $sessionManager = new SessionManager($sessionConfig, null, null);
        Container::setDefaultManager($sessionManager);
        $sessionManager->start();
    }
}

Tell me whether I want to do? And in which direction to look?

edigu
  • 9,878
  • 5
  • 57
  • 80
SmClass
  • 13
  • 1
  • 3
  • possible duplicate of [zend session and zend auth](http://stackoverflow.com/questions/9001847/zend-session-and-zend-auth) – chris Nov 02 '12 at 01:22

1 Answers1

0

Try to use Zendframe Work 2 EventManager.

RDK
  • 4,540
  • 2
  • 20
  • 29