Commit ddb3012e126377791210386bc831668a28285d26
1 parent
897094af
Exists in
master
and in
7 other branches
Correção na obtenção do código da conexão e inclusão de maior restrição ao uso d…
…a ferramenta de upload de shapefile
Showing
6 changed files
with
28 additions
and
16 deletions
Show diff stats
admin/admin.db
No preview for this file type
admin/html/estat_editor.html
... | ... | @@ -91,6 +91,6 @@ body { |
91 | 91 | document.getElementById("formulario").style.display = "block"; |
92 | 92 | i3GEOadmin.editor.inicia(); |
93 | 93 | }; |
94 | - i3GEO.login.verificaOperacao("admin/metaestat/geral",i3GEO.configura.locaplic, temp, "sessao",i3GEO.login.dialogo.abreLogin); | |
94 | + i3GEO.login.verificaOperacao("admin/metaestat/editorbanco",i3GEO.configura.locaplic, temp, "sessao",i3GEO.login.dialogo.abreLogin); | |
95 | 95 | </script> |
96 | 96 | </body> | ... | ... |
admin/html/estat_editor_.html
... | ... | @@ -89,6 +89,6 @@ body { |
89 | 89 | document.getElementById("formulario").style.display = "block"; |
90 | 90 | i3GEOadmin.editor.inicia(); |
91 | 91 | }; |
92 | - i3GEO.login.verificaOperacao("admin/metaestat/geral",i3GEO.configura.locaplic, temp, "sessao",i3GEO.login.dialogo.abreLogin); | |
92 | + i3GEO.login.verificaOperacao("admin/metaestat/editorbanco",i3GEO.configura.locaplic, temp, "sessao",i3GEO.login.dialogo.abreLogin); | |
93 | 93 | </script> |
94 | 94 | </body> | ... | ... |
admin/js/estat_editor.js
... | ... | @@ -600,7 +600,7 @@ i3GEOadmin.editor = { |
600 | 600 | '</fieldset>' + |
601 | 601 | '<fieldset class=subbloco >' + |
602 | 602 | '<legend>Projeção</legend>' + |
603 | - '<p class="paragrafo" >Se voc� n�o escolheu o arquivo PRJ escolha o código da projeção (SRID) do arquivo</p>' + | |
603 | + '<p class="paragrafo" >Se você não escolheu o arquivo PRJ escolha o código da projeção (SRID) do arquivo</p>' + | |
604 | 604 | '<input class=digitar type="text" value="4326" size=20 id="insrid" name="insrid" style="top:0px;left:0px;cursor:pointer;float:left;margin-right:10px;"><div id=selInSrid ></div>' + |
605 | 605 | '<p class="paragrafo" >Projetar o arquivo para (deixe em branco se você não quiser aplicar nenhuma transformação de projeção):</p>' + |
606 | 606 | '<input class=digitar type="text" value="" size=20 id="outsrid" name="outsrid" style="top:0px;left:0px;cursor:pointer;float:left;margin-right:10px;"><div id=selOutSrid ></div>' + | ... | ... |
admin/php/classe_metaestat.php
... | ... | @@ -2220,7 +2220,7 @@ class Metaestat{ |
2220 | 2220 | * @return execSQLDB |
2221 | 2221 | */ |
2222 | 2222 | function esquemasConexao($codigo_estat_conexao){ |
2223 | - return $this->execSQLDB($codigo_estat_conexao,"SELECT oid,nspname as esquema FROM pg_namespace group by nspname,oid order by nspname"); | |
2223 | + return $this->execSQLDB($codigo_estat_conexao,"SELECT oid,nspname as esquema FROM pg_namespace WHERE nspname NOT LIKE 'pg_%' AND nspname NOT LIKE '%_schema%' group by nspname,oid order by nspname"); | |
2224 | 2224 | } |
2225 | 2225 | /** |
2226 | 2226 | * Cria um novo esquema no banco de dados |
... | ... | @@ -2239,9 +2239,9 @@ class Metaestat{ |
2239 | 2239 | * @return execSQLDB |
2240 | 2240 | */ |
2241 | 2241 | function tabelasEsquema($codigo_estat_conexao,$nome_esquema,$excluigeom=""){ |
2242 | - $sql = "SELECT table_name as tabela FROM information_schema.tables where table_schema = '$nome_esquema'"; | |
2242 | + $sql = "SELECT table_name as tabela FROM information_schema.tables where table_schema = '$nome_esquema' AND table_schema NOT LIKE 'i3geo%' AND table_schema NOT LIKE 'pg_%' AND table_schema NOT LIKE '%_schema%'"; | |
2243 | 2243 | if(strtolower($excluigeom) == "sim"){ |
2244 | - $sql = "SELECT c.table_name as tabela FROM information_schema.tables as c left join (SELECT distinct a.table_name FROM information_schema.tables as a left join information_schema.columns as b on a.table_name = b.table_name where a.table_schema = '$nome_esquema' and udt_name = 'geometry' ) as d on c.table_name = d.table_name where c.table_schema = '$nome_esquema' and d.table_name is null"; | |
2244 | + $sql = "SELECT c.table_name as tabela FROM information_schema.tables as c left join (SELECT distinct a.table_name FROM information_schema.tables as a left join information_schema.columns as b on a.table_name = b.table_name where a.table_schema = '$nome_esquema' and udt_name = 'geometry' ) as d on c.table_name = d.table_name where c.table_schema = '$nome_esquema' AND c.table_schema NOT LIKE 'i3geo%' AND c.table_schema NOT LIKE 'pg_%' AND c.table_schema NOT LIKE '%_schema%' and d.table_name is null"; | |
2245 | 2245 | } |
2246 | 2246 | return $this->execSQLDB($codigo_estat_conexao,$sql); |
2247 | 2247 | } | ... | ... |
admin/php/metaestat.php
... | ... | @@ -38,7 +38,7 @@ Cada opera&ccedil;&atilde;o possu&iacute; seus proprios par&acirc;metros, que de |
38 | 38 | */ |
39 | 39 | include_once(dirname(__FILE__)."/login.php"); |
40 | 40 | |
41 | -$codigo_estat_conexao = $_GET["codigo_estat_conexao"]; | |
41 | +$codigo_estat_conexao = $_GET["codigo_estat_conexao"];//pode ser string ou numerico | |
42 | 42 | $codigo_variavel = $_GET["codigo_variavel"]; |
43 | 43 | $codigo_tipo_periodo = $_GET["codigo_tipo_periodo"]; |
44 | 44 | $codigo_tipo_regiao = $_GET["codigo_tipo_regiao"]; |
... | ... | @@ -56,7 +56,7 @@ $id_mapa_grupo = $_GET["id_mapa_grupo"]; |
56 | 56 | $id_mapa_tema = $_GET["id_mapa_tema"]; |
57 | 57 | $id_pai = $_GET["id_pai"]; |
58 | 58 | |
59 | -testaSafeNumerico([$codigo_tipo_regiao_pai,$id_pai,$id_mapa_tema,$id_mapa_grupo,$id_mapa,$id_agregaregiao,$codigo_tipo_regiao,$codigo_tipo_periodo,$id_fonteinfo,$codigo_unidade_medida,$codigo_estat_conexao,$codigo_variavel,$id_medida_variavel,$id_classificacao,$id_link,$id_classe,$id_parametro_medida]); | |
59 | +testaSafeNumerico([$codigo_tipo_regiao_pai,$id_pai,$id_mapa_tema,$id_mapa_grupo,$id_mapa,$id_agregaregiao,$codigo_tipo_regiao,$codigo_tipo_periodo,$id_fonteinfo,$codigo_unidade_medida,$codigo_variavel,$id_medida_variavel,$id_classificacao,$id_link,$id_classe,$id_parametro_medida]); | |
60 | 60 | |
61 | 61 | //lista de funcoes que passam pela validacao de login |
62 | 62 | $funcoesEdicao = array( |
... | ... | @@ -93,13 +93,6 @@ $funcoesEdicao = array( |
93 | 93 | "EXCLUIRCLASSIFICACAOMEDIDA", |
94 | 94 | "EXCLUIRCLASSECLASSIFICACAO", |
95 | 95 | "EXCLUIRLINKMEDIDA", |
96 | - "CRIATABELADB", | |
97 | - "CRIAESQUEMADB", | |
98 | - "ALTERANOMETABELADB", | |
99 | - "ALTERANOMEESQUEMADB", | |
100 | - "COPIATABELADB", | |
101 | - "CRIACOLUNADB", | |
102 | - "ALTERANOMECOLUNADB", | |
103 | 96 | "OBTEMDADOSTABELADB", |
104 | 97 | "INSERIRDADOS", |
105 | 98 | "MANTEMDADOSREGIAO", |
... | ... | @@ -122,7 +115,7 @@ if(in_array(strtoupper($funcao),$funcoesEdicao)){ |
122 | 115 | retornaJSON($esquema);exit; |
123 | 116 | } |
124 | 117 | if(strtoupper($funcao) == "TABELASESQUEMA"){ |
125 | - if($nome_esquema != "public"){ | |
118 | + if($_GET["nome_esquema"] != "public"){ | |
126 | 119 | retornaJSON("Vc nao pode realizar essa operacao.");exit; |
127 | 120 | } |
128 | 121 | } |
... | ... | @@ -131,6 +124,25 @@ if(in_array(strtoupper($funcao),$funcoesEdicao)){ |
131 | 124 | } |
132 | 125 | } |
133 | 126 | } |
127 | +//verifica as funcoes que manipulam o banco de dados | |
128 | +$funcoesEdicao = array( | |
129 | + "CRIATABELADB", | |
130 | + "CRIAESQUEMADB", | |
131 | + "ALTERANOMETABELADB", | |
132 | + "ALTERANOMEESQUEMADB", | |
133 | + "COPIATABELADB", | |
134 | + "CRIACOLUNADB", | |
135 | + "ALTERANOMECOLUNADB", | |
136 | +); | |
137 | +if(in_array(strtoupper($funcao),$funcoesEdicao)){ | |
138 | + if(verificaOperacaoSessao("admin/metaestat/editorbanco") == false){ | |
139 | + retornaJSON("Vc nao pode realizar essa operacao.");exit; | |
140 | + } | |
141 | +} | |
142 | + | |
143 | + | |
144 | + | |
145 | + | |
134 | 146 | include(dirname(__FILE__)."/classe_metaestat.php"); |
135 | 147 | error_reporting(0); |
136 | 148 | //faz a busca da função que deve ser executada | ... | ... |