/** * Executes this filter. */ function execute() { $icfConfig = new IcfConfig(); // Check if the request is for another resource than login. Only if it is we should check the session if ($_SERVER["PHP_SELF"] == $icfConfig->cfg_page_login) { return; } $session = new Session(); if ($session->isValid() != true) { // echo "<script language=javascript>window.location.href='" . $icfConfig->cfg_page_login . "?method=unauthorized_access'</script>"; echo "<script language=javascript>alert('No hay sesion !!')</script>"; } }
/** * Constructs the IcfTemplating object */ function IcfTemplating($page = "") { // Load configuration $icfConfig = new IcfConfig(); $this->tpl =& new Savant2(); // add a template path $this->tpl->addPath("template", $icfConfig->cfg_site_beTemplatePath); $this->tpl->assign("templatePath", $icfConfig->cfg_site_beTemplateUrl); $this->tpl->assign("basePath", $icfConfig->cfg_site_feBaseUrl); // multilingual support require_once $this->getStringsFile($icfConfig); // Session support $session = new Session(); $this->tpl->assign("user", $session->getSessionUser()); // basic toolbar support $toolbarItem = new icfToolbarItem(); $toolbarItem->setName("exit"); $toolbarItem->setTitle($text["exit"]); $toolbarItem->setUrl("login.php"); $toolbarItem->setImage("/images/exit.png"); $toolbarItem->setImage2("/images/exit_f2.png"); $toolbar = new IcfToolbar(); $toolbar->addToolbarItem($toolbarItem); // Menu support $menu = new IcfMenu(); // Only work it if the session is valid $session = new Session(); if ($session->isValid() == true) { $user = $session->getSessionUser(); // Classes whose objects the user can create $baseClassMapper = new BaseClassMapper(); $classes = $baseClassMapper->findByPermission(Action::ADD_OBJECTS_ACTION(), $user); $menu->setContents($classes); // The folders $folderMapper = new FolderMapper(); $rootFolder = $folderMapper->getRoot(); $folderArray = array(0 => $rootFolder); $menu->setFolders($folderArray); } // Set the generated content in the context of this request (available for client pages to change it) $this->setText($text); $this->setToolbar($toolbar); $this->setMenu($menu); }
function verifyAuth($response) { if (!Session::isValid($response)) { throwUnauth(); } }
<?php include "config.php"; Session::start(); Session::isValid(); header('url=mensajes.php'); ?> <link href="estilo.css" rel="stylesheet" type="text/css" /> <style type="text/css"> <!-- body { background-color: #CDC1C5; } --> </style><table width="802" border="0" cellspacing="0" cellpadding="0"> - Sala principal - <?php mysql_connect("localhost", "root", ""); mysql_select_db("adminrecursos"); //$sql = "SELECT * FROM bienvenida"; //$query = mysql_query($sql); //$bnv = mysql_fetch_array($query); //echo "<font color='red'>".$bnv[0]." </FONT><font color='green'> ".$_SESSION["usuario"]."</font>"; ?> <hr> <tr> <td width="202"> <?php $rank = "SELECT rango FROM usuarios WHERE usuario='" . $_SESSION['usuario'] . "'"; $res = mysql_query($rank);
<?php include "config.php"; Session::start(); $titulo = "Sistema de comunicaciones"; $contenido = ""; ?> <div class="jumbotron"> <h1>Sistema de Comunicaciones</h1> <p>Desarrollado para una mejor comunicacion en la empresa</p> <?php if (!Session::isValid()) { ?> <p><a href="soporte.php"class="btn btn-primary btn-lg" role="button">Solicitar cuenta</a></p> <?php } ?> <br><img src="./img/sistema_de_comunicaciones.jpg" alt="Imagen de Mi Sitio" heihgt="700" width="1000" /><br> </div> <?php $contenido = ob_get_clean(); include 'plantillas/base.php';
<?php include 'config.php'; Session::start(); if (Session::isValid()) { Session::destroy(); } header("location:index.php"); exit;
<?php include "class_session.inc.php"; $session = new Session(); if ($session->isValid()) { //Test if the session has not been stolen print_r($session->getVar("test")); unset($session); session_destroy(); } else { echo $session->getLastError(); }