Commit 86278010f4d7a67762c0f682c7e9d29a993b160e

Authored by Edmar Moretti
1 parent eb11205a

Revisão do código do sistema de administração

admin/admin.db
No preview for this file type
admin/dicionario/subirsimbolo.js 100644 → 100755
1 //+$trad(1,i3GEOF.uploadsimbolo.dicionario)+ 1 //+$trad(1,i3GEOF.uploadsimbolo.dicionario)+
2 i3GEOF.uploadsimbolo.dicionario = { 2 i3GEOF.uploadsimbolo.dicionario = {
3 'pastaArmazenamento' : [ { 3 'pastaArmazenamento' : [ {
4 - pt : "Pasta no servidor onde os dados serão armazenados (deixe em branco para usar a pasta i3geo/symbols/images). A pasta deve ter permissões adequadas para permitir o upload, consulte o administrador do sistema caso ocorra algum problema. Para facilitar, o i3Geo sugere a pasta indicada abaixo", 4 + pt : "Pasta dentro de 'i3geo' (pasta onde o i3Geo está instalado, por exemplo, 'temas') onde a imagem será armazenada. A pasta deve ter permissões adequadas para permitir o upload, consulte o administrador do sistema caso ocorra algum problema.",
5 en : "", 5 en : "",
6 es : "" 6 es : ""
7 } ], 7 } ],
admin/html/subirsimbolo.html
@@ -16,7 +16,7 @@ body { @@ -16,7 +16,7 @@ body {
16 </style> 16 </style>
17 <script type="text/javascript" src="../js/core.js"></script> 17 <script type="text/javascript" src="../js/core.js"></script>
18 <script type="text/javascript" src="../../classesjs/i3geo.js"></script> 18 <script type="text/javascript" src="../../classesjs/i3geo.js"></script>
19 -<script type="text/javascript" src="../js/subirsimbolo.js.js"></script> 19 +<script type="text/javascript" src="../js/subirsimbolo.js"></script>
20 <script type="text/javascript" src="../dicionario/subirsimbolo.js"></script> 20 <script type="text/javascript" src="../dicionario/subirsimbolo.js"></script>
21 21
22 <script type="text/javascript" src="../dicionario/core.js"></script> 22 <script type="text/javascript" src="../dicionario/core.js"></script>
admin/js/subirsimbolo.js 100644 → 100755
@@ -86,7 +86,6 @@ i3GEOF.uploadsimbolo = { @@ -86,7 +86,6 @@ i3GEOF.uploadsimbolo = {
86 ); 86 );
87 b.addClass("rodar"); 87 b.addClass("rodar");
88 //pega a pasta default 88 //pega a pasta default
89 - i3GEOF.uploadsimbolo.pegaPastaDefault();  
90 } 89 }
91 catch(erro){i3GEO.janela.tempoMsg(erro);} 90 catch(erro){i3GEO.janela.tempoMsg(erro);}
92 }, 91 },
@@ -100,7 +99,7 @@ i3GEOF.uploadsimbolo = { @@ -100,7 +99,7 @@ i3GEOF.uploadsimbolo = {
100 String com o c&oacute;digo html 99 String com o c&oacute;digo html
101 */ 100 */
102 html:function(){ 101 html:function(){
103 - var ins = '<form id=i3GEOuploadsimbolof target="i3GEOuploadsimboloiframe" action="'+i3GEO.configura.locaplic+'/ferramentas/uploadsimbolo/upload.php" method="post" ENCTYPE="multipart/form-data">' + 102 + var ins = '<form id=i3GEOuploadsimbolof target="i3GEOuploadsimboloiframe" action="../php/subirsimbolo.php" method="post" ENCTYPE="multipart/form-data">' +
104 '<p class="paragrafo" >'+$trad('escolha',i3GEOF.uploadsimbolo.dicionario)+': <br><br><input type="file" size=42 name="i3GEOuploadsimboloarq" style="top:0px;left:0px;cursor:pointer;"></p>'; 103 '<p class="paragrafo" >'+$trad('escolha',i3GEOF.uploadsimbolo.dicionario)+': <br><br><input type="file" size=42 name="i3GEOuploadsimboloarq" style="top:0px;left:0px;cursor:pointer;"></p>';
105 if(i3GEO.parametros.editor === "sim"){ 104 if(i3GEO.parametros.editor === "sim"){
106 ins += '<p class="paragrafo" >'+$trad('pastaArmazenamento',i3GEOF.uploadsimbolo.dicionario)+':</p><div class="i3geoForm i3geoFormIconeEdita" style="width:300px;" ><input class=digitar type="text" name="dirDestino" id="dirDestino" ></div>'; 105 ins += '<p class="paragrafo" >'+$trad('pastaArmazenamento',i3GEOF.uploadsimbolo.dicionario)+':</p><div class="i3geoForm i3geoFormIconeEdita" style="width:300px;" ><input class=digitar type="text" name="dirDestino" id="dirDestino" ></div>';
@@ -161,16 +160,6 @@ i3GEOF.uploadsimbolo = { @@ -161,16 +160,6 @@ i3GEOF.uploadsimbolo = {
161 i3GEOF.uploadsimbolo.aguarde.visibility="visible"; 160 i3GEOF.uploadsimbolo.aguarde.visibility="visible";
162 $i("i3GEOuploadsimbolof").submit(); 161 $i("i3GEOuploadsimbolof").submit();
163 }, 162 },
164 - pegaPastaDefault: function(){  
165 - var fim, p;  
166 - fim = function(retorno){  
167 - $i("dirDestino").value = retorno.data;  
168 - };  
169 - p = i3GEO.configura.locaplic+"/ferramentas/uploadsimbolo/exec.php?funcao=NOMEPASTA";  
170 - cp = new cpaint();  
171 - cp.set_response_type("JSON");  
172 - cp.call(p,"foo",fim);  
173 - },  
174 selNavegador: function(onde){ 163 selNavegador: function(onde){
175 i3GEO.util.navegadorDir(onde,false,false,false); 164 i3GEO.util.navegadorDir(onde,false,false,false);
176 } 165 }
admin/php/identifica.php
@@ -50,6 +50,11 @@ if(in_array(strtoupper($funcao),$funcoesEdicao)){ @@ -50,6 +50,11 @@ if(in_array(strtoupper($funcao),$funcoesEdicao)){
50 retornaJSON("Vc nao pode realizar essa operacao.");exit; 50 retornaJSON("Vc nao pode realizar essa operacao.");exit;
51 } 51 }
52 } 52 }
  53 +
  54 +$id_i = $_GET["id_i"];
  55 +$id = $_GET["id"];
  56 +testaSafeNumerico([$id_i,$id]);
  57 +
53 error_reporting(0); 58 error_reporting(0);
54 //faz a busca da fun&ccedil;&atilde;o que deve ser executada 59 //faz a busca da fun&ccedil;&atilde;o que deve ser executada
55 switch (strtoupper($funcao)) 60 switch (strtoupper($funcao))
@@ -127,19 +132,19 @@ switch (strtoupper($funcao)) @@ -127,19 +132,19 @@ switch (strtoupper($funcao))
127 Altera o registro de um WS 132 Altera o registro de um WS
128 */ 133 */
129 function alterarFuncoes(){ 134 function alterarFuncoes(){
130 - global $id_i,$abrir_i,$nome_i,$target_i,$publicado_i,$esquemaadmin; 135 + global $id_i,$esquemaadmin;
131 try{ 136 try{
132 //$nome_i = mb_convert_encoding($nome_i,"UTF-8","ISO-8859-1"); 137 //$nome_i = mb_convert_encoding($nome_i,"UTF-8","ISO-8859-1");
133 require_once("conexao.php"); 138 require_once("conexao.php");
134 if($convUTF){ 139 if($convUTF){
135 - $nome_i = utf8_encode($nome_i); 140 + $_GET["nome_i"] = utf8_encode($_GET["nome_i"]);
136 } 141 }
137 if($id_i != ""){ 142 if($id_i != ""){
138 $dataCol = array( 143 $dataCol = array(
139 - "publicado_i" => $publicado_i,  
140 - "nome_i" => $nome_i,  
141 - "abrir_i" => $abrir_i,  
142 - "target_i" => $target_i 144 + "publicado_i" => $_GET["publicado_i"],
  145 + "nome_i" => $_GET["nome_i"],
  146 + "abrir_i" => $_GET["abrir_i"],
  147 + "target_i" => $_GET["target_i"]
143 ); 148 );
144 i3GeoAdminUpdate($dbhw,"i3geoadmin_identifica",$dataCol,"WHERE id_i = $id_i"); 149 i3GeoAdminUpdate($dbhw,"i3geoadmin_identifica",$dataCol,"WHERE id_i = $id_i");
145 $retorna = $id_i; 150 $retorna = $id_i;
admin/php/mapas.php
@@ -39,7 +39,6 @@ O par&amp;acirc;metro principal &amp;eacute; &quot;funcao&quot;, que define qual opera&amp;ccedil;&amp;ati @@ -39,7 +39,6 @@ O par&amp;acirc;metro principal &amp;eacute; &quot;funcao&quot;, que define qual opera&amp;ccedil;&amp;ati
39 Cada opera&ccedil;&atilde;o possu&iacute; seus pr&oacute;prios par&acirc;metros, que devem ser enviados tamb&eacute;m na requisi&ccedil;&atilde;o da opera&ccedil;&atilde;o. 39 Cada opera&ccedil;&atilde;o possu&iacute; seus pr&oacute;prios par&acirc;metros, que devem ser enviados tamb&eacute;m na requisi&ccedil;&atilde;o da opera&ccedil;&atilde;o.
40 40
41 */ 41 */
42 -  
43 include_once(dirname(__FILE__)."/login.php"); 42 include_once(dirname(__FILE__)."/login.php");
44 $funcoesEdicao = array( 43 $funcoesEdicao = array(
45 "ALTERARMAPA", 44 "ALTERARMAPA",
@@ -51,6 +50,11 @@ if(in_array(strtoupper($funcao),$funcoesEdicao)){ @@ -51,6 +50,11 @@ if(in_array(strtoupper($funcao),$funcoesEdicao)){
51 retornaJSON("Vc nao pode realizar essa operacao. Tente fazer login novamente.");exit; 50 retornaJSON("Vc nao pode realizar essa operacao. Tente fazer login novamente.");exit;
52 } 51 }
53 } 52 }
  53 +$id = $_GET["id"];
  54 +$id_mapa = $_GET["id_mapa"];
  55 +testaSafeNumerico([$id,$id_mapa]);
  56 +
  57 +
54 error_reporting(0); 58 error_reporting(0);
55 //faz a busca da fun&ccedil;&atilde;o que deve ser executada 59 //faz a busca da fun&ccedil;&atilde;o que deve ser executada
56 switch (strtoupper($funcao)) 60 switch (strtoupper($funcao))
@@ -174,7 +178,7 @@ switch (strtoupper($funcao)) @@ -174,7 +178,7 @@ switch (strtoupper($funcao))
174 break; 178 break;
175 } 179 }
176 function salvaMapfile(){ 180 function salvaMapfile(){
177 - global $esquemaadmin,$nome_mapa,$arqmapfile,$url,$id_mapa,$preferenciasbase64,$geometriasbase64,$graficosbase64,$tabelasbase64,$ext; 181 + global $esquemaadmin,$id_mapa;
178 //as preferencias sao criadas via javascript e guardadas junto com o mapa 182 //as preferencias sao criadas via javascript e guardadas junto com o mapa
179 try{ 183 try{
180 // 184 //
@@ -186,24 +190,24 @@ function salvaMapfile(){ @@ -186,24 +190,24 @@ function salvaMapfile(){
186 //o parser para reconstruir os valores e feito em javascript, no cliente 190 //o parser para reconstruir os valores e feito em javascript, no cliente
187 // 191 //
188 $customizacoesinit = array(); 192 $customizacoesinit = array();
189 - if(isset($preferenciasbase64) || isset($geometriasbase64) || isset($graficosbase64) || isset($tabelasbase64)){  
190 - $customizacoesinit[] = '"preferenciasbase64":"'.$preferenciasbase64.'"';  
191 - $customizacoesinit[] = '"geometriasbase64":"'.$geometriasbase64.'"';  
192 - $customizacoesinit[] = '"graficosbase64":"'.$graficosbase64.'"';  
193 - $customizacoesinit[] = '"tabelasbase64":"'.$tabelasbase64.'"';  
194 - $m = ms_newMapObj($arqmapfile); 193 + if(isset($_GET["preferenciasbase64"]) || isset($_GET["geometriasbase64"]) || isset($_GET["graficosbase64"]) || isset($_GET["tabelasbase64"])){
  194 + $customizacoesinit[] = '"preferenciasbase64":"'.$_GET["preferenciasbase64"].'"';
  195 + $customizacoesinit[] = '"geometriasbase64":"'.$_GET["geometriasbase64"].'"';
  196 + $customizacoesinit[] = '"graficosbase64":"'.$_GET["graficosbase64"].'"';
  197 + $customizacoesinit[] = '"tabelasbase64":"'.$_GET["tabelasbase64"].'"';
  198 + $m = ms_newMapObj($_GET["arqmapfile"]);
195 $m->setmetadata("CUSTOMIZACOESINIT",'{'.implode(",",$customizacoesinit).'}'); 199 $m->setmetadata("CUSTOMIZACOESINIT",'{'.implode(",",$customizacoesinit).'}');
196 - $m->save($arqmapfile); 200 + $m->save($_GET["arqmapfile"]);
197 } 201 }
198 - if($ext && $ext != ""){  
199 - $e = explode(" ",$ext);  
200 - $m = ms_newMapObj($arqmapfile); 202 + if($_GET["ext"] && $_GET["ext"] != ""){
  203 + $e = explode(" ",$_GET["ext"]);
  204 + $m = ms_newMapObj($_GET["arqmapfile"]);
201 $extatual = $m->extent; 205 $extatual = $m->extent;
202 $extatual->setextent((min($e[0],$e[2])),(min($e[1],$e[3])),(max($e[0],$e[2])),(max($e[1],$e[3]))); 206 $extatual->setextent((min($e[0],$e[2])),(min($e[1],$e[3])),(max($e[0],$e[2])),(max($e[1],$e[3])));
203 - $m->save($arqmapfile); 207 + $m->save($_GET["arqmapfile"]);
204 } 208 }
205 - $handle = fopen ($arqmapfile, 'r');  
206 - $conteudo = fread ($handle, filesize ($arqmapfile)); 209 + $handle = fopen ($_GET["arqmapfile"], 'r');
  210 + $conteudo = fread ($handle, filesize ($_GET["arqmapfile"]));
207 fclose ($handle); 211 fclose ($handle);
208 $conteudo = base64_encode($conteudo); 212 $conteudo = base64_encode($conteudo);
209 if($conteudo == false){ 213 if($conteudo == false){
@@ -211,7 +215,7 @@ function salvaMapfile(){ @@ -211,7 +215,7 @@ function salvaMapfile(){
211 } 215 }
212 require_once("conexao.php"); 216 require_once("conexao.php");
213 if($convUTF){ 217 if($convUTF){
214 - $nome_mapa = utf8_encode($nome_mapa); 218 + $_GET["nome_mapa"] = utf8_encode($_GET["nome_mapa"]);
215 } 219 }
216 $retorna = ""; 220 $retorna = "";
217 if(empty($id_mapa)){ 221 if(empty($id_mapa)){
@@ -236,8 +240,8 @@ function salvaMapfile(){ @@ -236,8 +240,8 @@ function salvaMapfile(){
236 $dataCol = array( 240 $dataCol = array(
237 "mapfile" => $conteudo, 241 "mapfile" => $conteudo,
238 "publicado_mapa" => "sim", 242 "publicado_mapa" => "sim",
239 - "nome_mapa" => $nome_mapa,  
240 - "outros_mapa" => "&restauramapa=$id&interface=$url" 243 + "nome_mapa" => $_GET["nome_mapa"],
  244 + "outros_mapa" => "&restauramapa=$id&interface=".$_GET["url"]
241 ); 245 );
242 i3GeoAdminUpdate($dbhw,"i3geoadmin_mapas",$dataCol, "WHERE id_mapa =".$id); 246 i3GeoAdminUpdate($dbhw,"i3geoadmin_mapas",$dataCol, "WHERE id_mapa =".$id);
243 $dbhw = null; 247 $dbhw = null;
@@ -252,29 +256,29 @@ function salvaMapfile(){ @@ -252,29 +256,29 @@ function salvaMapfile(){
252 Altera o registro de um mapa 256 Altera o registro de um mapa
253 */ 257 */
254 function alterarMapa(){ 258 function alterarMapa(){
255 - global $esquemaadmin,$publicado_mapa,$ordem_mapa,$id_mapa,$desc_mapa,$ext_mapa,$imagem_mapa,$outros_mapa,$nome_mapa,$linkdireto_mapa,$temas_mapa,$ligados_mapa,$perfil_mapa; 259 + global $esquemaadmin,$id_mapa;
256 //substitui a string do parametro outros 260 //substitui a string do parametro outros
257 - $outros_mapa = str_replace("*","&",$outros_mapa); 261 + $_GET["outros_mapa"] = str_replace("*","&",$_GET["outros_mapa"]);
258 try{ 262 try{
259 require_once("conexao.php"); 263 require_once("conexao.php");
260 if($convUTF){ 264 if($convUTF){
261 - $nome_mapa = utf8_encode($nome_mapa);  
262 - $desc_mapa = utf8_encode($desc_mapa); 265 + $_GET["nome_mapa"] = utf8_encode($_GET["nome_mapa"]);
  266 + $_GET["desc_mapa"] = utf8_encode($_GET["desc_mapa"]);
263 } 267 }
264 $retorna = ""; 268 $retorna = "";
265 if($id_mapa != ""){ 269 if($id_mapa != ""){
266 $dataCol = array( 270 $dataCol = array(
267 - "publicado_mapa" => $publicado_mapa,  
268 - "ordem_mapa" => $ordem_mapa,  
269 - "desc_mapa" => $desc_mapa,  
270 - "ext_mapa" => $ext_mapa,  
271 - "imagem_mapa" => $imagem_mapa,  
272 - "outros_mapa" => $outros_mapa,  
273 - "nome_mapa" => $nome_mapa,  
274 - "linkdireto_mapa" => $linkdireto_mapa,  
275 - "temas_mapa" => $temas_mapa,  
276 - "ligados_mapa" => $ligados_mapa,  
277 - "perfil_mapa" => $perfil_mapa 271 + "publicado_mapa" => $_GET["publicado_mapa"],
  272 + "ordem_mapa" => $_GET["ordem_mapa"],
  273 + "desc_mapa" => $_GET["desc_mapa"],
  274 + "ext_mapa" => $_GET["ext_mapa"],
  275 + "imagem_mapa" => $_GET["imagem_mapa"],
  276 + "outros_mapa" => $_GET["outros_mapa"],
  277 + "nome_mapa" => $_GET["nome_mapa"],
  278 + "linkdireto_mapa" => $_GET["linkdireto_mapa"],
  279 + "temas_mapa" => $_GET["temas_mapa"],
  280 + "ligados_mapa" => $_GET["ligados_mapa"],
  281 + "perfil_mapa" => $_GET["perfil_mapa"]
278 ); 282 );
279 i3GeoAdminUpdate($dbhw,"i3geoadmin_mapas",$dataCol, "WHERE id_mapa =".$id_mapa); 283 i3GeoAdminUpdate($dbhw,"i3geoadmin_mapas",$dataCol, "WHERE id_mapa =".$id_mapa);
280 $retorna = $id_mapa; 284 $retorna = $id_mapa;
admin/php/sistemas.php
@@ -240,7 +240,7 @@ function alterarSistemas(){ @@ -240,7 +240,7 @@ function alterarSistemas(){
240 try { 240 try {
241 require_once("conexao.php"); 241 require_once("conexao.php");
242 if($convUTF){ 242 if($convUTF){
243 - $_GET["nome_sistema"] = utf8_encode($_GET["$nome_sistema"]); 243 + $_GET["nome_sistema"] = utf8_encode($_GET["nome_sistema"]);
244 } 244 }
245 if($id_sistema != ""){ 245 if($id_sistema != ""){
246 $dataCol = array( 246 $dataCol = array(
admin/php/subirsimbolo.php 100644 → 100755
1 <?php 1 <?php
2 -//  
3 -//caso o usu&aacute;rio seja um administrador, ele pode enviar um nome de diret&oacute;rio onde os arquivos ser&atilde;o armazenados  
4 -//na vari&aacute;vel $dirDestino  
5 -//  
6 -require_once(dirname(__FILE__)."/../../classesphp/funcoes_gerais.php");  
7 -include_once (dirname(__FILE__)."/../../classesphp/carrega_ext.php");  
8 -error_reporting(0);  
9 -if (ob_get_level() == 0) ob_start(); 2 +include_once(dirname(__FILE__)."/login.php");
  3 +
  4 +if(in_array(strtoupper($funcao),$funcoesEdicao)){
  5 + if(verificaOperacaoSessao("admin/html/editortexto") == false){
  6 + retornaJSON("Vc nao pode realizar essa operacao.");exit;
  7 + }
  8 +}
  9 +//locaplic e usado para definir a pasta de destino
  10 +if(empty($locaplic)){
  11 + exit;
  12 +}
10 ?> 13 ?>
11 <html> 14 <html>
12 <head> 15 <head>
@@ -19,14 +22,16 @@ if (ob_get_level() == 0) ob_start(); @@ -19,14 +22,16 @@ if (ob_get_level() == 0) ob_start();
19 <p> 22 <p>
20 <?php 23 <?php
21 if (isset($_FILES['i3GEOuploadsimboloarq']['name']) && strlen(basename($_FILES['i3GEOuploadsimboloarq']['name'])) < 200){ 24 if (isset($_FILES['i3GEOuploadsimboloarq']['name']) && strlen(basename($_FILES['i3GEOuploadsimboloarq']['name'])) < 200){
  25 + $dirDestino = $_GET["dirDestino"];
  26 + $dirDestino = str_replace(".","",$dirDestino);
  27 + $dirDestino = $locaplic."/".$dirDestino;
22 28
23 - $checkphp = fileContemString($_FILES['i3GEOuploadsimboloarq']['tmp_name'],"<?"); 29 + $checkphp = fileContemString($_FILES['i3GEOuploadsimboloarq']['tmp_name'],"<?php");
24 if($checkphp == true){ 30 if($checkphp == true){
  31 + echo "Arquivo invalido";
25 exit; 32 exit;
26 } 33 }
27 34
28 - require_once (dirname(__FILE__)."/../../ms_configura.php");  
29 -  
30 if(isset($logExec) && $logExec["upload"] == true){ 35 if(isset($logExec) && $logExec["upload"] == true){
31 i3GeoLog("prog: uploadsimbolo filename:" . $_FILES['i3GEOuploadsimboloarq']['name'],$dir_tmp); 36 i3GeoLog("prog: uploadsimbolo filename:" . $_FILES['i3GEOuploadsimboloarq']['name'],$dir_tmp);
32 } 37 }
@@ -35,22 +40,16 @@ if (isset($_FILES[&#39;i3GEOuploadsimboloarq&#39;][&#39;name&#39;]) &amp;&amp; strlen(basename($_FILES[&#39; @@ -35,22 +40,16 @@ if (isset($_FILES[&#39;i3GEOuploadsimboloarq&#39;][&#39;name&#39;]) &amp;&amp; strlen(basename($_FILES[&#39;
35 ob_flush(); 40 ob_flush();
36 flush(); 41 flush();
37 sleep(1); 42 sleep(1);
38 - include_once(dirname(__FILE__)."/../../admin/php/login.php");  
39 - if(verificaOperacaoSessao("admin/php/editortexto") == false){  
40 - echo "Vc nao pode salvar os dados no servidor em uma pasta espec&iacute;fica";exit;  
41 - }  
42 - if(!isset($dirDestino) || $dirDestino == ""){  
43 - $dirDestino = $locaplic."/symbols/images";  
44 - } 43 +
45 if(!file_exists($dirDestino)){ 44 if(!file_exists($dirDestino)){
46 - $dirDestino = dirname($locaplic)."/".$dirDestino;  
47 if(!file_exists($dirDestino)){ 45 if(!file_exists($dirDestino)){
48 - echo "<p class='paragrafo' >Pasta n&atilde;o existe no servidor";paraAguarde();exit; 46 + echo "<p class='paragrafo' >Pasta n&atilde;o existe no servidor";
  47 + paraAguarde();
  48 + exit;
49 } 49 }
50 } 50 }
51 //verifica nomes 51 //verifica nomes
52 -  
53 - $nome = basename($_FILES['i3GEOuploadsimboloarq']['name']); 52 + $nome = $_FILES['i3GEOuploadsimboloarq']['name'];
54 53
55 $nome = str_replace(".png","",$nome); 54 $nome = str_replace(".png","",$nome);
56 $nome = str_replace(".","",$nome).".png"; 55 $nome = str_replace(".","",$nome).".png";
@@ -58,7 +57,7 @@ if (isset($_FILES[&#39;i3GEOuploadsimboloarq&#39;][&#39;name&#39;]) &amp;&amp; strlen(basename($_FILES[&#39; @@ -58,7 +57,7 @@ if (isset($_FILES[&#39;i3GEOuploadsimboloarq&#39;][&#39;name&#39;]) &amp;&amp; strlen(basename($_FILES[&#39;
58 $nome = strip_tags($nome); 57 $nome = strip_tags($nome);
59 $nome = htmlspecialchars($nome, ENT_QUOTES); 58 $nome = htmlspecialchars($nome, ENT_QUOTES);
60 59
61 - $nome = $nome . md5(uniqid(rand(), true)); 60 + //$nome = $nome . md5(uniqid(rand(), true));
62 61
63 verificaNome($nome); 62 verificaNome($nome);
64 //sobe arquivo 63 //sobe arquivo
admin/php/webservices.php
@@ -48,7 +48,7 @@ include_once(dirname(__FILE__).&quot;/login.php&quot;); @@ -48,7 +48,7 @@ include_once(dirname(__FILE__).&quot;/login.php&quot;);
48 $id_ws = $_GET["id_ws"]; 48 $id_ws = $_GET["id_ws"];
49 $id = $_GET["id"]; 49 $id = $_GET["id"];
50 50
51 -testaSafeNumerico([$id]); 51 +testaSafeNumerico([$id,$id_ws]);
52 52
53 $funcoesEdicao = array( 53 $funcoesEdicao = array(
54 "ALTERARWS", 54 "ALTERARWS",
admin1/cadastros/identifica/exec.php
@@ -40,10 +40,15 @@ if (in_array ( strtoupper ( $funcao ), $funcoesEdicao )) { @@ -40,10 +40,15 @@ if (in_array ( strtoupper ( $funcao ), $funcoesEdicao )) {
40 } 40 }
41 } 41 }
42 include (dirname ( __FILE__ ) . "/../../../admin/php/conexao.php"); 42 include (dirname ( __FILE__ ) . "/../../../admin/php/conexao.php");
  43 +
  44 +$id_i = $_POST["id_i"];
  45 +$id = $_POST["id"];
  46 +testaSafeNumerico([$id_i,$id]);
  47 +
43 $funcao = strtoupper ( $funcao ); 48 $funcao = strtoupper ( $funcao );
44 switch ($funcao) { 49 switch ($funcao) {
45 case "ADICIONAR" : 50 case "ADICIONAR" :
46 - $novo = adicionar( $publicado_i, $abrir_i, $nome_i, $target_i, $dbhw ); 51 + $novo = adicionar( $_POST["publicado_i"], $_POST["abrir_i"], $_POST["nome_i"], $_POST["target_i"], $dbhw );
47 if ($novo === false) { 52 if ($novo === false) {
48 header ( "HTTP/1.1 500 erro ao consultar banco de dados" ); 53 header ( "HTTP/1.1 500 erro ao consultar banco de dados" );
49 exit (); 54 exit ();
@@ -51,7 +56,7 @@ switch ($funcao) { @@ -51,7 +56,7 @@ switch ($funcao) {
51 exit (); 56 exit ();
52 break; 57 break;
53 case "ALTERAR" : 58 case "ALTERAR" :
54 - $novo = alterar ( $id_i, $publicado_i, $abrir_i, $nome_i, $target_i, $dbhw ); 59 + $novo = alterar ( $id_i, $_POST["publicado_i"], $_POST["abrir_i"], $_POST["nome_i"], $_POST["target_i"], $dbhw );
55 if ($novo === false) { 60 if ($novo === false) {
56 header ( "HTTP/1.1 500 erro ao consultar banco de dados" ); 61 header ( "HTTP/1.1 500 erro ao consultar banco de dados" );
57 exit (); 62 exit ();
admin1/cadastros/identifica/index.js
@@ -196,7 +196,7 @@ Obt&amp;eacute;m a lista de Identifica @@ -196,7 +196,7 @@ Obt&amp;eacute;m a lista de Identifica
196 salvarDialogo: function(id_i){ 196 salvarDialogo: function(id_i){
197 var hash = { 197 var hash = {
198 "mensagem": i3GEOadmin.identifica.dicionario.confirma, 198 "mensagem": i3GEOadmin.identifica.dicionario.confirma,
199 - "onBotao1": "i3GEOadmin.identifica.salvarIdentifica('"+id_i+"')", 199 + "onBotao1": "i3GEOadmin.identifica.salvar('"+id_i+"')",
200 "botao1": i3GEOadmin.identifica.dicionario.sim, 200 "botao1": i3GEOadmin.identifica.dicionario.sim,
201 "onBotao2": "i3GEOadmin.core.fechaModalConfirma();", 201 "onBotao2": "i3GEOadmin.core.fechaModalConfirma();",
202 "botao2": i3GEOadmin.identifica.dicionario.nao 202 "botao2": i3GEOadmin.identifica.dicionario.nao
admin1/cadastros/perfis/exec.php
@@ -23,9 +23,6 @@ @@ -23,9 +23,6 @@
23 * 59 Temple Street, Suite 330, Boston, MA 02111-1307 USA. 23 * 59 Temple Street, Suite 330, Boston, MA 02111-1307 USA.
24 */ 24 */
25 error_reporting ( 0 ); 25 error_reporting ( 0 );
26 -//  
27 -// pega as variaveis passadas com get ou post  
28 -//  
29 26
30 include_once (dirname ( __FILE__ ) . "/../../../admin/php/login.php"); 27 include_once (dirname ( __FILE__ ) . "/../../../admin/php/login.php");
31 $funcoesEdicao = array ( 28 $funcoesEdicao = array (
@@ -45,6 +42,10 @@ if(!isset($idioma) || $idioma == &quot;&quot;){ @@ -45,6 +42,10 @@ if(!isset($idioma) || $idioma == &quot;&quot;){
45 } 42 }
46 //remove espaco em branco do nome do perfil 43 //remove espaco em branco do nome do perfil
47 $perfil = str_replace(" ","",$perfil); 44 $perfil = str_replace(" ","",$perfil);
  45 +
  46 +$id_perfil = $_POST["id_perfil"];
  47 +testaSafeNumerico([$id_perfil]);
  48 +
48 $funcao = strtoupper ( $funcao ); 49 $funcao = strtoupper ( $funcao );
49 switch ($funcao) { 50 switch ($funcao) {
50 case "ADICIONAR" : 51 case "ADICIONAR" :
@@ -128,7 +129,7 @@ function alterar($id_perfil, $perfil,$dbhw) { @@ -128,7 +129,7 @@ function alterar($id_perfil, $perfil,$dbhw) {
128 return false; 129 return false;
129 } 130 }
130 131
131 - $q = $dbhw->query("select * from ".$esquemaadmin."i3geoadmin_mapas"); 132 + $q = $dbhw->query("select * from ".$esquemaadmin."i3geoadmin_mapas WHERE perfil_mapa != ''");
132 foreach($q as $row){ 133 foreach($q as $row){
133 $t = $row['perfil_mapa']; 134 $t = $row['perfil_mapa'];
134 $i = $row['id_mapa']; 135 $i = $row['id_mapa'];
@@ -140,7 +141,7 @@ function alterar($id_perfil, $perfil,$dbhw) { @@ -140,7 +141,7 @@ function alterar($id_perfil, $perfil,$dbhw) {
140 i3GeoAdminUpdate($dbhw,"i3geoadmin_mapas",$dataCol,"WHERE id_mapa = $i"); 141 i3GeoAdminUpdate($dbhw,"i3geoadmin_mapas",$dataCol,"WHERE id_mapa = $i");
141 } 142 }
142 } 143 }
143 - $q = $dbhw->query("select * from ".$esquemaadmin."i3geoadmin_menus"); 144 + $q = $dbhw->query("select * from ".$esquemaadmin."i3geoadmin_menus WHERE perfil_menu != ''");
144 foreach($q as $row){ 145 foreach($q as $row){
145 $t = $row['perfil_menu']; 146 $t = $row['perfil_menu'];
146 $i = $row['id_menu']; 147 $i = $row['id_menu'];
@@ -152,7 +153,7 @@ function alterar($id_perfil, $perfil,$dbhw) { @@ -152,7 +153,7 @@ function alterar($id_perfil, $perfil,$dbhw) {
152 i3GeoAdminUpdate($dbhw,"i3geoadmin_menus",$dataCol,"WHERE id_menu = $i"); 153 i3GeoAdminUpdate($dbhw,"i3geoadmin_menus",$dataCol,"WHERE id_menu = $i");
153 } 154 }
154 } 155 }
155 - $q = $dbhw->query("select * from ".$esquemaadmin."i3geoadmin_n1"); 156 + $q = $dbhw->query("select * from ".$esquemaadmin."i3geoadmin_n1 WHERE n1_perfil != ''");
156 foreach($q as $row){ 157 foreach($q as $row){
157 $t = $row['n1_perfil']; 158 $t = $row['n1_perfil'];
158 $i = $row['id_n1']; 159 $i = $row['id_n1'];
@@ -164,7 +165,7 @@ function alterar($id_perfil, $perfil,$dbhw) { @@ -164,7 +165,7 @@ function alterar($id_perfil, $perfil,$dbhw) {
164 i3GeoAdminUpdate($dbhw,"i3geoadmin_n1",$dataCol,"WHERE id_n1 = $i"); 165 i3GeoAdminUpdate($dbhw,"i3geoadmin_n1",$dataCol,"WHERE id_n1 = $i");
165 } 166 }
166 } 167 }
167 - $q = $dbhw->query("select * from ".$esquemaadmin."i3geoadmin_n2"); 168 + $q = $dbhw->query("select * from ".$esquemaadmin."i3geoadmin_n2 WHERE n2_perfil != ''");
168 foreach($q as $row){ 169 foreach($q as $row){
169 $t = $row['n2_perfil']; 170 $t = $row['n2_perfil'];
170 $i = $row['id_n2']; 171 $i = $row['id_n2'];
@@ -176,7 +177,7 @@ function alterar($id_perfil, $perfil,$dbhw) { @@ -176,7 +177,7 @@ function alterar($id_perfil, $perfil,$dbhw) {
176 i3GeoAdminUpdate($dbhw,"i3geoadmin_n2",$dataCol,"WHERE id_n2 = $i"); 177 i3GeoAdminUpdate($dbhw,"i3geoadmin_n2",$dataCol,"WHERE id_n2 = $i");
177 } 178 }
178 } 179 }
179 - $q = $dbhw->query("select * from ".$esquemaadmin."i3geoadmin_n3"); 180 + $q = $dbhw->query("select * from ".$esquemaadmin."i3geoadmin_n3 WHERE n3_perfil != ''");
180 foreach($q as $row){ 181 foreach($q as $row){
181 $t = $row['n3_perfil']; 182 $t = $row['n3_perfil'];
182 $i = $row['id_n3']; 183 $i = $row['id_n3'];
@@ -188,7 +189,7 @@ function alterar($id_perfil, $perfil,$dbhw) { @@ -188,7 +189,7 @@ function alterar($id_perfil, $perfil,$dbhw) {
188 i3GeoAdminUpdate($dbhw,"i3geoadmin_n3",$dataCol,"WHERE id_n3 = $i"); 189 i3GeoAdminUpdate($dbhw,"i3geoadmin_n3",$dataCol,"WHERE id_n3 = $i");
189 } 190 }
190 } 191 }
191 - $q = $dbhw->query("select * from ".$esquemaadmin."i3geoadmin_raiz"); 192 + $q = $dbhw->query("select * from ".$esquemaadmin."i3geoadmin_raiz WHERE perfil != ''");
192 foreach($q as $row){ 193 foreach($q as $row){
193 $t = $row['perfil']; 194 $t = $row['perfil'];
194 $i = $row['id_raiz']; 195 $i = $row['id_raiz'];
@@ -200,7 +201,7 @@ function alterar($id_perfil, $perfil,$dbhw) { @@ -200,7 +201,7 @@ function alterar($id_perfil, $perfil,$dbhw) {
200 i3GeoAdminUpdate($dbhw,"i3geoadmin_raiz",$dataCol,"WHERE id_raiz = $i"); 201 i3GeoAdminUpdate($dbhw,"i3geoadmin_raiz",$dataCol,"WHERE id_raiz = $i");
201 } 202 }
202 } 203 }
203 - $q = $dbhw->query("select * from ".$esquemaadmin."i3geoadmin_sistemas"); 204 + $q = $dbhw->query("select * from ".$esquemaadmin."i3geoadmin_sistemas WHERE perfil_sistema != ''");
204 foreach($q as $row) 205 foreach($q as $row)
205 { 206 {
206 $t = $row['perfil_sistema']; 207 $t = $row['perfil_sistema'];
@@ -213,7 +214,7 @@ function alterar($id_perfil, $perfil,$dbhw) { @@ -213,7 +214,7 @@ function alterar($id_perfil, $perfil,$dbhw) {
213 i3GeoAdminUpdate($dbhw,"i3geoadmin_sistemas",$dataCol,"WHERE id_sistema = $i"); 214 i3GeoAdminUpdate($dbhw,"i3geoadmin_sistemas",$dataCol,"WHERE id_sistema = $i");
214 } 215 }
215 } 216 }
216 - $q = $dbhw->query("select * from ".$esquemaadmin."i3geoadmin_sistemasf"); 217 + $q = $dbhw->query("select * from ".$esquemaadmin."i3geoadmin_sistemasf WHERE perfil_funcao != ''");
217 foreach($q as $row){ 218 foreach($q as $row){
218 $t = $row['perfil_funcao']; 219 $t = $row['perfil_funcao'];
219 $i = $row['id_funcao']; 220 $i = $row['id_funcao'];
@@ -263,36 +264,36 @@ function excluir($id_perfil, $dbhw) { @@ -263,36 +264,36 @@ function excluir($id_perfil, $dbhw) {
263 } 264 }
264 $q = $dbhw->query("select * from ".$esquemaadmin."i3geoadmin_n1"); 265 $q = $dbhw->query("select * from ".$esquemaadmin."i3geoadmin_n1");
265 foreach($q as $row){ 266 foreach($q as $row){
266 - $t = $row['perfil_n1']; 267 + $t = $row['n1_perfil'];
267 $i = $row['id_n1']; 268 $i = $row['id_n1'];
268 $ts = trim(str_replace(" ".$perfil." ",""," ".$t." ")); 269 $ts = trim(str_replace(" ".$perfil." ",""," ".$t." "));
269 if($t != $ts){ 270 if($t != $ts){
270 $dataCol = array( 271 $dataCol = array(
271 - "perfil_n1" => $ts 272 + "n1_perfil" => $ts
272 ); 273 );
273 i3GeoAdminUpdate($dbhw,"i3geoadmin_n1",$dataCol,"WHERE id_n1 = $i"); 274 i3GeoAdminUpdate($dbhw,"i3geoadmin_n1",$dataCol,"WHERE id_n1 = $i");
274 } 275 }
275 } 276 }
276 $q = $dbhw->query("select * from ".$esquemaadmin."i3geoadmin_n2"); 277 $q = $dbhw->query("select * from ".$esquemaadmin."i3geoadmin_n2");
277 foreach($q as $row){ 278 foreach($q as $row){
278 - $t = $row['perfil_n2']; 279 + $t = $row['n2_perfil'];
279 $i = $row['id_n2']; 280 $i = $row['id_n2'];
280 $ts = trim(str_replace(" ".$perfil." ",""," ".$t." ")); 281 $ts = trim(str_replace(" ".$perfil." ",""," ".$t." "));
281 if($t != $ts){ 282 if($t != $ts){
282 $dataCol = array( 283 $dataCol = array(
283 - "perfil_n2" => $ts 284 + "n2_perfil" => $ts
284 ); 285 );
285 i3GeoAdminUpdate($dbhw,"i3geoadmin_n2",$dataCol,"WHERE id_n2 = $i"); 286 i3GeoAdminUpdate($dbhw,"i3geoadmin_n2",$dataCol,"WHERE id_n2 = $i");
286 } 287 }
287 } 288 }
288 $q = $dbhw->query("select * from ".$esquemaadmin."i3geoadmin_n3"); 289 $q = $dbhw->query("select * from ".$esquemaadmin."i3geoadmin_n3");
289 foreach($q as $row){ 290 foreach($q as $row){
290 - $t = $row['perfil_n3']; 291 + $t = $row['n2_perfil'];
291 $i = $row['id_n3']; 292 $i = $row['id_n3'];
292 $ts = trim(str_replace(" ".$perfil." ",""," ".$t." ")); 293 $ts = trim(str_replace(" ".$perfil." ",""," ".$t." "));
293 if($t != $ts){ 294 if($t != $ts){
294 $dataCol = array( 295 $dataCol = array(
295 - "perfil_n3" => $ts 296 + "n2_perfil" => $ts
296 ); 297 );
297 i3GeoAdminUpdate($dbhw,"i3geoadmin_n3",$dataCol,"WHERE id_n3 = $i"); 298 i3GeoAdminUpdate($dbhw,"i3geoadmin_n3",$dataCol,"WHERE id_n3 = $i");
298 } 299 }
admin1/cadastros/servicos/exec.php
@@ -23,10 +23,6 @@ @@ -23,10 +23,6 @@
23 * 59 Temple Street, Suite 330, Boston, MA 02111-1307 USA. 23 * 59 Temple Street, Suite 330, Boston, MA 02111-1307 USA.
24 */ 24 */
25 error_reporting ( 0 ); 25 error_reporting ( 0 );
26 -//  
27 -// pega as variaveis passadas com get ou post  
28 -//  
29 -  
30 include_once (dirname ( __FILE__ ) . "/../../../admin/php/login.php"); 26 include_once (dirname ( __FILE__ ) . "/../../../admin/php/login.php");
31 $funcoesEdicao = array ( 27 $funcoesEdicao = array (
32 "ADICIONAR", 28 "ADICIONAR",
@@ -40,10 +36,16 @@ if (in_array ( strtoupper ( $funcao ), $funcoesEdicao )) { @@ -40,10 +36,16 @@ if (in_array ( strtoupper ( $funcao ), $funcoesEdicao )) {
40 } 36 }
41 } 37 }
42 include (dirname ( __FILE__ ) . "/../../../admin/php/conexao.php"); 38 include (dirname ( __FILE__ ) . "/../../../admin/php/conexao.php");
  39 +
  40 +$id_ws = $_POST["id_ws"];
  41 +$id = $_POST["id"];
  42 +
  43 +testaSafeNumerico([$id,$id_ws]);
  44 +
43 $funcao = strtoupper ( $funcao ); 45 $funcao = strtoupper ( $funcao );
44 switch ($funcao) { 46 switch ($funcao) {
45 case "ADICIONAR" : 47 case "ADICIONAR" :
46 - $novo = adicionar( $autor_ws, $desc_ws, $link_ws, $nome_ws, $tipo_ws,$dbhw ); 48 + $novo = adicionar( $_POST["autor_ws"], $_POST["desc_ws"], $_POST["link_ws"], $_POST["nome_ws"], $_POST["tipo_ws"],$dbhw );
47 if ($novo === false) { 49 if ($novo === false) {
48 header ( "HTTP/1.1 500 erro ao consultar banco de dados" ); 50 header ( "HTTP/1.1 500 erro ao consultar banco de dados" );
49 exit (); 51 exit ();
@@ -51,7 +53,7 @@ switch ($funcao) { @@ -51,7 +53,7 @@ switch ($funcao) {
51 exit (); 53 exit ();
52 break; 54 break;
53 case "ALTERAR" : 55 case "ALTERAR" :
54 - $novo = alterar ( $id_ws,$autor_ws, $desc_ws, $link_ws, $nome_ws, $tipo_ws,$dbhw ); 56 + $novo = alterar ( $id_ws,$_POST["autor_ws"], $_POST["desc_ws"], $_POST["link_ws"], $_POST["nome_ws"], $_POST["tipo_ws"],$dbhw );
55 if ($novo === false) { 57 if ($novo === false) {
56 header ( "HTTP/1.1 500 erro ao consultar banco de dados" ); 58 header ( "HTTP/1.1 500 erro ao consultar banco de dados" );
57 exit (); 59 exit ();
admin1/cadastros/servicos/index.js
@@ -182,7 +182,7 @@ Obt&amp;eacute;m a lista de Webservices @@ -182,7 +182,7 @@ Obt&amp;eacute;m a lista de Webservices
182 i3GEOadmin.core.fechaModalGeral(); 182 i3GEOadmin.core.fechaModalGeral();
183 i3GEOadmin.core.modalAguarde(true); 183 i3GEOadmin.core.modalAguarde(true);
184 $.post( 184 $.post(
185 - "exec.php?funcao=alterarWs", 185 + "exec.php?funcao=alterar",
186 "id_ws="+ id+"&"+parametros 186 "id_ws="+ id+"&"+parametros
187 ) 187 )
188 .done( 188 .done(
admin1/cadastros/servicos/index.php
@@ -82,15 +82,15 @@ include &quot;../../head.php&quot;; @@ -82,15 +82,15 @@ include &quot;../../head.php&quot;;
82 </div> 82 </div>
83 </div> 83 </div>
84 <div class="form-group form-group-lg"> 84 <div class="form-group form-group-lg">
85 - <label class="col-md-2 control-label" for="login">{{{descricaoTxt}}}</label> 85 + <label class="col-md-2 control-label" for="desc_ws">{{{descricaoTxt}}}</label>
86 <div class="col-md-10"> 86 <div class="col-md-10">
87 <input title="{{{descricaoTxt}}}" type="text" value="{{{desc_ws}}}" class="form-control" name="desc_ws" > 87 <input title="{{{descricaoTxt}}}" type="text" value="{{{desc_ws}}}" class="form-control" name="desc_ws" >
88 </div> 88 </div>
89 </div> 89 </div>
90 <div class="form-group form-group-lg"> 90 <div class="form-group form-group-lg">
91 - <label class="col-md-2 control-label" for="email">{{{autor}}}</label> 91 + <label class="col-md-2 control-label" for="autor_ws">{{{autor}}}</label>
92 <div class="col-md-10"> 92 <div class="col-md-10">
93 - <input title="{{{autor}}}" type="email" value="{{{autor_ws}}}" class="form-control" name="autor_ws" required> 93 + <input title="{{{autor}}}" type="text" value="{{{autor_ws}}}" class="form-control" name="autor_ws" required>
94 </div> 94 </div>
95 </div> 95 </div>
96 <div class="form-group form-group-lg"> 96 <div class="form-group form-group-lg">
admin1/cadastros/tags/exec.php
@@ -42,7 +42,10 @@ if (in_array ( strtoupper ( $funcao ), $funcoesEdicao )) { @@ -42,7 +42,10 @@ if (in_array ( strtoupper ( $funcao ), $funcoesEdicao )) {
42 include (dirname ( __FILE__ ) . "/../../../admin/php/conexao.php"); 42 include (dirname ( __FILE__ ) . "/../../../admin/php/conexao.php");
43 43
44 //remove espaco em branco do nome do tag 44 //remove espaco em branco do nome do tag
45 -$nome = str_replace(" ","",$nome); 45 +$nome = str_replace(" ","",$_POST["nome"]);
  46 +$id_tag = $_POST["id_tag"];
  47 +testaSafeNumerico([$id_tag]);
  48 +
46 $funcao = strtoupper ( $funcao ); 49 $funcao = strtoupper ( $funcao );
47 switch ($funcao) { 50 switch ($funcao) {
48 case "ADICIONAR" : 51 case "ADICIONAR" :
admin1/catalogo/atlas/exec.php
@@ -41,10 +41,16 @@ if (in_array ( strtoupper ( $funcao ), $funcoesEdicao )) { @@ -41,10 +41,16 @@ if (in_array ( strtoupper ( $funcao ), $funcoesEdicao )) {
41 } 41 }
42 include (dirname ( __FILE__ ) . "/../../../admin/php/conexao.php"); 42 include (dirname ( __FILE__ ) . "/../../../admin/php/conexao.php");
43 43
  44 +$id = $_POST["id"];
  45 +$id_atlas = $_POST["id_atlas"];
  46 +$id_prancha = $_POST["id_prancha"];
  47 +
  48 +testaSafeNumerico([$id,$id_atlas,$id_prancha]);
  49 +
44 $funcao = strtoupper ( $funcao ); 50 $funcao = strtoupper ( $funcao );
45 switch ($funcao) { 51 switch ($funcao) {
46 case "ADICIONAR" : 52 case "ADICIONAR" :
47 - $novo = adicionar( $titulo_atlas, $publicado_atlas, $ordem_atlas, $basemapfile_atlas, $desc_atlas, $h_atlas, $w_atlas, $icone_atlas, $link_atlas, $pranchadefault_atlas, $template_atlas, $tipoguias_atlas, $dbhw ); 53 + $novo = adicionar( $_POST["titulo_atlas"], $_POST["publicado_atlas"], $_POST["ordem_atlas"], $_POST["basemapfile_atlas"], $_POST["desc_atlas"], $_POST["h_atlas"], $_POST["w_atlas"], $_POST["icone_atlas"], $_POST["link_atlas"], $_POST["pranchadefault_atlas"], $_POST["template_atlas"], $_POST["tipoguias_atlas"], $dbhw );
48 if ($novo === false) { 54 if ($novo === false) {
49 header ( "HTTP/1.1 500 erro ao consultar banco de dados" ); 55 header ( "HTTP/1.1 500 erro ao consultar banco de dados" );
50 exit (); 56 exit ();
@@ -52,7 +58,7 @@ switch ($funcao) { @@ -52,7 +58,7 @@ switch ($funcao) {
52 exit (); 58 exit ();
53 break; 59 break;
54 case "ALTERAR" : 60 case "ALTERAR" :
55 - $novo = alterar ( $id_atlas, $titulo_atlas, $publicado_atlas, $ordem_atlas, $basemapfile_atlas, $desc_atlas, $h_atlas, $w_atlas, $icone_atlas, $link_atlas, $pranchadefault_atlas, $template_atlas, $tipoguias_atlas, $dbhw ); 61 + $novo = alterar ( $id_atlas, $_POST["titulo_atlas"], $_POST["publicado_atlas"], $_POST["ordem_atlas"], $_POST["basemapfile_atlas"], $_POST["desc_atlas"], $_POST["h_atlas"], $_POST["w_atlas"], $_POST["icone_atlas"], $_POST["link_atlas"], $_POST["pranchadefault_atlas"], $_POST["template_atlas"], $_POST["tipoguias_atlas"], $dbhw );
56 if ($novo === false) { 62 if ($novo === false) {
57 header ( "HTTP/1.1 500 erro ao consultar banco de dados" ); 63 header ( "HTTP/1.1 500 erro ao consultar banco de dados" );
58 exit (); 64 exit ();
admin1/catalogo/atlas/index.php
@@ -89,7 +89,7 @@ include &quot;../../head.php&quot;; @@ -89,7 +89,7 @@ include &quot;../../head.php&quot;;
89 <div class="form-group form-group-lg"> 89 <div class="form-group form-group-lg">
90 <label class="col-md-4 control-label" for="link_atlas" >{{{linkTxt}}}</label> 90 <label class="col-md-4 control-label" for="link_atlas" >{{{linkTxt}}}</label>
91 <div class="col-md-8"> 91 <div class="col-md-8">
92 - <input title="{{{linkTxt}}}" type="text" value="{{{link_atlas}}}" class="form-control" name="link_atlas" required> 92 + <input title="{{{linkTxt}}}" type="text" value="{{{link_atlas}}}" class="form-control" name="link_atlas" >
93 </div> 93 </div>
94 </div> 94 </div>
95 </div> 95 </div>
@@ -107,7 +107,7 @@ include &quot;../../head.php&quot;; @@ -107,7 +107,7 @@ include &quot;../../head.php&quot;;
107 <div class="form-group form-group-lg"> 107 <div class="form-group form-group-lg">
108 <label class="col-md-4 control-label" for="ordem_atlas" >{{{ordem}}}</label> 108 <label class="col-md-4 control-label" for="ordem_atlas" >{{{ordem}}}</label>
109 <div class="col-md-8"> 109 <div class="col-md-8">
110 - <input title="{{{ordem}}}" type="text" value="{{{ordem_atlas}}}" class="form-control" name="ordem_atlas" required> 110 + <input title="{{{ordem}}}" type="text" value="{{{ordem_atlas}}}" class="form-control" name="ordem_atlas" >
111 </div> 111 </div>
112 </div> 112 </div>
113 </div> 113 </div>
@@ -115,7 +115,7 @@ include &quot;../../head.php&quot;; @@ -115,7 +115,7 @@ include &quot;../../head.php&quot;;
115 <div class="form-group form-group-lg"> 115 <div class="form-group form-group-lg">
116 <label class="col-md-4 control-label" for="basemapfile_atlas" >{{{mapfileInicia}}}</label> 116 <label class="col-md-4 control-label" for="basemapfile_atlas" >{{{mapfileInicia}}}</label>
117 <div class="col-md-8"> 117 <div class="col-md-8">
118 - <input title="{{{mapfileInicia}}}" type="text" value="{{{basemapfile_atlas}}}" class="form-control" name="basemapfile_atlas" required> 118 + <input title="{{{mapfileInicia}}}" type="text" value="{{{basemapfile_atlas}}}" class="form-control" name="basemapfile_atlas" >
119 </div> 119 </div>
120 </div> 120 </div>
121 </div> 121 </div>
@@ -123,7 +123,7 @@ include &quot;../../head.php&quot;; @@ -123,7 +123,7 @@ include &quot;../../head.php&quot;;
123 <div class="form-group form-group-lg"> 123 <div class="form-group form-group-lg">
124 <label class="col-md-4 control-label" for="h_atlas" >{{{altura}}}</label> 124 <label class="col-md-4 control-label" for="h_atlas" >{{{altura}}}</label>
125 <div class="col-md-8"> 125 <div class="col-md-8">
126 - <input title="{{{altura}}}" type="text" value="{{{h_atlas}}}" class="form-control" name="h_atlas" required> 126 + <input title="{{{altura}}}" type="text" value="{{{h_atlas}}}" class="form-control" name="h_atlas" >
127 </div> 127 </div>
128 </div> 128 </div>
129 </div> 129 </div>
@@ -131,7 +131,7 @@ include &quot;../../head.php&quot;; @@ -131,7 +131,7 @@ include &quot;../../head.php&quot;;
131 <div class="form-group form-group-lg"> 131 <div class="form-group form-group-lg">
132 <label class="col-md-4 control-label" for="w_atlas" >{{{largura}}}</label> 132 <label class="col-md-4 control-label" for="w_atlas" >{{{largura}}}</label>
133 <div class="col-md-8"> 133 <div class="col-md-8">
134 - <input title="{{{largura}}}" type="text" value="{{{w_atlas}}}" class="form-control" name="w_atlas" required> 134 + <input title="{{{largura}}}" type="text" value="{{{w_atlas}}}" class="form-control" name="w_atlas" >
135 </div> 135 </div>
136 </div> 136 </div>
137 </div> 137 </div>
@@ -139,7 +139,7 @@ include &quot;../../head.php&quot;; @@ -139,7 +139,7 @@ include &quot;../../head.php&quot;;
139 <div class="form-group form-group-lg"> 139 <div class="form-group form-group-lg">
140 <label class="col-md-4 control-label" for="icone_atlas" >{{{iconeAtlas}}}</label> 140 <label class="col-md-4 control-label" for="icone_atlas" >{{{iconeAtlas}}}</label>
141 <div class="col-md-8"> 141 <div class="col-md-8">
142 - <input title="{{{iconeAtlas}}}" type="text" value="{{{icone_atlas}}}" class="form-control" name="icone_atlas" required> 142 + <input title="{{{iconeAtlas}}}" type="text" value="{{{icone_atlas}}}" class="form-control" name="icone_atlas" >
143 </div> 143 </div>
144 </div> 144 </div>
145 </div> 145 </div>
@@ -147,7 +147,7 @@ include &quot;../../head.php&quot;; @@ -147,7 +147,7 @@ include &quot;../../head.php&quot;;
147 <div class="form-group form-group-lg"> 147 <div class="form-group form-group-lg">
148 <label class="col-md-4 control-label" for="pranchadefault_atlas" >{{{pranchaInicia}}}</label> 148 <label class="col-md-4 control-label" for="pranchadefault_atlas" >{{{pranchaInicia}}}</label>
149 <div class="col-md-8"> 149 <div class="col-md-8">
150 - <input title="{{{pranchaInicia}}}" type="text" value="{{{pranchadefault_atlas}}}" class="form-control" name="pranchadefault_atlas" required> 150 + <input title="{{{pranchaInicia}}}" type="text" value="{{{pranchadefault_atlas}}}" class="form-control" name="pranchadefault_atlas" >
151 </div> 151 </div>
152 </div> 152 </div>
153 </div> 153 </div>
@@ -155,7 +155,7 @@ include &quot;../../head.php&quot;; @@ -155,7 +155,7 @@ include &quot;../../head.php&quot;;
155 <div class="form-group form-group-lg"> 155 <div class="form-group form-group-lg">
156 <label class="col-md-4 control-label" for="template_atlas" >{{{template}}}</label> 156 <label class="col-md-4 control-label" for="template_atlas" >{{{template}}}</label>
157 <div class="col-md-8"> 157 <div class="col-md-8">
158 - <input title="{{{template}}}" type="text" value="{{{template_atlas}}}" class="form-control" name="template_atlas" required> 158 + <input title="{{{template}}}" type="text" value="{{{template_atlas}}}" class="form-control" name="template_atlas" >
159 </div> 159 </div>
160 </div> 160 </div>
161 </div> 161 </div>
@@ -175,7 +175,7 @@ include &quot;../../head.php&quot;; @@ -175,7 +175,7 @@ include &quot;../../head.php&quot;;
175 </div> 175 </div>
176 </form> 176 </form>
177 </div> 177 </div>
178 - <div class="panel-footer" style="padding-top: 0px; padding-bottom: 0px;"> 178 + <div class="panel-footer {{{escondido}}}" style="padding-top: 0px; padding-bottom: 0px;">
179 <div class="pull-right"> 179 <div class="pull-right">
180 <button style="color:#007a6f;" onclick="i3GEOadmin.atlas.editarPranchas('{{id_atlas}}','{{{titulo_atlas}}}')" class="btn btn-primary btn-xs" style="margin-top: 2px; margin-bottom: 2px;"> 180 <button style="color:#007a6f;" onclick="i3GEOadmin.atlas.editarPranchas('{{id_atlas}}','{{{titulo_atlas}}}')" class="btn btn-primary btn-xs" style="margin-top: 2px; margin-bottom: 2px;">
181 <i class="material-icons">folder_open</i> {{{pranchas}}} 181 <i class="material-icons">folder_open</i> {{{pranchas}}}
admin1/catalogo/atlas/pranchas/exec.php
@@ -41,10 +41,16 @@ if (in_array ( strtoupper ( $funcao ), $funcoesEdicao )) { @@ -41,10 +41,16 @@ if (in_array ( strtoupper ( $funcao ), $funcoesEdicao )) {
41 } 41 }
42 include (dirname ( __FILE__ ) . "/../../../../admin/php/conexao.php"); 42 include (dirname ( __FILE__ ) . "/../../../../admin/php/conexao.php");
43 43
  44 +$id = $_POST["id"];
  45 +$id_atlas = $_POST["id_atlas"];
  46 +$id_prancha = $_POST["id_prancha"];
  47 +
  48 +testaSafeNumerico([$id,$id_atlas,$id_prancha]);
  49 +
44 $funcao = strtoupper ( $funcao ); 50 $funcao = strtoupper ( $funcao );
45 switch ($funcao) { 51 switch ($funcao) {
46 case "ADICIONAR" : 52 case "ADICIONAR" :
47 - $novo = adicionar( $id_atlas, $titulo_prancha, $ordem_prancha, $desc_prancha, $h_prancha, $icone_prancha, $link_prancha, $mapext_prancha, $w_prancha, $dbhw ); 53 + $novo = adicionar( $id_atlas, $_POST["titulo_prancha"], $_POST["ordem_prancha"], $_POST["desc_prancha"], $_POST["h_prancha"], $_POST["icone_prancha"], $_POST["link_prancha"], $_POST["mapext_prancha"], $_POST["w_prancha"], $dbhw );
48 if ($novo === false) { 54 if ($novo === false) {
49 header ( "HTTP/1.1 500 erro ao consultar banco de dados" ); 55 header ( "HTTP/1.1 500 erro ao consultar banco de dados" );
50 exit (); 56 exit ();
@@ -52,7 +58,7 @@ switch ($funcao) { @@ -52,7 +58,7 @@ switch ($funcao) {
52 exit (); 58 exit ();
53 break; 59 break;
54 case "ALTERAR" : 60 case "ALTERAR" :
55 - $novo = alterar ( $id_atlas, $id_prancha, $titulo_prancha, $ordem_prancha, $desc_prancha, $h_prancha, $icone_prancha, $link_prancha, $mapext_prancha, $w_prancha, $dbhw ); 61 + $novo = alterar ( $id_atlas, $id_prancha, $_POST["titulo_prancha"], $_POST["ordem_prancha"], $_POST["desc_prancha"], $_POST["h_prancha"], $_POST["icone_prancha"], $_POST["link_prancha"], $_POST["mapext_prancha"], $_POST["w_prancha"], $dbhw );
56 if ($novo === false) { 62 if ($novo === false) {
57 header ( "HTTP/1.1 500 erro ao consultar banco de dados" ); 63 header ( "HTTP/1.1 500 erro ao consultar banco de dados" );
58 exit (); 64 exit ();
@@ -69,7 +75,7 @@ switch ($funcao) { @@ -69,7 +75,7 @@ switch ($funcao) {
69 exit (); 75 exit ();
70 break; 76 break;
71 case "LISTA" : 77 case "LISTA" :
72 - $dados = pegaDados("SELECT id_atlas, id_prancha, titulo_prancha, ordem_prancha, desc_prancha, h_prancha, icone_prancha, link_prancha, mapext_prancha, w_prancha from ".$esquemaadmin."i3geoadmin_atlasp WHERE id_atlas = '{$id_atlas}'", $dbh, false); 78 + $dados = pegaDados("SELECT id_atlas, id_prancha, titulo_prancha, ordem_prancha, desc_prancha, h_prancha, icone_prancha, link_prancha, mapext_prancha, w_prancha from ".$esquemaadmin."i3geoadmin_atlasp WHERE id_atlas = '$id_atlas'", $dbh, false);
73 if ($dados === false) { 79 if ($dados === false) {
74 $dbhw = null; 80 $dbhw = null;
75 $dbh = null; 81 $dbh = null;
admin1/catalogo/atlas/pranchas/index.js
@@ -40,7 +40,8 @@ Obt&amp;eacute;m a lista @@ -40,7 +40,8 @@ Obt&amp;eacute;m a lista
40 lista: function(){ 40 lista: function(){
41 i3GEOadmin.core.iconeAguarde(i3GEOadmin.prancha.ondeLista); 41 i3GEOadmin.core.iconeAguarde(i3GEOadmin.prancha.ondeLista);
42 $.post( 42 $.post(
43 - "exec.php?funcao=lista&id_atlas=" + i3GEOadmin.prancha.id_atlas 43 + "exec.php?funcao=lista",
  44 + "id_atlas=" + i3GEOadmin.prancha.id_atlas
44 ) 45 )
45 .done( 46 .done(
46 function(data, status){ 47 function(data, status){
admin1/catalogo/atlas/pranchas/index.php
@@ -84,7 +84,7 @@ $titulo_atlas = filter_var($_GET[&quot;titulo_atlas&quot;], FILTER_SANITIZE_STRING); @@ -84,7 +84,7 @@ $titulo_atlas = filter_var($_GET[&quot;titulo_atlas&quot;], FILTER_SANITIZE_STRING);
84 <div class="form-group form-group-lg"> 84 <div class="form-group form-group-lg">
85 <label class="col-md-4 control-label" for="desc_prancha" >{{{descricao}}}</label> 85 <label class="col-md-4 control-label" for="desc_prancha" >{{{descricao}}}</label>
86 <div class="col-md-8"> 86 <div class="col-md-8">
87 - <input title="{{{descricao}}}" type="text" value="{{{desc_prancha}}}" class="form-control" name="desc_prancha" required> 87 + <input title="{{{descricao}}}" type="text" value="{{{desc_prancha}}}" class="form-control" name="desc_prancha" >
88 </div> 88 </div>
89 </div> 89 </div>
90 </div> 90 </div>
@@ -92,7 +92,7 @@ $titulo_atlas = filter_var($_GET[&quot;titulo_atlas&quot;], FILTER_SANITIZE_STRING); @@ -92,7 +92,7 @@ $titulo_atlas = filter_var($_GET[&quot;titulo_atlas&quot;], FILTER_SANITIZE_STRING);
92 <div class="form-group form-group-lg"> 92 <div class="form-group form-group-lg">
93 <label class="col-md-4 control-label" for="link_prancha" >{{{linkTxt}}}</label> 93 <label class="col-md-4 control-label" for="link_prancha" >{{{linkTxt}}}</label>
94 <div class="col-md-8"> 94 <div class="col-md-8">
95 - <input title="{{{linkTxt}}}" type="text" value="{{{link_prancha}}}" class="form-control" name="link_prancha" required> 95 + <input title="{{{linkTxt}}}" type="text" value="{{{link_prancha}}}" class="form-control" name="link_prancha" >
96 </div> 96 </div>
97 </div> 97 </div>
98 </div> 98 </div>
@@ -100,7 +100,7 @@ $titulo_atlas = filter_var($_GET[&quot;titulo_atlas&quot;], FILTER_SANITIZE_STRING); @@ -100,7 +100,7 @@ $titulo_atlas = filter_var($_GET[&quot;titulo_atlas&quot;], FILTER_SANITIZE_STRING);
100 <div class="form-group form-group-lg"> 100 <div class="form-group form-group-lg">
101 <label class="col-md-4 control-label" for="ordem_prancha" >{{{ordem}}}</label> 101 <label class="col-md-4 control-label" for="ordem_prancha" >{{{ordem}}}</label>
102 <div class="col-md-8"> 102 <div class="col-md-8">
103 - <input title="{{{ordem}}}" type="text" value="{{{ordem_prancha}}}" class="form-control" name="ordem_prancha" required> 103 + <input title="{{{ordem}}}" type="text" value="{{{ordem_prancha}}}" class="form-control" name="ordem_prancha" >
104 </div> 104 </div>
105 </div> 105 </div>
106 </div> 106 </div>
@@ -108,7 +108,7 @@ $titulo_atlas = filter_var($_GET[&quot;titulo_atlas&quot;], FILTER_SANITIZE_STRING); @@ -108,7 +108,7 @@ $titulo_atlas = filter_var($_GET[&quot;titulo_atlas&quot;], FILTER_SANITIZE_STRING);
108 <div class="form-group form-group-lg"> 108 <div class="form-group form-group-lg">
109 <label class="col-md-4 control-label" for="h_prancha" >{{{altura}}}</label> 109 <label class="col-md-4 control-label" for="h_prancha" >{{{altura}}}</label>
110 <div class="col-md-8"> 110 <div class="col-md-8">
111 - <input title="{{{altura}}}" type="text" value="{{{h_prancha}}}" class="form-control" name="h_prancha" required> 111 + <input title="{{{altura}}}" type="text" value="{{{h_prancha}}}" class="form-control" name="h_prancha" >
112 </div> 112 </div>
113 </div> 113 </div>
114 </div> 114 </div>
@@ -116,7 +116,7 @@ $titulo_atlas = filter_var($_GET[&quot;titulo_atlas&quot;], FILTER_SANITIZE_STRING); @@ -116,7 +116,7 @@ $titulo_atlas = filter_var($_GET[&quot;titulo_atlas&quot;], FILTER_SANITIZE_STRING);
116 <div class="form-group form-group-lg"> 116 <div class="form-group form-group-lg">
117 <label class="col-md-4 control-label" for="w_prancha" >{{{largura}}}</label> 117 <label class="col-md-4 control-label" for="w_prancha" >{{{largura}}}</label>
118 <div class="col-md-8"> 118 <div class="col-md-8">
119 - <input title="{{{largura}}}" type="text" value="{{{w_prancha}}}" class="form-control" name="w_prancha" required> 119 + <input title="{{{largura}}}" type="text" value="{{{w_prancha}}}" class="form-control" name="w_prancha" >
120 </div> 120 </div>
121 </div> 121 </div>
122 </div> 122 </div>
@@ -124,7 +124,7 @@ $titulo_atlas = filter_var($_GET[&quot;titulo_atlas&quot;], FILTER_SANITIZE_STRING); @@ -124,7 +124,7 @@ $titulo_atlas = filter_var($_GET[&quot;titulo_atlas&quot;], FILTER_SANITIZE_STRING);
124 <div class="form-group form-group-lg"> 124 <div class="form-group form-group-lg">
125 <label class="col-md-4 control-label" for="icone_prancha" >{{{icone}}}</label> 125 <label class="col-md-4 control-label" for="icone_prancha" >{{{icone}}}</label>
126 <div class="col-md-8"> 126 <div class="col-md-8">
127 - <input title="{{{icone}}}" type="text" value="{{{icone_prancha}}}" class="form-control" name="icone_prancha" required> 127 + <input title="{{{icone}}}" type="text" value="{{{icone_prancha}}}" class="form-control" name="icone_prancha" >
128 </div> 128 </div>
129 </div> 129 </div>
130 </div> 130 </div>
@@ -132,7 +132,7 @@ $titulo_atlas = filter_var($_GET[&quot;titulo_atlas&quot;], FILTER_SANITIZE_STRING); @@ -132,7 +132,7 @@ $titulo_atlas = filter_var($_GET[&quot;titulo_atlas&quot;], FILTER_SANITIZE_STRING);
132 <div class="form-group form-group-lg"> 132 <div class="form-group form-group-lg">
133 <label class="col-md-4 control-label" for="mapext_prancha" >{{{extGeo}}}</label> 133 <label class="col-md-4 control-label" for="mapext_prancha" >{{{extGeo}}}</label>
134 <div class="col-md-8"> 134 <div class="col-md-8">
135 - <input title="{{{extGeo}}}" type="text" value="{{{mapext_prancha}}}" class="form-control" name="mapext_prancha" required> 135 + <input title="{{{extGeo}}}" type="text" value="{{{mapext_prancha}}}" class="form-control" name="mapext_prancha" >
136 </div> 136 </div>
137 </div> 137 </div>
138 </div> 138 </div>
@@ -142,7 +142,7 @@ $titulo_atlas = filter_var($_GET[&quot;titulo_atlas&quot;], FILTER_SANITIZE_STRING); @@ -142,7 +142,7 @@ $titulo_atlas = filter_var($_GET[&quot;titulo_atlas&quot;], FILTER_SANITIZE_STRING);
142 </div> 142 </div>
143 </form> 143 </form>
144 </div> 144 </div>
145 - <div class="panel-footer" style="padding-top: 0px; padding-bottom: 0px;"> 145 + <div class="panel-footer {{{escondido}}}" style="padding-top: 0px; padding-bottom: 0px;">
146 <div class="pull-right"> 146 <div class="pull-right">
147 <button style="color:#007a6f;" onclick="i3GEOadmin.prancha.editarTemas('{{id_atlas}}','{{id_prancha}}','{{{titulo_prancha}}}')" class="btn btn-primary btn-xs" style="margin-top: 2px; margin-bottom: 2px;"> 147 <button style="color:#007a6f;" onclick="i3GEOadmin.prancha.editarTemas('{{id_atlas}}','{{id_prancha}}','{{{titulo_prancha}}}')" class="btn btn-primary btn-xs" style="margin-top: 2px; margin-bottom: 2px;">
148 <i class="material-icons">folder_open</i> {{{editarTema}}} 148 <i class="material-icons">folder_open</i> {{{editarTema}}}
admin1/catalogo/atlas/pranchas/temas/exec.php
@@ -41,10 +41,16 @@ if (in_array ( strtoupper ( $funcao ), $funcoesEdicao )) { @@ -41,10 +41,16 @@ if (in_array ( strtoupper ( $funcao ), $funcoesEdicao )) {
41 } 41 }
42 include (dirname ( __FILE__ ) . "/../../../../../admin/php/conexao.php"); 42 include (dirname ( __FILE__ ) . "/../../../../../admin/php/conexao.php");
43 43
  44 +$id_atlas = $_POST["id_atlas"];
  45 +$id_prancha = $_POST["id_prancha"];
  46 +$id_tema = $_POST["id_tema"];
  47 +
  48 +testaSafeNumerico([$id,$id_atlas,$id_prancha]);
  49 +
44 $funcao = strtoupper ( $funcao ); 50 $funcao = strtoupper ( $funcao );
45 switch ($funcao) { 51 switch ($funcao) {
46 case "ADICIONAR" : 52 case "ADICIONAR" :
47 - $novo = adicionar( $id_prancha, $ordem_tema, $ligado_tema, $codigo_tema, $dbhw ); 53 + $novo = adicionar( $id_prancha, $_POST["ordem_tema"], $_POST["ligado_tema"], $_POST["codigo_tema"], $dbhw );
48 if ($novo === false) { 54 if ($novo === false) {
49 header ( "HTTP/1.1 500 erro ao consultar banco de dados" ); 55 header ( "HTTP/1.1 500 erro ao consultar banco de dados" );
50 exit (); 56 exit ();
@@ -52,7 +58,7 @@ switch ($funcao) { @@ -52,7 +58,7 @@ switch ($funcao) {
52 exit (); 58 exit ();
53 break; 59 break;
54 case "ALTERAR" : 60 case "ALTERAR" :
55 - $novo = alterar ( $id_tema, $ordem_tema, $ligado_tema, $codigo_tema, $dbhw ); 61 + $novo = alterar ( $id_tema, $_POST["ordem_tema"], $_POST["ligado_tema"], $_POST["codigo_tema"], $dbhw );
56 if ($novo === false) { 62 if ($novo === false) {
57 header ( "HTTP/1.1 500 erro ao consultar banco de dados" ); 63 header ( "HTTP/1.1 500 erro ao consultar banco de dados" );
58 exit (); 64 exit ();
@@ -69,7 +75,7 @@ switch ($funcao) { @@ -69,7 +75,7 @@ switch ($funcao) {
69 exit (); 75 exit ();
70 break; 76 break;
71 case "LISTA" : 77 case "LISTA" :
72 - $dados = pegaDados("SELECT id_tema, ordem_tema, codigo_tema, ligado_tema from ".$esquemaadmin."i3geoadmin_atlast WHERE id_prancha = '{$id_prancha}'", $dbh, false); 78 + $dados = pegaDados("SELECT id_tema, ordem_tema, codigo_tema, ligado_tema from ".$esquemaadmin."i3geoadmin_atlast WHERE id_prancha = '$id_prancha'", $dbh, false);
73 if ($dados === false) { 79 if ($dados === false) {
74 $dbhw = null; 80 $dbhw = null;
75 $dbh = null; 81 $dbh = null;
admin1/catalogo/atlas/pranchas/temas/index.js
@@ -40,7 +40,8 @@ Obt&amp;eacute;m a lista @@ -40,7 +40,8 @@ Obt&amp;eacute;m a lista
40 lista: function(){ 40 lista: function(){
41 i3GEOadmin.core.iconeAguarde(i3GEOadmin.tema.ondeLista); 41 i3GEOadmin.core.iconeAguarde(i3GEOadmin.tema.ondeLista);
42 $.post( 42 $.post(
43 - "exec.php?funcao=lista&id_prancha=" + i3GEOadmin.tema.id_prancha 43 + "exec.php?funcao=lista",
  44 + "id_prancha=" + i3GEOadmin.tema.id_prancha
44 ) 45 )
45 .done( 46 .done(
46 function(data, status){ 47 function(data, status){
admin1/catalogo/atlas/pranchas/temas/index.php
@@ -59,7 +59,7 @@ $id_atlas = filter_var($_GET[&quot;id_atlas&quot;], FILTER_SANITIZE_NUMBER_INT); @@ -59,7 +59,7 @@ $id_atlas = filter_var($_GET[&quot;id_atlas&quot;], FILTER_SANITIZE_NUMBER_INT);
59 </h3> 59 </h3>
60 </div> 60 </div>
61 <div class="panel-body panel-collapse collapse" id="body-form-{{id_tema}}"> 61 <div class="panel-body panel-collapse collapse" id="body-form-{{id_tema}}">
62 - <form style="" action="#" onsubmit="{{onSalvar}}('{{id_tema}}');return false;" onchange="this.style.boxShadow='2px 2px 5px 0 #009688';" class="form-horizontal" role="form" method="post" > 62 + <form style="" action="#" onsubmit="{{onSalvar}}('{{id_tema}}','{{{codigo_tema}}}');return false;" onchange="this.style.boxShadow='2px 2px 5px 0 #009688';" class="form-horizontal" role="form" method="post" >
63 <div class="row"> 63 <div class="row">
64 <div class="col-md-12 {{esconde}}"> 64 <div class="col-md-12 {{esconde}}">
65 <div class="form-group form-group-lg"> 65 <div class="form-group form-group-lg">
@@ -75,7 +75,7 @@ $id_atlas = filter_var($_GET[&quot;id_atlas&quot;], FILTER_SANITIZE_NUMBER_INT); @@ -75,7 +75,7 @@ $id_atlas = filter_var($_GET[&quot;id_atlas&quot;], FILTER_SANITIZE_NUMBER_INT);
75 <div class="form-group form-group-lg"> 75 <div class="form-group form-group-lg">
76 <label class="col-md-4 control-label" for="ordem_tema" >{{{ordem}}}</label> 76 <label class="col-md-4 control-label" for="ordem_tema" >{{{ordem}}}</label>
77 <div class="col-md-8"> 77 <div class="col-md-8">
78 - <input title="{{{ordem}}}" type="text" value="{{{ordem_tema}}}" class="form-control" name="ordem_tema" required> 78 + <input title="{{{ordem}}}" type="text" value="{{{ordem_tema}}}" class="form-control" name="ordem_tema" >
79 </div> 79 </div>
80 </div> 80 </div>
81 </div> 81 </div>
admin1/catalogo/mapas/exec.php
@@ -41,6 +41,9 @@ if (in_array ( strtoupper ( $funcao ), $funcoesEdicao )) { @@ -41,6 +41,9 @@ if (in_array ( strtoupper ( $funcao ), $funcoesEdicao )) {
41 } 41 }
42 include (dirname ( __FILE__ ) . "/../../../admin/php/conexao.php"); 42 include (dirname ( __FILE__ ) . "/../../../admin/php/conexao.php");
43 43
  44 +$id_mapa = $_POST["id_mapa"];
  45 +testaSafeNumerico([$id_mapa]);
  46 +
44 $funcao = strtoupper ( $funcao ); 47 $funcao = strtoupper ( $funcao );
45 switch ($funcao) { 48 switch ($funcao) {
46 case "ADICIONAR" : 49 case "ADICIONAR" :
@@ -52,7 +55,7 @@ switch ($funcao) { @@ -52,7 +55,7 @@ switch ($funcao) {
52 exit (); 55 exit ();
53 break; 56 break;
54 case "ALTERAR" : 57 case "ALTERAR" :
55 - $novo = alterar ( $id_mapa, $publicado_mapa, $ordem_mapa, $perfil_mapa, $ligados_mapa, $temas_mapa, $desc_mapa, $ext_mapa, $imagem_mapa, $linkdireto_mapa, $nome_mapa, $outros_mapa, $mapfile , $dbhw ); 58 + $novo = alterar ( $id_mapa, $_POST["publicado_mapa"], $_POST["ordem_mapa"], $_POST["perfil_mapa"], $_POST["ligados_mapa"], $_POST["temas_mapa"], $_POST["desc_mapa"], $_POST["ext_mapa"], $_POST["imagem_mapa"], $_POST["linkdireto_mapa"], $_POST["nome_mapa"], $_POST["outros_mapa"], $_POST["mapfile"] , $dbhw );
56 if ($novo === false) { 59 if ($novo === false) {
57 header ( "HTTP/1.1 500 erro ao consultar banco de dados" ); 60 header ( "HTTP/1.1 500 erro ao consultar banco de dados" );
58 exit (); 61 exit ();
admin1/catalogo/mapas/index.php
@@ -85,7 +85,7 @@ include &quot;../../head.php&quot;; @@ -85,7 +85,7 @@ include &quot;../../head.php&quot;;
85 <div class="form-group form-group-lg"> 85 <div class="form-group form-group-lg">
86 <label class="col-md-4 control-label" for="contemmapfile" >{{{contemMapfile}}}</label> 86 <label class="col-md-4 control-label" for="contemmapfile" >{{{contemMapfile}}}</label>
87 <div class="col-md-8"> 87 <div class="col-md-8">
88 - <input title="{{{contemMapfile}}}" type="text" value="{{{contemmapfile}}}" disabled="" class="form-control" name="contemmapfile" required> 88 + <input title="{{{contemMapfile}}}" type="text" value="{{{contemmapfile}}}" disabled="" class="form-control" name="contemmapfile" >
89 </div> 89 </div>
90 </div> 90 </div>
91 <div class="form-group form-group-lg"> 91 <div class="form-group form-group-lg">
classesphp/funcoes_gerais.php
@@ -1508,7 +1508,6 @@ function criaSHP($tema,$map_file,$locaplic,$dir_tmp,$nomeRand=TRUE,$prj=&quot;&quot;,$proj @@ -1508,7 +1508,6 @@ function criaSHP($tema,$map_file,$locaplic,$dir_tmp,$nomeRand=TRUE,$prj=&quot;&quot;,$proj
1508 else{ 1508 else{
1509 $novonomelayer = $tema; 1509 $novonomelayer = $tema;
1510 } 1510 }
1511 -  
1512 $novonomelayer = str_replace(".","-",$novonomelayer); 1511 $novonomelayer = str_replace(".","-",$novonomelayer);
1513 $nomeshp = $dir_tmp."/".$novonomelayer; 1512 $nomeshp = $dir_tmp."/".$novonomelayer;
1514 1513
@@ -1807,12 +1806,12 @@ function downloadTema2($map_file,$tema,$locaplic,$dir_tmp,$postgis_mapa) @@ -1807,12 +1806,12 @@ function downloadTema2($map_file,$tema,$locaplic,$dir_tmp,$postgis_mapa)
1807 //salva o mapfile com um outro nome para evitar que o mapa atual, se estiver aberto, seja modificado 1806 //salva o mapfile com um outro nome para evitar que o mapa atual, se estiver aberto, seja modificado
1808 // 1807 //
1809 //verifica se tem query e copia o arquivo 1808 //verifica se tem query e copia o arquivo
1810 - $qyfile = str_replace(".map",".qy",$map_file);  
1811 - $nr = nomerandomico(10); 1809 + $qyfile = str_replace(".map","_qy.map",$map_file);
  1810 + $nr = nomerandomico(5);
1812 $map_file = str_replace(".map",$nr."tmp.map",$map_file); 1811 $map_file = str_replace(".map",$nr."tmp.map",$map_file);
1813 if(file_exists($qyfile)){ 1812 if(file_exists($qyfile)){
1814 - $nqyfile = str_replace(".map",".qy",$map_file);  
1815 - $nqyfile = str_replace(".qy","",$nqyfile).".qy"; 1813 + $nqyfile = str_replace(".map","_qy.map",$map_file);
  1814 + $nqyfile = str_replace("_qy.map","",$nqyfile)."_qy.map";
1816 copy($qyfile,$nqyfile); 1815 copy($qyfile,$nqyfile);
1817 } 1816 }
1818 $map->save($map_file); 1817 $map->save($map_file);
@@ -1918,6 +1917,8 @@ function downloadTema2($map_file,$tema,$locaplic,$dir_tmp,$postgis_mapa) @@ -1918,6 +1917,8 @@ function downloadTema2($map_file,$tema,$locaplic,$dir_tmp,$postgis_mapa)
1918 $sel = New Selecao($map_file,$tema); 1917 $sel = New Selecao($map_file,$tema);
1919 //carrega a query para ver se o layer possui selecao ou nao 1918 //carrega a query para ver se o layer possui selecao ou nao
1920 $numSel = 0; 1919 $numSel = 0;
  1920 + $nomeRand = true;
  1921 +
1921 if(file_exists($sel->qyfile)){ 1922 if(file_exists($sel->qyfile)){
1922 $map->loadquery($sel->qyfile); 1923 $map->loadquery($sel->qyfile);
1923 $numSel = $l->getNumresults(); 1924 $numSel = $l->getNumresults();
@@ -1926,12 +1927,13 @@ function downloadTema2($map_file,$tema,$locaplic,$dir_tmp,$postgis_mapa) @@ -1926,12 +1927,13 @@ function downloadTema2($map_file,$tema,$locaplic,$dir_tmp,$postgis_mapa)
1926 //se nao existir selecao seleciona por box 1927 //se nao existir selecao seleciona por box
1927 //o box vem do mapfile original 1928 //o box vem do mapfile original
1928 // 1929 //
1929 - if(!file_exists($sel->qyfile) || $numSel < 1){ 1930 + if(!file_exists($sel->qyfile)){
1930 $box = $rectextent->minx." ".$rectextent->miny." ".$rectextent->maxx." ".$rectextent->maxy; 1931 $box = $rectextent->minx." ".$rectextent->miny." ".$rectextent->maxx." ".$rectextent->maxy;
1931 $sel->selecaoBOX("novo",$box); 1932 $sel->selecaoBOX("novo",$box);
1932 //reaproveita arquivo anterior 1933 //reaproveita arquivo anterior
1933 $nomeRand = false; 1934 $nomeRand = false;
1934 } 1935 }
  1936 +
1935 $nomeshp = criaSHP($tema,$map_file,$locaplic,$dir_tmp,$nomeRand,$projecao["prj"]); 1937 $nomeshp = criaSHP($tema,$map_file,$locaplic,$dir_tmp,$nomeRand,$projecao["prj"]);
1936 //remove o arquivo de selecao se ele foi criado apenas para pegar todos os elementos 1938 //remove o arquivo de selecao se ele foi criado apenas para pegar todos os elementos
1937 if($nomeRand == false){ 1939 if($nomeRand == false){
@@ -1 +0,0 @@ @@ -1 +0,0 @@
1 -i3geo  
2 \ No newline at end of file 0 \ No newline at end of file
ms_configura.php
@@ -511,7 +511,7 @@ Tipo: @@ -511,7 +511,7 @@ Tipo:
511 $postgis_mapa = array( 511 $postgis_mapa = array(
512 "teste"=>"user=postgres password=postgres dbname=teste host=localhost port=5432", 512 "teste"=>"user=postgres password=postgres dbname=teste host=localhost port=5432",
513 "postgres"=>"user=postgres password=postgres dbname=postgres host=localhost port=5432", 513 "postgres"=>"user=postgres password=postgres dbname=postgres host=localhost port=5432",
514 - //"i3geosaude"=>"user=postgres password=postgres dbname=i3geosaude host=localhost port=5432 options='-c client_encoding=LATIN1'", 514 + "i3geosaude"=>"user=postgres password=postgres dbname=i3geosaude host=localhost port=5432 options='-c client_encoding=LATIN1'",
515 "i3geosaudeUtf"=>"user=postgres password=postgres dbname=i3geosaude host=localhost port=5432" 515 "i3geosaudeUtf"=>"user=postgres password=postgres dbname=i3geosaude host=localhost port=5432"
516 ); 516 );
517 /* 517 /*
temas/_lbairros.map
@@ -4,7 +4,7 @@ MAP @@ -4,7 +4,7 @@ MAP
4 LAYER 4 LAYER
5 CONNECTION "i3geosaude" 5 CONNECTION "i3geosaude"
6 CONNECTIONTYPE POSTGIS 6 CONNECTIONTYPE POSTGIS
7 - DATA "the_geom from (select gid, st_setsrid(the_geom,4326) as the_geom,co_bairro,no_bairro,no_distr,no_municip from i3geo_metaestat.bairros /*FW*//*FW*/) as foo using unique co_bairro using srid=4326" 7 + DATA "the_geom from (select gid, st_setsrid(the_geom,4326) as the_geom,co_bairro,no_bairro,no_distr,no_municip from i3geo_metaestat.bairros limit 10/*FW*//*FW*/) as foo using unique co_bairro using srid=4326"
8 METADATA 8 METADATA
9 "cache" "nao" 9 "cache" "nao"
10 "TIP" "no_bairro" 10 "TIP" "no_bairro"
temas/_lbiomashp.map
@@ -6,14 +6,13 @@ MAP @@ -6,14 +6,13 @@ MAP
6 DATA "/var/www/i3geo/aplicmap/dados/biomas.shp" 6 DATA "/var/www/i3geo/aplicmap/dados/biomas.shp"
7 METADATA 7 METADATA
8 "METAESTAT_ID_MEDIDA_VARIAVEL" "" 8 "METAESTAT_ID_MEDIDA_VARIAVEL" ""
9 - "CACHE" "sim"  
10 "TIP" "CD_LEGENDA" 9 "TIP" "CD_LEGENDA"
  10 + "CACHE" "sim"
11 "CLASSE" "SIM" 11 "CLASSE" "SIM"
12 "permitekmz" "sim" 12 "permitekmz" "sim"
13 - "iconetema" ""  
14 "ITENSDESC" "Bioma Teste de acentuação" 13 "ITENSDESC" "Bioma Teste de acentuação"
15 - "TILES" "SIM"  
16 "ESCALA" "1000000" 14 "ESCALA" "1000000"
  15 + "TILES" "SIM"
17 "METAESTAT_CODIGO_TIPO_REGIAO" "" 16 "METAESTAT_CODIGO_TIPO_REGIAO" ""
18 "extensao" "-76 -39 -29 9" 17 "extensao" "-76 -39 -29 9"
19 "permitedownload" "sim" 18 "permitedownload" "sim"
@@ -21,10 +20,10 @@ MAP @@ -21,10 +20,10 @@ MAP
21 "download" "sim" 20 "download" "sim"
22 "itembuscarapida" "CD_LEGENDA" 21 "itembuscarapida" "CD_LEGENDA"
23 "ITENS" "CD_LEGENDA" 22 "ITENS" "CD_LEGENDA"
24 - "permitekml" "sim"  
25 - "permiteogc" "sim"  
26 "transitioneffect" "SIM" 23 "transitioneffect" "SIM"
27 - "TEMA" "_Biomas SHP (acentução) teste" 24 + "permiteogc" "sim"
  25 + "permitekml" "sim"
  26 + "TEMA" "Biomas SHP (acentução) teste"
28 END # METADATA 27 END # METADATA
29 NAME "_lbiomashp" 28 NAME "_lbiomashp"
30 PROCESSING "ITEMS=CD_LEGENDA" 29 PROCESSING "ITEMS=CD_LEGENDA"