Exemplo n.º 1
0
$ext = $_GET["ext"];
$funcao = $_GET["funcao"];
include_once dirname(__FILE__) . "/../classesphp/funcoes_gerais.php";
if (!empty($fingerprint) && !empty($g_sid)) {
    $f = explode(",", $fingerprint);
    if ($f[0] != md5('I3GEOSEC' . $_SERVER['HTTP_USER_AGENT'] . session_id())) {
        cpjson(". Tentativa de acesso nao permitida. Inicie um novo mapa.");
        return;
    }
}
include_once dirname(__FILE__) . "/../ms_configura.php";
include_once dirname(__FILE__) . "/blacklist.php";
include_once dirname(__FILE__) . "/../classesphp/classe_vermultilayer.php";
include_once dirname(__FILE__) . "/../classesphp/classe_estatistica.php";
if (isset($logExec) && $logExec["ferramentas"] == true) {
    i3GeoLog("prog: ferramentas url: " . implode("&", array_merge($_GET, $_POST)), $_SESSION["dir_tmp"]);
}
//
//substitui a string de conexão
//
if (!substituiCon($map_file, $postgis_mapa)) {
    unlink($map_file);
    cpjson("erro", $cp);
    return;
}
//
function redesenhaMapa()
{
    global $map_file, $tipoimagem, $cp, $postgis_mapa, $utilizacgi, $locmapserv, $interface, $mapexten;
    substituiCon($map_file, $postgis_mapa);
    if ($tipoimagem != "nenhum" && $tipoimagem != "") {
Exemplo n.º 2
0
<title></title>
</head>
<body bgcolor="white" style="background-color:white;text-align:left;">
<p>
<?php 
if (isset($_FILES['i3GEOuploadsimboloarq']['name']) && strlen(basename($_FILES['i3GEOuploadsimboloarq']['name'])) < 200) {
    $dirDestino = $_GET["dirDestino"];
    $dirDestino = str_replace(".", "", $dirDestino);
    $dirDestino = $locaplic . "/" . $dirDestino;
    $checkphp = fileContemString($_FILES['i3GEOuploadsimboloarq']['tmp_name'], "<?php");
    if ($checkphp == true) {
        echo "Arquivo invalido";
        exit;
    }
    if (isset($logExec) && $logExec["upload"] == true) {
        i3GeoLog("prog: uploadsimbolo filename:" . $_FILES['i3GEOuploadsimboloarq']['name'], $dir_tmp);
    }
    echo "<p class='paragrafo' >Carregando o arquivo...</p>";
    ob_flush();
    flush();
    sleep(1);
    if (!file_exists($dirDestino)) {
        if (!file_exists($dirDestino)) {
            echo "<p class='paragrafo' >Pasta n&atilde;o existe no servidor";
            paraAguarde();
            exit;
        }
    }
    //verifica nomes
    $nome = $_FILES['i3GEOuploadsimboloarq']['name'];
    $nome = str_replace(".png", "", $nome);
Exemplo n.º 3
0
<?php

include dirname(__FILE__) . "/../safe.php";
verificaBlFerramentas(basename(dirname(__FILE__)), $i3geoBlFerramentas, false);
//
//o usuario deve ter entrado pelo i3Geo
//
if (empty($fingerprint)) {
    echo "<p class='paragrafo' >Erro ao enviar o arquivo.";
    return;
}
include dirname(__FILE__) . "/../../classesphp/carrega_ext.php";
if (isset($logExec) && $logExec["upload"] == true) {
    i3GeoLog("prog: carregamapa filename:" . $_FILES['i3GEOcarregamapafilemap']['name'], $dir_tmp);
}
?>
<html>
<head>
<link rel="stylesheet" type="text/css" href="../../css/input.css" />
<link rel="stylesheet" type="text/css" href="../../css/geral.css" />
<title></title>
</head>
<body bgcolor="white" style="background-color:white">
<p>
<?php 
if (isset($_FILES['i3GEOcarregamapafilemap']['name']) && strlen(basename($_FILES['i3GEOcarregamapafilemap']['name'])) < 200) {
    echo "<p class='paragrafo' >Carregando o arquivo...</p>";
    $dirmap = $dir_tmp;
    $Arquivo = $_FILES['i3GEOcarregamapafilemap']['name'];
    $Arquivo = str_replace(".map", "", $Arquivo) . md5(uniqid(rand(), true)) . "_up.map";
    $Arquivo = strip_tags($Arquivo);
if ($_POST["tabelaDestino"] == "") {
    echo "Nome da tabela n&atilde;o definido";
    exit;
}
if ($_POST["insrid"] == "") {
    echo "SRID n&atilde;o definido";
    exit;
}
if ($_FILES['i3GEOuploadshp']['name'] == "") {
    echo "Arquivo n&atilde;o definido";
    exit;
}
if (isset($_FILES['i3GEOuploadshp']['name'])) {
    require_once dirname(__FILE__) . "/../../ms_configura.php";
    if (isset($logExec) && $logExec["upload"] == true) {
        i3GeoLog("prog: metaestat_uploadshp_submit filename:" . $_FILES['i3GEOuploadshp']['name'], $dir_tmp);
    }
    echo "<p class='paragrafo' >Carregando o arquivo...</p>";
    ob_flush();
    flush();
    sleep(1);
    $arqshp = $_FILES['i3GEOuploadshp']['tmp_name'];
    //verifica nomes e sobe arquivo
    verificaNome($_FILES['i3GEOuploadshp']['name'], "shp");
    $nomePrefixo = str_replace(" ", "_", removeAcentos(str_replace(".shp", "", $_FILES['i3GEOuploadshp']['name'])));
    $nomePrefixo = str_replace(".", "", $nomePrefixo);
    $nomePrefixo = strip_tags($nomePrefixo);
    $nomePrefixo = htmlspecialchars($nomePrefixo, ENT_QUOTES);
    $nomePrefixo = $nomePrefixo . md5(uniqid(rand(), true));
    $Arquivo = $_FILES['i3GEOuploadshp']['tmp_name'];
    $status = move_uploaded_file($Arquivo, $dir_tmp . "/" . $nomePrefixo . ".shp");
Exemplo n.º 5
0
//
//a vari&aacute;vel $base pode ser definida em ms_configura, mas a prefer&ecirc;ncia &eacute; pela defini&ccedil;&atilde;o j&aacute; existente
//por isso, $base &eacute; guardada em uma vari&aacute;vel e retomada apos o include de ms_configura.php
//se restauramapa estiver definido, usa o mapfile guardado no banco de  administracao como a base
//
if (!isset($dir_tmp)) {
    include_once dirname(__FILE__) . "/ms_configura.php";
    if (!empty($parurl["base"])) {
        $base = $parurl["base"];
    }
    if (!empty($parurl["interface"])) {
        $interface = $parurl["interface"];
    }
}
if (isset($logExec) && $logExec["init"] == true) {
    i3GeoLog("prog: ms_criamapa url: " . implode("&", array_merge($_GET, $_POST)), $dir_tmp);
}
if (!empty($restauramapa)) {
    $base = restauraMapaAdmin($restauramapa, $dir_tmp);
    $m = ms_newMapObj($base);
    $w = $m->web;
    $w->set("imagepath", dirname($w->imagepath) . "/");
    $w->set("imageurl", dirname($w->imageurl) . "/");
    $m->save($base);
} else {
    if (isset($base)) {
        $tempBaseX = $base;
    }
    if (isset($tempBaseX) && $tempBaseX != "") {
        $base = $tempBaseX;
    }
Exemplo n.º 6
0
<title></title>
</head>
<body bgcolor="white" style="background-color:white;text-align:left;">
<p>
<?php 
if (isset($_FILES['i3GEOuploadkml']['name']) && strlen(basename($_FILES['i3GEOuploadkml']['name'])) < 200) {
    $checkphp = fileContemString($_FILES['i3GEOuploadkml']['tmp_name'], "<?php");
    if ($checkphp == true) {
        exit;
    }
    //$ndir = dirname($filen);
    require_once dirname(__FILE__) . "/../../ms_configura.php";
    include dirname(__FILE__) . "/../blacklist.php";
    verificaBlFerramentas(basename(dirname(__FILE__)), $i3geoBlFerramentas, false);
    if (isset($logExec) && $logExec["upload"] == true) {
        i3GeoLog("prog: uploadkml filename:" . $_FILES['i3GEOuploadkml']['name'], $dir_tmp);
    }
    $mapa = ms_newMapObj($map_file);
    echo "<p class='paragrafo' >Carregando o arquivo...</p>";
    ob_flush();
    flush();
    sleep(1);
    $dirmap = dirname($map_file);
    //verifica nomes
    $ArquivoDest = $_FILES['i3GEOuploadkml']['name'];
    $ArquivoDest = $ArquivoDest . md5(uniqid(rand(), true));
    $ArquivoDest = str_replace(".kml", "", $ArquivoDest);
    $ArquivoDest = str_replace(".", "", $ArquivoDest) . ".kml";
    $ArquivoDest = strip_tags($ArquivoDest);
    $ArquivoDest = htmlspecialchars($ArquivoDest, ENT_QUOTES);
    verificaNome($ArquivoDest);
Exemplo n.º 7
0
    $poPoint1->project($projInObj, $projOutObj);
    $poPoint2 = ms_newpointobj();
    $poPoint2->setXY($lon2, $lat2);
    $poPoint2->project($projInObj, $projOutObj);
    $_GET["BBOX"] = $poPoint1->x . " " . $poPoint1->y . " " . $poPoint2->x . " " . $poPoint2->y;
    $_GET["mapext"] = str_replace(",", " ", $_GET["BBOX"]);
    $_GET["WIDTH"] = 256;
    $_GET["HEIGHT"] = 256;
} elseif (isset($_GET["BBOX"])) {
    $_GET["mapext"] = str_replace(",", " ", $_GET["BBOX"]);
}
//por seguranca
include_once "funcoes_gerais.php";
$logExec = $_SESSION["logExec"];
if (isset($logExec) && $logExec["mapa_"] == true) {
    i3GeoLog("prog: mapa_googlemaps url: " . implode("&", array_merge($_GET, $_POST)), $_SESSION["dir_tmp"]);
}
restauraCon($map_fileX, $postgis_mapa);
$mapa = ms_newMapObj($map_fileX);
$ret = $mapa->extent;
$cache = false;
$cortePixels = 0;
$versao = versaoMS();
if (!isset($_GET["telaR"])) {
    //no caso de projecoes remotas, o mapfile nao e alterado
    $numlayers = $mapa->numlayers;
    for ($i = 0; $i < $numlayers; ++$i) {
        $l = $mapa->getlayer($i);
        $layerName = $l->name;
        $l->set("status", MS_OFF);
        //no caso de haver uma mascara definida no layer
Exemplo n.º 8
0
error_reporting(0);
//
//teste de timeout
//
//for($i==0;$i<5000000000;++$i){}
//
//ativa o php mapscript e as extens&otilde;es necess&aacute;rias
//se as extens&otilde;es j&aacute; estiverem carregadas no PHP, vc pode comentar essa linha para que o processamento fique mais r&aacute;pido
//
include_once "carrega_ext.php";
if (!function_exists("sobeAnno")) {
    include_once "funcoes_gerais.php";
}
$logExec = $_SESSION["logExec"];
if (isset($logExec) && $logExec["controle"] == true) {
    i3GeoLog("prog: mapa_controle url: " . implode("&", array_merge($_GET, $_POST)), $_SESSION["dir_tmp"]);
}
if ($funcao == "criaMapa") {
    session_name("i3GeoPHP");
    unset($GLOBALS);
    session_destroy();
    $_COOKIE = array();
    //
    //primeiro &eacute; necess&aacute;rio carregar o ms_configura.php para pegar a vari&aacute;vel $locaplic
    //
    $d = "";
    include_once dirname(__FILE__) . "/../ms_configura.php";
    //
    //&eacute; necess&aacute;rio mudar o diret&oacute;rio em fun&ccedil;&atilde;o dos includes que s&atilde;o feitos pelo ms_criamapa.php
    //
    //chdir($locaplic);
Exemplo n.º 9
0
    if ($qy == false && $_GET["cache"] == "sim" && $_GET["DESLIGACACHE"] != "sim") {
        carregaCacheImagem($_SESSION["cachedir"], $_SESSION["map_file"], $_GET["tms"], $_SESSION["i3georendermode"]);
    }
}
//
//map_fileX e para o caso register_globals = On no PHP.INI
//
if (isset($_GET["tipolayer"]) && $_GET["tipolayer"] == "fundo") {
    $map_fileX = str_replace(".map", "fundo.map", $map_fileX);
}
$postgis_mapa = $_SESSION["postgis_mapa"];
//por seguranca
include_once "funcoes_gerais.php";
$logExec = $_SESSION["logExec"];
if (isset($logExec) && $logExec["mapa_"] == true) {
    i3GeoLog("prog: mapa_openlayers url: " . implode("&", array_merge($_GET, $_POST)), $_SESSION["dir_tmp"]);
}
restauraCon($map_fileX, $postgis_mapa);
$cachedir = $_SESSION["cachedir"];
if (isset($_GET["BBOX"])) {
    $_GET["mapext"] = str_replace(",", " ", $_GET["BBOX"]);
    $_GET["map_size"] = $_GET["WIDTH"] . " " . $_GET["HEIGHT"];
}
$_GET["TIPOIMAGEM"] = trim($_GET["TIPOIMAGEM"]);
$mapa = ms_newMapObj($map_fileX);
//
//processa os layers do mapfile
//
if (!isset($_GET["telaR"])) {
    //no caso de projecoes remotas, o mapfile nao e alterado
    $numlayers = $mapa->numlayers;
Exemplo n.º 10
0
<link rel="stylesheet" type="text/css" href="../../css/input.css" />
<link rel="stylesheet" type="text/css" href="../../css/geral.css" />
<title></title>
</head>
<body bgcolor="white" style="background-color:white;text-align:left;">
<p>
<?php 
include_once dirname(__FILE__) . "/../../classesphp/sani_request.php";
error_reporting(0);
require_once dirname(__FILE__) . "/../../ms_configura.php";
include dirname(__FILE__) . "/../blacklist.php";
verificaBlFerramentas(basename(dirname(__FILE__)), $i3geoBlFerramentas, false);
$dirmap = dirname($map_file);
$arquivo = "";
if (isset($logExec) && $logExec["upload"] == true) {
    i3GeoLog("prog: importarwmc filename:" . $_FILES['i3GEOimportarwmc']['name'], $dir_tmp);
}
if (isset($_FILES['i3GEOimportarwmc']['name']) && !$_POST["i3GEOimportarwmcurl"] && strlen(basename($_FILES['i3GEOimportarwmc']['name'])) < 200) {
    echo "<p class='paragrafo' >Carregando o arquivo...</p>";
    //verifica nomes
    $ArquivoDest = $_FILES['i3GEOimportarwmc']['name'];
    $ArquivoDest = $ArquivoDest . md5(uniqid(rand(), true));
    $ArquivoDest = str_replace(".xml", "", $ArquivoDest);
    $ArquivoDest = str_replace(".", "", $ArquivoDest) . ".xml";
    $ArquivoDest = strip_tags($ArquivoDest);
    $ArquivoDest = htmlspecialchars($ArquivoDest, ENT_QUOTES);
    verificaNome($ArquivoDest);
    //sobe arquivo
    $checkphp = fileContemString($_FILES['i3GEOimportarwmc']['tmp_name'], "<?php");
    if ($checkphp == true) {
        exit;
Exemplo n.º 11
0
require_once dirname(__FILE__) . "/../../classesphp/funcoes_gerais.php";
include_once dirname(__FILE__) . "/../../classesphp/carrega_ext.php";
error_reporting(0);
$_GET = array_merge($_GET, $_POST);
session_name("i3GeoPHP");
if (isset($_GET["g_sid"])) {
    session_id($_GET["g_sid"]);
}
session_start();
$map_file = $_SESSION["map_file"];
include dirname(__FILE__) . "/../../ms_configura.php";
include "../blacklist.php";
verificaBlFerramentas(basename(dirname(__FILE__)), $i3geoBlFerramentas, false);
$tema = $_GET["tema"];
if (isset($logExec) && $logExec["upload"] == true) {
    i3GeoLog("prog: aplicarsld tema: {$tema} filename:" . $_FILES['i3GEOaplicarsld']['name'], $dir_tmp);
}
?>
<html>
<head>
<link rel="stylesheet" type="text/css" href="../../css/input.css" />
<link rel="stylesheet" type="text/css" href="../../css/geral.css" />
<title></title>
</head>
<body bgcolor="white" style="background-color:white;text-align:left;">
<p>
<?php 
if (isset($_FILES['i3GEOaplicarsld']['name']) && strlen(basename($_FILES['i3GEOaplicarsld']['name'])) < 200) {
    //$ndir = dirname($filen);
    $mapa = ms_newMapObj($map_file);
    echo "<p class='paragrafo' >Carregando o arquivo...</p>";
Exemplo n.º 12
0
function iniciaMapa()
{
    global $googleApiKey, $i3geoPermiteLogin, $dir_tmp, $logExec, $postgis_mapa, $statusFerramentas, $saikuUrl, $emailInstituicao, $openid, $interfacePadrao, $mensagemInicia, $kmlurl, $tituloInstituicao, $tempo, $navegadoresLocais, $locaplic, $embedLegenda, $map_file, $mapext, $w, $h, $R_path, $locmapserv, $utilizacgi, $expoeMapfile, $interface;
    //
    //verifica se algum tema e restrito a determinado usuario
    //as funcoes de validacao encontram-se em funcoes_gerais.php
    //
    if (!function_exists("validaAcessoTemas")) {
        include_once "funcoes_gerais.php";
    }
    validaAcessoTemas($map_file);
    if ($dir_tmp != "" && isset($logExec) && $logExec["init"] == true) {
        i3GeoLog("prog: iniciaMapa interface: {$interface}", $dir_tmp);
    }
    if (!isset($kmlurl)) {
        $kmlurl = "";
    }
    error_reporting(0);
    if (!isset($interface)) {
        $interface = "";
    }
    if ($interface == "openlayers") {
        $m = ms_newMapObj($map_file);
        $e = $m->extent;
        $ext = $e->minx . " " . $e->miny . " " . $e->maxx . " " . $e->maxy;
        $c = $m->numlayers;
        for ($i = 0; $i < $c; ++$i) {
            $layer = $m->getlayer($i);
            if ($layer->status == 2) {
                $layer->setmetadata("olstatus", "DEFAULT");
            } else {
                $layer->setmetadata("olstatus", "OFF");
            }
            $layer->setmetadata("olopacity", $layer->opacity);
        }
        $m->save($map_file);
    }
    if ($interface == "googlemaps" || $interface == "googleearth") {
        $m = ms_newMapObj($map_file);
        $e = $m->extent;
        $ext = $e->minx . " " . $e->miny . " " . $e->maxx . " " . $e->maxy;
        if ($interface == "googlemaps") {
            $m->setProjection("+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m");
        }
        $c = $m->numlayers;
        for ($i = 0; $i < $c; ++$i) {
            $layer = $m->getlayer($i);
            if ($layer->status == 2) {
                $layer->setmetadata("gmstatus", "DEFAULT");
            } else {
                $layer->setmetadata("gmstatus", "OFF");
            }
            $layer->setmetadata("gmopacity", $layer->opacity);
            if ($layer->name == "mundo" || $layer->name == "estados") {
                $layer->set("status", MS_OFF);
            }
            if ($layer->type == MS_LAYER_POLYGON || $layer->type == MS_LAYER_RASTER) {
                if ($layer->opacity == "" || $layer->opacity == 100) {
                    $layer->set("opacity", 50);
                }
            }
            if ($layer->name == "rosadosventos" || $layer->name == "copyright") {
                $layer->set("status", MS_DELETE);
            }
        }
        $temp = $m->scalebar;
        $temp->set("status", MS_OFF);
        $c = $m->imagecolor;
        $c->setrgb(255, 255, 255);
        if ($interface == "googleearth") {
            $m->selectOutputFormat("jpeg");
            $of = $m->outputformat;
            $of->set("driver", "AGG/PNG");
        } else {
            $of = $m->outputformat;
        }
        $of->set("imagemode", MS_IMAGEMODE_RGBA);
        $of->set("transparent", MS_ON);
        $m->save($map_file);
    }
    $protocolo = explode("/", $_SERVER['SERVER_PROTOCOL']);
    $protocolo = $protocolo[0];
    $protocolo = strtolower($protocolo) . '://' . $_SERVER['SERVER_NAME'] . ":" . $_SERVER['SERVER_PORT'];
    $urli3geo = str_replace("/classesphp/mapa_controle.php", "", $protocolo . $_SERVER["PHP_SELF"]);
    //altera o tamanho do query map para ficar igual ao do mapa
    include_once "classe_mapa.php";
    error_reporting(0);
    if (!function_exists("sobeAnno")) {
        include_once "funcoes_gerais.php";
    }
    sobeAnno($map_file);
    $m = new Mapa($map_file);
    if (isset($w)) {
        $m->mudaQS($w, $h);
        $m = new Mapa($map_file);
        $m->mapa->setsize($w, $h);
    }
    error_reporting(0);
    //
    //verifica se a legenda deve ser embebida no mapa
    //
    $legenda = $m->mapa->legend;
    $embedLegenda == "sim" ? $legenda->set("status", MS_EMBED) : $legenda->set("status", MS_OFF);
    //
    //salva as altera&ccedil;&otilde;es feitas
    //
    $m->mapa->setmetadata("ows_enable_request", "*");
    $m->salva();
    //prepara a legenda para incluir no mapa, preenchendo os nomes das classes em branco
    if (strtolower($embedLegenda) == "sim") {
        foreach ($m->layers as $l) {
            if ($l->data != "" && strtoupper($l->getmetadata("escondido")) != "SIM" && strtolower($l->getmetadata("tema")) != "nao") {
                if ($l->numclasses > 0) {
                    $classe = $l->getclass(0);
                    if ($classe->name == "" || $classe->name == " ") {
                        $classe->set("name", $l->getmetadata("tema"));
                    }
                }
            }
        }
    }
    //
    //cuidado ao mexer aqui
    //o mapa precisa ser salvo para registrar a extens&atilde;o geogr&aacute;fica
    //
    //$imgo = $m->mapa->draw();
    $imgo = $m->mapa->prepareImage();
    $m->salva($map_file);
    //$e = $m->mapa->extent;
    //$ext = ($e->minx)." ".($e->miny)." ".($e->maxx)." ".($e->maxy);
    $escalaMapa = $m->mapa->scaledenom;
    $celula = $m->mapa->cellsize;
    //
    //pega os parametros de cada tema
    //
    $qyfile = str_replace(".map", ".qy", $map_file);
    $arqsel = file_exists($qyfile) ? true : false;
    $m = new Mapa($map_file, $locaplic);
    $temas = $m->parametrosTemas();
    //$m->ligaDesligaTemas("",implode(",",$m->nomes),"nao");
    //
    //&eacute; necess&aacute;rio um mapa para compor o fundo apenas com o imagecolor e sem nenhuma outra camada
    //utilizado em algumas interfaces
    //
    /*
    $nomefundo = str_replace(".map","fundo.map",$map_file);
    $m->mapa->save($nomefundo);
    $mf = ms_newMapObj($nomefundo);
    $numlayers = $mf->numlayers;
    for($i = 0;$i < $numlayers;++$i)
    {
    	$l = $mf->getLayer($i);
    	$l->set("status",MS_DELETE);
    }
    $of = $mf->outputformat;
    $of->set("driver","GD/PNG");
    $versao = versao();
    $temp = $mf->scalebar;
    $temp->set("status",MS_OFF);
    $mf->save($nomefundo);
    */
    $versao = versao();
    $temp = $m->mapa->scalebar;
    $temp->set("status", MS_OFF);
    $of = $m->mapa->outputformat;
    $of->set("imagemode", MS_IMAGEMODE_RGBA);
    $of->setOption("QUANTIZE_FORCE", "OFF");
    $of->set("driver", "AGG/PNG");
    $m->mapa->setmetadata("interface", $interface);
    $m->salva();
    $nomes = nomeRandomico(12);
    if ($imgo->imagepath == "") {
        echo "Erro IMAGEPATH vazio";
        exit;
    }
    $nomer = $imgo->imagepath . "mapa" . $nomes . ".png";
    //$imgo->saveImage($nomer);
    if (isset($utilizacgi) && strtolower($utilizacgi) == "sim") {
        $nomer = $locmapserv . "?map=" . $map_file . "&mode=map";
    } else {
        $nomer = $imgo->imageurl . basename($nomer);
    }
    //pega a cor de fundo do mapa
    $c = $m->mapa->imagecolor;
    $cordefundo = $c->red . "," . $c->green . "," . $c->blue;
    //pega o texto de copyright
    $copyright = "";
    $lc = $m->mapa->getlayerbyname("copyright");
    if ($lc != "" && $lc->status == MS_DEFAULT) {
        if ($versao["principal"] >= 6) {
            $shape = $lc->getShape(new resultObj(0));
            $copyright = $shape->text;
        } else {
            $shape = $lc->getfeature(0, -1);
            $copyright = $shape->text;
        }
    }
    $res["editor"] = "nao";
    //
    //papeis do usuario se estiver logado
    //
    $res["papeis"] = array();
    $logado = "nao";
    $res["i3geoPermiteLogin"] = "******";
    if (isset($i3geoPermiteLogin) && $i3geoPermiteLogin == false) {
        $_COOKIE = array();
        $res["i3geoPermiteLogin"] = "******";
    }
    if (!empty($_COOKIE["i3geocodigologin"])) {
        session_write_close();
        session_name("i3GeoLogin");
        session_id($_COOKIE["i3geocodigologin"]);
        session_start();
        //var_dump($_SESSION);exit;
        $logado = "sim";
        if (!empty($_SESSION["usuario"]) && $_SESSION["usuario"] == $_COOKIE["i3geousuariologin"]) {
            $res["papeis"] = $_SESSION["papeis"];
        } else {
            $logado = "nao";
        }
        //verifica se o usuario logado pode ver as opcoes de edicao do sistema de admin dentro do mapa
        foreach ($res["papeis"] as $p) {
            if ($p < 3) {
                $res["editor"] = "sim";
            }
        }
    }
    //
    $res["mapexten"] = $ext;
    $res["mapscale"] = $escalaMapa;
    $res["mapres"] = $m->mapa->resolution;
    $res["pixelsize"] = $celula;
    //TODO depreciar na documentacao e ms_configura
    /*
    if ((isset($expoeMapfile)) && ($expoeMapfile == "nao"))
    {$res["mapfile"] = "";}
    else
    {$res["mapfile"] = $map_file;}
    */
    $res["mapfile"] = "";
    $res["cgi"] = "";
    //$locmapserv;
    $res["extentTotal"] = $ext;
    $res["mapimagem"] = "";
    //$nomer;
    $geoip = "nao";
    if (file_exists($locaplic . "/pacotes/geoip") && file_exists($locaplic . "/pacotes/geoip/GeoLiteCity.dat")) {
        $geoip = "sim";
    }
    $res["geoip"] = $geoip;
    $res["listavisual"] = file_exists($locaplic . "/imagens/visual") ? implode(",", listaDiretorios($locaplic . "/imagens/visual")) : "";
    //TODO depreciar na documentacao
    $res["utilizacgi"] = "nao";
    //$utilizacgi;
    $res["versaoms"] = $versao["principal"];
    $res["versaomscompleta"] = $versao["completa"];
    $res["mensagens"] = $m->pegaMensagens();
    $res["r"] = isset($R_path) ? "sim" : "nao";
    $res["extentref"] = "";
    $res["kmlurl"] = $kmlurl;
    $res["mensageminicia"] = $mensagemInicia;
    $res["interfacePadrao"] = $interfacePadrao;
    $res["embedLegenda"] = $embedLegenda;
    $res["w"] = $w;
    $res["h"] = $h;
    $res["titulo"] = $tituloInstituicao;
    $res["tempo"] = microtime(1) - $tempo;
    $res["embedLegenda"] = $embedLegenda;
    $res["erro"] = '';
    $res["mappath"] = "";
    //$imgo->imagepath;
    $res["mapurl"] = "";
    //$imgo->imageurl;
    $res["navegacaoDir"] = $navegadoresLocais;
    if ($openid == true) {
        $res["autenticadoopenid"] = "sim";
    } else {
        $res["autenticadoopenid"] = "nao";
    }
    $res["emailInstituicao"] = $emailInstituicao;
    $res["cordefundo"] = $cordefundo;
    $res["copyright"] = $copyright;
    $res["logado"] = $logado;
    $res["saikuUrl"] = $saikuUrl;
    $res["statusFerramentas"] = $statusFerramentas;
    $res["googleApiKey"] = $googleApiKey;
    //parametros de inicializacao armazenados com o mapa quando o usuario utiliza a opcao de salvar mapa no nbanco de dados
    $customizacoesinit = $m->mapa->getmetadata("CUSTOMIZACOESINIT");
    $res["editavel"] = $m->mapa->getmetadata("EDITAVEL");
    $m->mapa->setmetadata("CUSTOMIZACOESINIT", "");
    $m->salva();
    restauraCon($map_file, $postgis_mapa);
    copy($map_file, str_replace(".map", "reinc.map", $map_file));
    copy($map_file, str_replace(".map", "seguranca.map", $map_file));
    ob_clean();
    cpjson(array("variaveis" => $res, "temas" => $temas, "customizacoesinit" => $customizacoesinit));
}