manutencao.php
1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?php
include_once(dirname(__FILE__)."/../../admin/php/login.php");
include(dirname(__FILE__)."/../blacklist.php");
verificaBlFerramentas(basename(dirname(__FILE__)),$i3geoBlFerramentas,false);
$funcoesEdicao = array(
"REMOVETME",
"INCLUITME"
);
if(in_array(strtoupper($funcao),$funcoesEdicao)){
if(verificaOperacaoSessao("admin/html/editormapfile") == false){
retornaJSON("Vc nao pode realizar essa operacao. Tente fazer login novamente.");exit;
}
}
$tema = $_POST["tema"];
//error_reporting(0);
//
//faz a busca da função que deve ser executada
//
$retorno = ""; //string que será retornada ao browser via JSON
switch (strtoupper($funcao))
{
case "REMOVETME":
$mapa = ms_newMapObj($map_file);
$l = $mapa->getlayerbyname($tema);
if($l != ""){
$l->setmetadata("tme","");
$mapa->save($map_file);
}
$retorno = "ok";
break;
case "INCLUITME":
$mapa = ms_newMapObj($map_file);
$l = $mapa->getlayerbyname($tema);
if($l != ""){
$l->setmetadata("tme",base64_decode($_POST["tme"]));
$mapa->save($map_file);
}
$retorno = "ok";
break;
}
cpjson($retorno);
?>