<?php
/**
 * Created by PhpStorm.
 * User: Joseg
 * Date: 1/5/2018
 * Time: 1:50 AM
 */

include '../comun/validarSesion.php';
if (isset($_REQUEST['token'])) {
    $Valido = new validator();
    $token =$_REQUEST['token'];
    if ($Valido->checkToken($token)){
        $Valido->deleteToken($token);
        include "../comun/mensajeOk.php";
        $data = array("message" => "Has cerrado sesion");
        echo json_encode($data);
    }else{
        include '../comun/mensajeDatosInvalidos.php';
    }
}else{
    include '../comun/mensajeFaltanCampos.php';
}
