<?php
/**
 * Created by PhpStorm.
 * User: Joseg
 * Date: 30/4/2018
 * Time: 12:35 AM
 */
include '../comun/validarSesion.php';
if (isset($_REQUEST['token'])) {
    $Valido = new validator();
    if ($Valido->checkToken($_REQUEST['token'])){
        $condominios = R::findAll( 'condominio' );
        include '../comun/mensajeOk.php';
        print_r(json_encode($condominios));
    }else{
        include '../comun/mensajeDatosInvalidos.php';
    }
}else{
    include '../comun/mensajeSesionInvalida.php';
}