$_SESSION['elastix_user'] = trim($_POST['input_user']); $_SESSION['elastix_pass'] = $pass_md5; //fue necesario incluir esto aqui porque cuando te logueas en la interfaz //de usario final haces uso de esta variable $_SESSION['elastix_pass2'] = $_POST['input_pass']; header("Location: index.php"); writeLOG("audit.log", "LOGIN {$_POST['input_user']}: Web Interface login successful. Accepted password for {$_POST['input_user']} from {$_SERVER['REMOTE_ADDR']}."); update_theme(); exit; } else { $user = urlencode(substr($_POST['input_user'], 0, 20)); if (!$pACL->getIdUser($_POST['input_user'])) { // not exists user? writeLOG("audit.log", "LOGIN {$user}: Authentication Failure to Web Interface login. Invalid user {$user} from {$_SERVER['REMOTE_ADDR']}."); } else { writeLOG("audit.log", "LOGIN {$user}: Authentication Failure to Web Interface login. Failed password for {$user} from {$_SERVER['REMOTE_ADDR']}."); } // Debo hacer algo aquí? } } // 2) Autentico usuario if (isset($_SESSION['elastix_user']) && isset($_SESSION['elastix_pass']) && $pACL->authenticateUser($_SESSION['elastix_user'], $_SESSION['elastix_pass'])) { $idUser = $pACL->getIdUser($_SESSION['elastix_user']); $pMenu = new paloMenu($arrConf['elastix_dsn']['elastix']); //obtenemos los menu a los que el usuario tiene acceso $arrMenuFiltered = $pMenu->filterAuthorizedMenus($idUser, 'yes'); $id_organization = $pACL->getIdOrganizationUser($idUser); if ($id_organization == false) { die("Error to retrieve User Info. " . $pACL->errMsg); } $_SESSION['elastix_organization'] = $id_organization;
function renderMenuTemplates() { if (is_null($this->_selection)) { die('FATAL: Unable to render with empty menu!'); } // Generar las listas de items de menú en formato compatible con temas $menuItemsForThemes = array(); $nodeListRef =& $this->_menubase; $i = 0; foreach ($this->_selection as $menuItem) { if ($i >= MAX_THEME_LEVEL) { break; } $menuItemsForThemes[$i] =& $nodeListRef; $nodeListRef =& $this->_menunodes[$menuItem]['children']; $i++; } // Asignar las listas genéricas $smartyVars = array(array('arrMainMenu', 'idMainMenuSelected', 'nameMainMenuSelected'), array('arrSubMenu', 'idSubMenuSelected', 'nameSubMenuSelected'), array('arrSubMenu2', 'idSubMenu2Selected', 'nameSubMenu2Selected')); for ($i = 0; $i < count($menuItemsForThemes); $i++) { $this->_smarty->assign($smartyVars[$i][0], $menuItemsForThemes[$i]); $this->_smarty->assign($smartyVars[$i][1], $this->_selection[$i]); $this->_smarty->assign($smartyVars[$i][2], $this->_menunodes[$this->_selection[$i]][MENUTAG]); } $this->_smarty->assign('isThirdLevel', count($this->_selection) > 2 ? 'on' : 'off'); // Escribir el log de navegación para cada página visitada sin acción alguna if (isset($_GET) && count($_GET) == 1 && isset($_GET['menu'])) { $tagstack = array(); foreach ($this->_selection as $key) { $tagstack[] = $this->_menunodes[$key][MENUTAG]; } $user = isset($_SESSION['elastix_user']) ? $_SESSION['elastix_user'] : '******'; writeLOG('audit.log', sprintf('NAVIGATION %s: User %s visited "%s" from %s.', $user, $user, implode(' >> ', $tagstack), $_SERVER['REMOTE_ADDR'])); } }