<?php

require_once '../../config/autoload.php';
header('Content-type: text/json; charset=UTF-8');
if (isset($_POST["username"]) or isset($_POST["password"])) {
    sleep(1);
    $usuarios = new Usuarios();
    $resultado = $usuarios->buscaPorLoginSenha($_POST["username"], $_POST["password"]);
    if (!empty($resultado)) {
        $autentica = new Autentica();
        $autentica->novaSessao($resultado);
        //if(isset($_POST['lembrar']))
        //$autentica->armazenarLogin($_POST['username']);
        $return_arr["status"] = 1;
    } else {
        $return_arr["status"] = 0;
    }
    echo json_encode($return_arr);
}
exit;
示例#2
0
<?php

require_once '../../config/autoload.php';
$autentica = new Autentica();
$autentica->verificaSessao();
header('Content-type: text/json; charset=UTF-8');
if ($_SESSION['tipo_id'] == 1) {
    /**
    varifica se o checkbox basemaps foi checkado
    **/
    $campoBasemaps = false;
    foreach ($_POST as $chave => $valor) {
        if (explode('-', $chave)[0] === 'basemap') {
            $campoBasemaps = true;
            break;
        }
    }
    /**
    verifica se o checkbox layer foi checkado
    **/
    $campoLayers = false;
    foreach ($_POST as $chave => $valor) {
        if (explode('-', $chave)[0] === 'layer') {
            $campoLayers = true;
            break;
        }
    }
    /**
    valida os campos
    **/
    $valida = new DataValidator();
示例#3
0
<?php

require_once "../config/autoload.php";
$autentica = new Autentica();
$autentica->finalizaSessao();