public function indexAction()
 {
     if (User_Domain_User::isAllowed()) {
         $domain = new User_Domain_User();
         // if there is an id param search for this user
         // else get the authenticated user
         if ($this->_hasParam('id')) {
             $user = $domain->getById($this->_getParam('id'));
         } else {
             $user = $domain->getById(Zend_Auth::getInstance()->getIdentity()->id);
         }
         $this->view->user = $user;
     } else {
         $login = new Agana_Auth_Helper_Login();
         $login->redirectToLoginForm();
     }
 }
 public function indexAction()
 {
     // TODO implementar configuração para saber se pode ser chamado este install
     try {
         $ad = new App_Domain_Account();
         $app = new App_Model_Account();
         $appName = 'Winponta Software';
         $app = $ad->getByName($appName);
         if (!$app->getId()) {
             $app->setName($appName);
             $app->setEmail('*****@*****.**');
             $ad->setAccount($app);
             $app->setId($ad->createInstall());
         }
         $ud = new User_Domain_User();
         $ud->createSuperAdmin(null, $app);
         $login = new Agana_Auth_Helper_Login();
         $login->redirectToLoginForm();
     } catch (Exception $ae) {
         $this->_helper->flashMessenger->addMessage(array('error' => $ae->getMessage()));
     }
 }
 /**
  * Redirect the request to login form, showing a message about permission access
  * The deafult message is = 'You do not have permission to access this'
  * @param String $msg 
  */
 protected function _redirectLogin($msg = 'You do not have permission to access this')
 {
     $this->_helper->flashMessenger->addMessage(array('warning' => $msg));
     $login = new Agana_Auth_Helper_Login();
     $login->redirectToLoginForm();
 }