<?php

include_once "include/conexion.php";
include_once "include/sesion.php";
$conexion = new Conexion();
if (!$conexion->conectar()) {
    header('Location: ../');
}
$sesion = new Sesion();
if (!$sesion->is_logged()) {
    if (!$sesion->login()) {
        header('Location: ../');
    } else {
        header('Location: .');
    }
} else {
    if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'salir') {
        $sesion->logout();
        header('Location: ../');
    }
}
include_once "include/lista_articulos.php";
session_start();
if (!isset($_SESSION["lista_articulos"])) {
    $_SESSION["lista_articulos"] = new ListaArticulos();
}
?>
<!DOCTYPE HTML>
<html lang="es">
    <head>
        <title>Zonda &rArr; Sistema de gesti&oacute;n web</title>