public function authenticateAction()
 {
     try {
         $user = Pocs_User::login($this->getRequest()->getParam('un'), $this->getRequest()->getParam('pw'), $this->_getAuth(), $this->_getAcl());
     } catch (Exception $e) {
         $this->_flashMessenger->addMessage($e->getMessage());
         $this->_helper->redirector('index', 'login');
     }
     $this->_flashMessenger->addMessage(Zend_Debug::dump($user, 'Authenticated User', false));
     //TODO: Redirect somewhere useful..
     $this->_helper->redirector('index', 'login');
 }
Beispiel #2
0
 public function testMayInherited()
 {
     $user = Pocs_User::login('stm', 'smartone', $this->_generateAuth('stm', 'smartone'), $this->_generateAcl());
     //Add a resource and permission for stm to the acl for this user
     $acl = $user->getAcl();
     $acl->addRole(new Zend_Acl_Role('group'));
     $acl->addRole(new Zend_Acl_Role($user->loginName), 'group');
     $acl->add(new Zend_Acl_Resource('foo'));
     $acl->allow('group', 'foo', 'read');
     $this->assertTrue($user->may('read', 'foo'));
 }