Exemplo n.º 1
0
 public function MenuProfileSystem()
 {
     $urlSica = rtrim(\Zend_Controller_Front::getInstance()->getParam('bootstrap')->getOption('urlSica'), '/');
     $infoSystem = \Core_Integration_Sica_User::getInfoSystem();
     $urlHelp = array_key_exists('txUrlHelp', (array) $infoSystem) ? $infoSystem['txUrlHelp'] : '#';
     $html = '<ul class="nav pull-right dropdown-perfil">
             <li class="divider-vertical visible-desktop"></li>
             <li class="dropdown pull-right">
             <a data-toggle="dropdown" class="dropdown-toggle" href="#">
             <img src="/img/icons/icon-perfil.png">
             </a>
             <ul class="dropdown-menu">';
     $html .= '<li><span>Nome: ' . $this->view->userName() . '</span></li>';
     $html .= '<li><span>Perfil: ' . \Core_Integration_Sica_User::getUserNoProfile() . '</span></li>';
     if (\Core_Integration_Sica_User::getUserProfileExternal()) {
         $linkHelp = '';
         $html .= '<li class="divider"></li>';
         if (count(\Core_Integration_Sica_User::getUserAllProfile()) > 1) {
             $html .= $this->view->usuarioExterno()->optionSelecionarPerfil();
         }
         $html .= $this->view->usuarioExterno()->optionAlterarCadastro();
     } else {
         $linkHelp = '<li><a href="' . $urlHelp . '" target="_blank">Ajuda</a></li>';
         $html .= $this->view->usuario()->optionUnidadeOrg();
         $html .= '<li class="divider"></li>';
         if (count(\Core_Integration_Sica_User::getUserAllProfile()) > 1) {
             $html .= $this->view->usuario()->optionSelecionarPerfil();
         }
     }
     $html .= '<li><a href="' . $urlSica . '/index/home/change/password">Alterar Senha</a></li>';
     $html .= $linkHelp;
     $html .= '<li><a href="' . $urlSica . '/usuario/logout">Sair</a></li>';
     $html .= '</ul></li><li class="divider-vertical visible-desktop"></li>';
     return $html;
 }
Exemplo n.º 2
0
 private function _hasPermissionAcl($action = null, $controller = null, $module = null)
 {
     $acl = Zend_Registry::get('acl');
     $profile = Core_Integration_Sica_User::getUserNoProfile();
     $resource = '';
     if (null === $module) {
         $resource .= $this->getRequest()->getModuleName();
     } else {
         $resource .= $module;
     }
     $resource .= '/';
     if (null === $controller) {
         $resource .= $this->getRequest()->getControllerName();
     } else {
         $resource .= $controller;
     }
     $resource .= '/';
     if (null === $action) {
         $resource .= $this->getRequest()->getActionName();
     } else {
         $resource .= $action;
     }
     $this->_tmp = $resource;
     $permission = FALSE;
     if ($acl->has($resource) && $acl->isAllowed($profile, $resource)) {
         $permission = TRUE;
     }
     return $permission;
 }
Exemplo n.º 3
0
 public function MenuProfileSystem()
 {
     $infoSystem = Core_Integration_Sica_User::getInfoSystem();
     $urlHelp = array_key_exists('txUrlHelp', (array) $infoSystem) ? $infoSystem['txUrlHelp'] : '#';
     $html = '<ul class="nav pull-right dropdown-perfil">
             <li class="divider-vertical visible-desktop"></li>
             <li class="dropdown pull-right">
             <a data-toggle="dropdown" class="dropdown-toggle" href="#">
             <img src="/assets/img/icons/icon-perfil.png">
             </a>
             <ul class="dropdown-menu">';
     $html .= '<li><span>Nome: ' . $this->view->userName() . '</span></li>';
     $html .= '<li><span>Perfil: ' . Core_Integration_Sica_User::getUserNoProfile() . '</span></li>';
     if (\Core_Integration_Sica_User::getUserProfileExternal()) {
         $linkHelp = '';
         $html .= '<li class="divider"></li>';
         if (count(\Core_Integration_Sica_User::getUserAllProfile()) > 1) {
             $html .= $this->view->usuarioExterno()->optionSelecionarPerfil();
         }
         $html .= $this->view->usuarioExterno()->optionAlterarCadastro();
     } else {
         $linkHelp = '<li><a href="' . $urlHelp . '" target="_blank">Ajuda</a></li>';
         $html .= $this->view->usuario()->optionUnidadeOrg();
         $html .= '<li class="divider"></li>';
         if (count(\Core_Integration_Sica_User::getUserAllProfile()) > 1) {
             $html .= $this->view->usuario()->optionSelecionarPerfil();
         }
     }
     $html .= '<li><a data-toggle="modal" data-backdrop="static" data-keyboard="false" ' . 'href="#modal-alterar-senha" id="btn-alterar-senha">Alterar Senha</a></li>';
     $html .= $linkHelp;
     $html .= '<li><a href="' . $this->view->usuario()->urlLogout() . '">Sair</a></li>';
     $html .= '</ul></li><li class="divider-vertical visible-desktop"></li>';
     return $html;
 }
Exemplo n.º 4
0
 private function _hasPermission($module = NULL, $controller = NULL, $action = NULL)
 {
     $acl = \Zend_Registry::get('acl');
     $profile = \Core_Integration_Sica_User::getUserNoProfile();
     $resource = '';
     $request = Zend_Controller_Front::getInstance()->getRequest();
     if (NULL === $module) {
         $resource .= $request->getModuleName();
     } else {
         $resource .= $module;
     }
     $resource .= '/';
     if (NULL === $controller) {
         $resource .= $request->getControllerName();
     } else {
         $resource .= $controller;
     }
     $resource .= '/';
     if (NULL === $action) {
         $resource .= $request->getActionName();
     } else {
         $resource .= $action;
     }
     $permission = FALSE;
     if ($acl->has($resource) && $acl->isAllowed($profile, $resource)) {
         $permission = TRUE;
     }
     return $permission;
 }