Commit 272dcb349d38ee5c0c5de361f6da9dea972898e8

Authored by Edmar Moretti
1 parent db4d5e5e

ajustes de validação de variáveis

admin/admin.db
No preview for this file type
admin/php/admin.php
@@ -38,8 +38,8 @@ if(!isset($locaplic) || !isset($dir_tmp)){ @@ -38,8 +38,8 @@ if(!isset($locaplic) || !isset($dir_tmp)){
38 include(dirname(__FILE__)."/../../ms_configura.php"); 38 include(dirname(__FILE__)."/../../ms_configura.php");
39 } 39 }
40 if(!file_exists($dir_tmp)){ 40 if(!file_exists($dir_tmp)){
41 - @mkdir ($dir_tmp,0777);  
42 - chmod($dir_tmp,0777); 41 + @mkdir ($dir_tmp,0774);
  42 + chmod($dir_tmp,0774);
43 } 43 }
44 include_once($locaplic."/classesphp/pega_variaveis.php"); 44 include_once($locaplic."/classesphp/pega_variaveis.php");
45 error_reporting(0); 45 error_reporting(0);
classesphp/mapa_openlayers.php
@@ -494,8 +494,8 @@ function salvaCacheImagem($cachedir,$map,$tms){ @@ -494,8 +494,8 @@ function salvaCacheImagem($cachedir,$map,$tms){
494 $nome = $cachedir.$tms; 494 $nome = $cachedir.$tms;
495 } 495 }
496 if(!file_exists($nome)){ 496 if(!file_exists($nome)){
497 - @mkdir(dirname($nome),0777,true);  
498 - chmod(dirname($nome),0777); 497 + @mkdir(dirname($nome),0774,true);
  498 + chmod(dirname($nome),0774);
499 $img->saveImage($nome); 499 $img->saveImage($nome);
500 // 500 //
501 //corta a imagem gerada para voltar ao tamanho normal 501 //corta a imagem gerada para voltar ao tamanho normal
@@ -503,7 +503,7 @@ function salvaCacheImagem($cachedir,$map,$tms){ @@ -503,7 +503,7 @@ function salvaCacheImagem($cachedir,$map,$tms){
503 if($cortePixels > 0){ 503 if($cortePixels > 0){
504 $img = cortaImagemDisco($nome,$cortePixels,256); 504 $img = cortaImagemDisco($nome,$cortePixels,256);
505 } 505 }
506 - chmod($nome,0777); 506 + chmod($nome,0774);
507 } 507 }
508 return $nome; 508 return $nome;
509 } 509 }
ferramentas/parametrossql/ogc.php
@@ -537,8 +537,8 @@ function salvaCacheImagem($cachedir,$map,$tms, $plugin, $tema){ @@ -537,8 +537,8 @@ function salvaCacheImagem($cachedir,$map,$tms, $plugin, $tema){
537 else{ 537 else{
538 $nome = $cachedir.$tms; 538 $nome = $cachedir.$tms;
539 } 539 }
540 - @mkdir(dirname($nome),0777,true);  
541 - chmod(dirname($nome),0777); 540 + @mkdir(dirname($nome),0774,true);
  541 + chmod(dirname($nome),0774);
542 $img->saveImage($nome); 542 $img->saveImage($nome);
543 // 543 //
544 //corta a imagem gerada para voltar ao tamanho normal 544 //corta a imagem gerada para voltar ao tamanho normal
@@ -555,7 +555,7 @@ function salvaCacheImagem($cachedir,$map,$tms, $plugin, $tema){ @@ -555,7 +555,7 @@ function salvaCacheImagem($cachedir,$map,$tms, $plugin, $tema){
555 imagecopy($imgc, $img, 0 , 0 , $cortePixels , $cortePixels , 256, 256); 555 imagecopy($imgc, $img, 0 , 0 , $cortePixels , $cortePixels , 256, 256);
556 imagepng($imgc,$nome); 556 imagepng($imgc,$nome);
557 } 557 }
558 - chmod($nome,0777); 558 + chmod($nome,0774);
559 header('Content-Length: '.filesize($nome)); 559 header('Content-Length: '.filesize($nome));
560 header('Content-Type: image/png'); 560 header('Content-Type: image/png');
561 header('Cache-Control: max-age=3600, must-revalidate'); 561 header('Cache-Control: max-age=3600, must-revalidate');
init/index.php
@@ -21,16 +21,16 @@ if (! empty ( $_GET ["customDir"] )) { @@ -21,16 +21,16 @@ if (! empty ( $_GET ["customDir"] )) {
21 $customDir = "interface"; 21 $customDir = "interface";
22 } 22 }
23 if (! file_exists ( $dir_tmp )) { 23 if (! file_exists ( $dir_tmp )) {
24 - @mkdir ( $dir_tmp, 0777 ); 24 + @mkdir ( $dir_tmp, 0774 );
25 } 25 }
26 if (file_exists ( $dir_tmp )) { 26 if (file_exists ( $dir_tmp )) {
27 - @mkdir ( $dir_tmp . "/comum", 0777 );  
28 - @mkdir ( $dir_tmp . "/saiku-datasources", 0777 );  
29 - chmod ( $dir_tmp . "/saiku-datasources", 0777 );  
30 - @mkdir ( $dir_tmp . "/cache", 0777 );  
31 - chmod ( $dir_tmp . "/cache", 0777 );  
32 - @mkdir ( $dir_tmp . "/cache/googlemaps", 0777 );  
33 - chmod ( $dir_tmp . "/cache/googlemaps", 0777 ); 27 + @mkdir ( $dir_tmp . "/comum", 0774 );
  28 + @mkdir ( $dir_tmp . "/saiku-datasources", 0774 );
  29 + chmod ( $dir_tmp . "/saiku-datasources", 0774 );
  30 + @mkdir ( $dir_tmp . "/cache", 0774 );
  31 + chmod ( $dir_tmp . "/cache", 0774 );
  32 + @mkdir ( $dir_tmp . "/cache/googlemaps", 0774 );
  33 + chmod ( $dir_tmp . "/cache/googlemaps", 0774 );
34 } 34 }
35 error_reporting ( 0 ); 35 error_reporting ( 0 );
36 include "head.php"; 36 include "head.php";
mapas/index.php
@@ -7,16 +7,16 @@ if (! empty ( $_GET ["customDir"] )) { @@ -7,16 +7,16 @@ if (! empty ( $_GET ["customDir"] )) {
7 $customDir = "interface"; 7 $customDir = "interface";
8 } 8 }
9 if (! file_exists ( $dir_tmp )) { 9 if (! file_exists ( $dir_tmp )) {
10 - @mkdir ( $dir_tmp, 0777 ); 10 + @mkdir ( $dir_tmp, 0774 );
11 } 11 }
12 if (file_exists ( $dir_tmp )) { 12 if (file_exists ( $dir_tmp )) {
13 - @mkdir ( $dir_tmp . "/comum", 0777 );  
14 - @mkdir ( $dir_tmp . "/saiku-datasources", 0777 );  
15 - chmod ( $dir_tmp . "/saiku-datasources", 0777 );  
16 - @mkdir ( $dir_tmp . "/cache", 0777 );  
17 - chmod ( $dir_tmp . "/cache", 0777 );  
18 - @mkdir ( $dir_tmp . "/cache/googlemaps", 0777 );  
19 - chmod ( $dir_tmp . "/cache/googlemaps", 0777 ); 13 + @mkdir ( $dir_tmp . "/comum", 0774 );
  14 + @mkdir ( $dir_tmp . "/saiku-datasources", 0774 );
  15 + chmod ( $dir_tmp . "/saiku-datasources", 0774 );
  16 + @mkdir ( $dir_tmp . "/cache", 0774 );
  17 + chmod ( $dir_tmp . "/cache", 0774 );
  18 + @mkdir ( $dir_tmp . "/cache/googlemaps", 0774 );
  19 + chmod ( $dir_tmp . "/cache/googlemaps", 0774 );
20 } 20 }
21 error_reporting ( 0 ); 21 error_reporting ( 0 );
22 include "../init/head.php"; 22 include "../init/head.php";
mashups/openlayers.php
@@ -41,16 +41,16 @@ $nocache = $parurl["nocache"]; @@ -41,16 +41,16 @@ $nocache = $parurl["nocache"];
41 41
42 //cria as pastas temporarias caso nao existam 42 //cria as pastas temporarias caso nao existam
43 if (! file_exists ( $dir_tmp )) { 43 if (! file_exists ( $dir_tmp )) {
44 - @mkdir ( $dir_tmp, 0777 ); 44 + @mkdir ( $dir_tmp, 0774 );
45 } 45 }
46 if (file_exists ( $dir_tmp )) { 46 if (file_exists ( $dir_tmp )) {
47 - @mkdir ( $dir_tmp . "/comum", 0777 );  
48 - @mkdir ( $dir_tmp . "/saiku-datasources", 0777 );  
49 - chmod ( $dir_tmp . "/saiku-datasources", 0777 );  
50 - @mkdir ( $dir_tmp . "/cache", 0777 );  
51 - chmod ( $dir_tmp . "/cache", 0777 );  
52 - @mkdir ( $dir_tmp . "/cache/googlemaps", 0777 );  
53 - chmod ( $dir_tmp . "/cache/googlemaps", 0777 ); 47 + @mkdir ( $dir_tmp . "/comum", 0774 );
  48 + @mkdir ( $dir_tmp . "/saiku-datasources", 0774 );
  49 + chmod ( $dir_tmp . "/saiku-datasources", 0774 );
  50 + @mkdir ( $dir_tmp . "/cache", 0774 );
  51 + chmod ( $dir_tmp . "/cache", 0774 );
  52 + @mkdir ( $dir_tmp . "/cache/googlemaps", 0774 );
  53 + chmod ( $dir_tmp . "/cache/googlemaps", 0774 );
54 } 54 }
55 if(!empty($desligacache)){ 55 if(!empty($desligacache)){
56 $DESLIGACACHE = $desligacache; 56 $DESLIGACACHE = $desligacache;
mashups/openlayers3.php
@@ -40,16 +40,16 @@ $legendahtml = $parurl["legendahtml"]; @@ -40,16 +40,16 @@ $legendahtml = $parurl["legendahtml"];
40 $nocache = $parurl["nocache"]; 40 $nocache = $parurl["nocache"];
41 //cria as pastas temporarias caso nao existam 41 //cria as pastas temporarias caso nao existam
42 if (! file_exists ( $dir_tmp )) { 42 if (! file_exists ( $dir_tmp )) {
43 - @mkdir ( $dir_tmp, 0777 ); 43 + @mkdir ( $dir_tmp, 0774 );
44 } 44 }
45 if (file_exists ( $dir_tmp )) { 45 if (file_exists ( $dir_tmp )) {
46 - @mkdir ( $dir_tmp . "/comum", 0777 );  
47 - @mkdir ( $dir_tmp . "/saiku-datasources", 0777 );  
48 - chmod ( $dir_tmp . "/saiku-datasources", 0777 );  
49 - @mkdir ( $dir_tmp . "/cache", 0777 );  
50 - chmod ( $dir_tmp . "/cache", 0777 );  
51 - @mkdir ( $dir_tmp . "/cache/googlemaps", 0777 );  
52 - chmod ( $dir_tmp . "/cache/googlemaps", 0777 ); 46 + @mkdir ( $dir_tmp . "/comum", 0774 );
  47 + @mkdir ( $dir_tmp . "/saiku-datasources", 0774 );
  48 + chmod ( $dir_tmp . "/saiku-datasources", 0774 );
  49 + @mkdir ( $dir_tmp . "/cache", 0774 );
  50 + chmod ( $dir_tmp . "/cache", 0774 );
  51 + @mkdir ( $dir_tmp . "/cache/googlemaps", 0774 );
  52 + chmod ( $dir_tmp . "/cache/googlemaps", 0774 );
53 } 53 }
54 if(!empty($desligacache)){ 54 if(!empty($desligacache)){
55 $DESLIGACACHE = $desligacache; 55 $DESLIGACACHE = $desligacache;
mashups/osm.php
@@ -11,16 +11,16 @@ include_once(dirname(__FILE__)."/../classesphp/funcoes_gerais.php"); @@ -11,16 +11,16 @@ include_once(dirname(__FILE__)."/../classesphp/funcoes_gerais.php");
11 error_reporting(0); 11 error_reporting(0);
12 //cria as pastas temporarias caso nao existam 12 //cria as pastas temporarias caso nao existam
13 if (! file_exists ( $dir_tmp )) { 13 if (! file_exists ( $dir_tmp )) {
14 - @mkdir ( $dir_tmp, 0777 ); 14 + @mkdir ( $dir_tmp, 0774 );
15 } 15 }
16 if (file_exists ( $dir_tmp )) { 16 if (file_exists ( $dir_tmp )) {
17 - @mkdir ( $dir_tmp . "/comum", 0777 );  
18 - @mkdir ( $dir_tmp . "/saiku-datasources", 0777 );  
19 - chmod ( $dir_tmp . "/saiku-datasources", 0777 );  
20 - @mkdir ( $dir_tmp . "/cache", 0777 );  
21 - chmod ( $dir_tmp . "/cache", 0777 );  
22 - @mkdir ( $dir_tmp . "/cache/googlemaps", 0777 );  
23 - chmod ( $dir_tmp . "/cache/googlemaps", 0777 ); 17 + @mkdir ( $dir_tmp . "/comum", 0774 );
  18 + @mkdir ( $dir_tmp . "/saiku-datasources", 0774 );
  19 + chmod ( $dir_tmp . "/saiku-datasources", 0774 );
  20 + @mkdir ( $dir_tmp . "/cache", 0774 );
  21 + chmod ( $dir_tmp . "/cache", 0774 );
  22 + @mkdir ( $dir_tmp . "/cache/googlemaps", 0774 );
  23 + chmod ( $dir_tmp . "/cache/googlemaps", 0774 );
24 } 24 }
25 //variaveis utilizadas 25 //variaveis utilizadas
26 $parurl = array_merge($_GET,$_POST); 26 $parurl = array_merge($_GET,$_POST);
ms_criamapa.php
@@ -1366,33 +1366,33 @@ Retorno: @@ -1366,33 +1366,33 @@ Retorno:
1366 function criaDirMapa($dir_tmp,$cachedir="") 1366 function criaDirMapa($dir_tmp,$cachedir="")
1367 { 1367 {
1368 if(!file_exists($dir_tmp)){ 1368 if(!file_exists($dir_tmp)){
1369 - @mkdir ($dir_tmp,0777); 1369 + @mkdir ($dir_tmp,0774);
1370 } 1370 }
1371 if(file_exists($dir_tmp)) 1371 if(file_exists($dir_tmp))
1372 { 1372 {
1373 $tmpdirname = nomeRandomico(); 1373 $tmpdirname = nomeRandomico();
1374 - $crdir = @mkdir ($dir_tmp."/".$tmpdirname,0777);  
1375 - chmod($dir_tmp."/".$tmpdirname,0777);  
1376 - $crdiri = @mkdir ($dir_tmp."/img".$tmpdirname,0777);  
1377 - chmod($dir_tmp."/img".$tmpdirname,0777); 1374 + $crdir = @mkdir ($dir_tmp."/".$tmpdirname,0774);
  1375 + chmod($dir_tmp."/".$tmpdirname,0774);
  1376 + $crdiri = @mkdir ($dir_tmp."/img".$tmpdirname,0774);
  1377 + chmod($dir_tmp."/img".$tmpdirname,0774);
1378 $mapfile = $dir_tmp."/".$tmpdirname."/".$tmpdirname.".map"; 1378 $mapfile = $dir_tmp."/".$tmpdirname."/".$tmpdirname.".map";
1379 $tmpimgname = "img".$tmpdirname; 1379 $tmpimgname = "img".$tmpdirname;
1380 - @mkdir($dir_tmp."/comum",0777); 1380 + @mkdir($dir_tmp."/comum",0774);
1381 //utilizado para armazenar os arquivos de fonte de dados do SAIKU 1381 //utilizado para armazenar os arquivos de fonte de dados do SAIKU
1382 - @mkdir($dir_tmp."/saiku-datasources",0777);  
1383 - chmod($dir_tmp."/saiku-datasources",0777); 1382 + @mkdir($dir_tmp."/saiku-datasources",0774);
  1383 + chmod($dir_tmp."/saiku-datasources",0774);
1384 // 1384 //
1385 if($cachedir == ""){ 1385 if($cachedir == ""){
1386 - @mkdir($dir_tmp."/cache",0777);  
1387 - chmod($dir_tmp."/cache",0777);  
1388 - @mkdir($dir_tmp."/cache/googlemaps",0777);  
1389 - chmod($dir_tmp."/cache/googlemaps",0777); 1386 + @mkdir($dir_tmp."/cache",0774);
  1387 + chmod($dir_tmp."/cache",0774);
  1388 + @mkdir($dir_tmp."/cache/googlemaps",0774);
  1389 + chmod($dir_tmp."/cache/googlemaps",0774);
1390 } 1390 }
1391 else{ 1391 else{
1392 - @mkdir($cachedir,0777);  
1393 - chmod($cachedir,0777);  
1394 - @mkdir($cachedir."/googlemaps",0777);  
1395 - chmod($cachedir."/googlemaps",0777); 1392 + @mkdir($cachedir,0774);
  1393 + chmod($cachedir,0774);
  1394 + @mkdir($cachedir."/googlemaps",0774);
  1395 + chmod($cachedir."/googlemaps",0774);
1396 } 1396 }
1397 if(file_exists($dir_tmp."/".$tmpdirname)) 1397 if(file_exists($dir_tmp."/".$tmpdirname))
1398 return array($mapfile,$tmpdirname,$tmpimgname); 1398 return array($mapfile,$tmpdirname,$tmpimgname);
@@ -1223,8 +1223,8 @@ function salvaCacheImagem($cachedir,$map,$tms){ @@ -1223,8 +1223,8 @@ function salvaCacheImagem($cachedir,$map,$tms){
1223 else{ 1223 else{
1224 $nome = $cachedir.$tms; 1224 $nome = $cachedir.$tms;
1225 } 1225 }
1226 - @mkdir(dirname($nome),0777,true);  
1227 - chmod(dirname($nome),0777); 1226 + @mkdir(dirname($nome),0774,true);
  1227 + chmod(dirname($nome),0774);
1228 $img->saveImage($nome); 1228 $img->saveImage($nome);
1229 // 1229 //
1230 //corta a imagem gerada para voltar ao tamanho normal 1230 //corta a imagem gerada para voltar ao tamanho normal
permlinks/index.php
@@ -7,16 +7,16 @@ if (! empty ( $_GET ["customDir"] )) { @@ -7,16 +7,16 @@ if (! empty ( $_GET ["customDir"] )) {
7 $customDir = "interface"; 7 $customDir = "interface";
8 } 8 }
9 if (! file_exists ( $dir_tmp )) { 9 if (! file_exists ( $dir_tmp )) {
10 - @mkdir ( $dir_tmp, 0777 ); 10 + @mkdir ( $dir_tmp, 0774 );
11 } 11 }
12 if (file_exists ( $dir_tmp )) { 12 if (file_exists ( $dir_tmp )) {
13 - @mkdir ( $dir_tmp . "/comum", 0777 );  
14 - @mkdir ( $dir_tmp . "/saiku-datasources", 0777 );  
15 - chmod ( $dir_tmp . "/saiku-datasources", 0777 );  
16 - @mkdir ( $dir_tmp . "/cache", 0777 );  
17 - chmod ( $dir_tmp . "/cache", 0777 );  
18 - @mkdir ( $dir_tmp . "/cache/googlemaps", 0777 );  
19 - chmod ( $dir_tmp . "/cache/googlemaps", 0777 ); 13 + @mkdir ( $dir_tmp . "/comum", 0774 );
  14 + @mkdir ( $dir_tmp . "/saiku-datasources", 0774 );
  15 + chmod ( $dir_tmp . "/saiku-datasources", 0774 );
  16 + @mkdir ( $dir_tmp . "/cache", 0774 );
  17 + chmod ( $dir_tmp . "/cache", 0774 );
  18 + @mkdir ( $dir_tmp . "/cache/googlemaps", 0774 );
  19 + chmod ( $dir_tmp . "/cache/googlemaps", 0774 );
20 } 20 }
21 error_reporting ( 0 ); 21 error_reporting ( 0 );
22 include "../init/head.php"; 22 include "../init/head.php";
testainstal/index.php
@@ -221,10 +221,10 @@ HTML; @@ -221,10 +221,10 @@ HTML;
221 if(!empty($_POST["criaPastaMstmp"]) && $_POST["criaPastaMstmp"] == "on"){ 221 if(!empty($_POST["criaPastaMstmp"]) && $_POST["criaPastaMstmp"] == "on"){
222 echo "Criando a pasta $dir_tmp"; 222 echo "Criando a pasta $dir_tmp";
223 if(!file_exists($dir_tmp)){ 223 if(!file_exists($dir_tmp)){
224 - @mkdir ($dir_tmp,0777); 224 + @mkdir ($dir_tmp,0774);
225 } 225 }
226 else{ 226 else{
227 - chmod($dir_tmp,0777); 227 + chmod($dir_tmp,0774);
228 } 228 }
229 if(!file_exists($dir_tmp)){ 229 if(!file_exists($dir_tmp)){
230 echo "<span style=color:red >Arquivo $dir_tmp n&atilde;o pode ser criado"; 230 echo "<span style=color:red >Arquivo $dir_tmp n&atilde;o pode ser criado";
@@ -243,7 +243,7 @@ HTML; @@ -243,7 +243,7 @@ HTML;
243 @symlink($dir_tmp,$d); 243 @symlink($dir_tmp,$d);
244 } 244 }
245 else{ 245 else{
246 - chmod($d,0777); 246 + chmod($d,0774);
247 } 247 }
248 if(!file_exists($d)){ 248 if(!file_exists($d)){
249 echo "<span style=color:red >Link $d n&atilde;o pode ser criado\n"; 249 echo "<span style=color:red >Link $d n&atilde;o pode ser criado\n";
@@ -258,10 +258,10 @@ HTML; @@ -258,10 +258,10 @@ HTML;
258 if(!empty($_POST["criaPastaMstmp"]) && $_POST["permPastaI3geo"] == "on"){ 258 if(!empty($_POST["criaPastaMstmp"]) && $_POST["permPastaI3geo"] == "on"){
259 echo "Alterando permiss&otilde;es i3geo i3geo/temas i3geo/admin i3geo/admin/admin.db\n"; 259 echo "Alterando permiss&otilde;es i3geo i3geo/temas i3geo/admin i3geo/admin/admin.db\n";
260 if(file_exists($locaplic)){ 260 if(file_exists($locaplic)){
261 - chmod($locaplic,0777);  
262 - chmod($locaplic."/temas",0777);  
263 - chmod($locaplic."/admin",0777);  
264 - chmod($locaplic."/admin/admin.db",0777); 261 + chmod($locaplic,0774);
  262 + chmod($locaplic."/temas",0774);
  263 + chmod($locaplic."/admin",0774);
  264 + chmod($locaplic."/admin/admin.db",0774);
265 echo "...OK\n"; 265 echo "...OK\n";
266 } 266 }
267 } 267 }