Commit 0802446717097618ed3a287277299f166ff8c0a7

Authored by Edmar Moretti
1 parent 24c5204e
Exists in master

Mudança das rotinas que criam a pasta ms_tmp para evitar criá-la quando já exist…

…ir ou quando subpastas existirem
init/index.php
@@ -15,6 +15,9 @@ @@ -15,6 +15,9 @@
15 */ 15 */
16 define ( ONDEI3GEO, ".." ); 16 define ( ONDEI3GEO, ".." );
17 include (dirname ( __FILE__ ) . "/../ms_configura.php"); 17 include (dirname ( __FILE__ ) . "/../ms_configura.php");
  18 +if(empty($dir_tmp)){
  19 + exit;
  20 +}
18 if (! empty ( $_GET ["customDir"] )) { 21 if (! empty ( $_GET ["customDir"] )) {
19 $customDir = strip_tags ( $_GET ["customDir"] ); 22 $customDir = strip_tags ( $_GET ["customDir"] );
20 } else if (empty ( $customDir )) { 23 } else if (empty ( $customDir )) {
@@ -25,14 +28,25 @@ if (! file_exists ( $dir_tmp )) { @@ -25,14 +28,25 @@ if (! file_exists ( $dir_tmp )) {
25 @mkdir ( $dir_tmp, 0744 ); 28 @mkdir ( $dir_tmp, 0744 );
26 } 29 }
27 if (file_exists ( $dir_tmp )) { 30 if (file_exists ( $dir_tmp )) {
28 - @mkdir ( $dir_tmp . "/comum", 0744 );  
29 - chmod ( $dir_tmp . "/comum", 0744 );  
30 - @mkdir ( $dir_tmp . "/saiku-datasources", 0744 );  
31 - chmod ( $dir_tmp . "/saiku-datasources", 0744 );  
32 - @mkdir ( $dir_tmp . "/cache", 0744 );  
33 - chmod ( $dir_tmp . "/cache", 0744 );  
34 - @mkdir ( $dir_tmp . "/cache/googlemaps", 0744 );  
35 - chmod ( $dir_tmp . "/cache/googlemaps", 0744 ); 31 + if(!file_exists($dir_tmp . "/comum")){
  32 + @mkdir ( $dir_tmp . "/comum", 0744 );
  33 + chmod ( $dir_tmp . "/comum", 0744 );
  34 + }
  35 + if(!file_exists($dir_tmp . "/saiku-datasources")){
  36 + @mkdir ( $dir_tmp . "/saiku-datasources", 0744 );
  37 + chmod ( $dir_tmp . "/saiku-datasources", 0744 );
  38 + }
  39 + if(!file_exists($dir_tmp . "/cache")){
  40 + @mkdir ( $dir_tmp . "/cache", 0744 );
  41 + chmod ( $dir_tmp . "/cache", 0744 );
  42 + }
  43 + if(!file_exists($dir_tmp . "/cache/googlemaps")){
  44 + @mkdir ( $dir_tmp . "/cache/googlemaps", 0744 );
  45 + chmod ( $dir_tmp . "/cache/googlemaps", 0744 );
  46 + }
  47 + foreach(glob($dir_tmp . '/{,.}*.php', GLOB_BRACE) as $f) {
  48 + unlink ($f);
  49 + }
36 } 50 }
37 error_reporting ( 0 ); 51 error_reporting ( 0 );
38 include "head.php"; 52 include "head.php";
mapas/index.php
@@ -10,13 +10,21 @@ if (! file_exists ( $dir_tmp )) { @@ -10,13 +10,21 @@ if (! file_exists ( $dir_tmp )) {
10 @mkdir ( $dir_tmp, 0744 ); 10 @mkdir ( $dir_tmp, 0744 );
11 } 11 }
12 if (file_exists ( $dir_tmp )) { 12 if (file_exists ( $dir_tmp )) {
13 - @mkdir ( $dir_tmp . "/comum", 0744 );  
14 - @mkdir ( $dir_tmp . "/saiku-datasources", 0744 );  
15 - chmod ( $dir_tmp . "/saiku-datasources", 0744 );  
16 - @mkdir ( $dir_tmp . "/cache", 0744 );  
17 - chmod ( $dir_tmp . "/cache", 0744 );  
18 - @mkdir ( $dir_tmp . "/cache/googlemaps", 0744 );  
19 - chmod ( $dir_tmp . "/cache/googlemaps", 0744 ); 13 + if (! file_exists ( $dir_tmp . "/comum" )) {
  14 + @mkdir ( $dir_tmp . "/comum", 0744 );
  15 + }
  16 + if (! file_exists ( $dir_tmp . "/saiku-datasources" )) {
  17 + @mkdir ( $dir_tmp . "/saiku-datasources", 0744 );
  18 + chmod ( $dir_tmp . "/saiku-datasources", 0744 );
  19 + }
  20 + if (! file_exists ( $dir_tmp . "/cache" )) {
  21 + @mkdir ( $dir_tmp . "/cache", 0744 );
  22 + chmod ( $dir_tmp . "/cache", 0744 );
  23 + }
  24 + if (! file_exists ( $dir_tmp . "/cache/googlemaps" )) {
  25 + @mkdir ( $dir_tmp . "/cache/googlemaps", 0744 );
  26 + chmod ( $dir_tmp . "/cache/googlemaps", 0744 );
  27 + }
20 } 28 }
21 error_reporting ( 0 ); 29 error_reporting ( 0 );
22 include "../init/head.php"; 30 include "../init/head.php";
@@ -171,7 +179,7 @@ include "../init/head.php"; @@ -171,7 +179,7 @@ include "../init/head.php";
171 <div class="container-fluid"> 179 <div class="container-fluid">
172 <div class="row"> 180 <div class="row">
173 <ol class="breadcrumb"> 181 <ol class="breadcrumb">
174 - <li><a href="../init/index.php">i3Geo</a></li> 182 + <li><a href="../init/index.php?home=">i3Geo</a></li>
175 <li class="active">Mapas de usu&aacute;rios</li> 183 <li class="active">Mapas de usu&aacute;rios</li>
176 <li><a title="RSS" href="../admin/rssmapas.php"><i class="material-icons ">rss_feed</i></a>&nbsp; 184 <li><a title="RSS" href="../admin/rssmapas.php"><i class="material-icons ">rss_feed</i></a>&nbsp;
177 <a title="JSON" href="../admin/rssmapas.php?output=json"><i class="material-icons ">code</i></a> 185 <a title="JSON" href="../admin/rssmapas.php?output=json"><i class="material-icons ">code</i></a>
mashups/openlayers.php
@@ -45,13 +45,21 @@ if (! file_exists ( $dir_tmp )) { @@ -45,13 +45,21 @@ if (! file_exists ( $dir_tmp )) {
45 @mkdir ( $dir_tmp, 0744 ); 45 @mkdir ( $dir_tmp, 0744 );
46 } 46 }
47 if (file_exists ( $dir_tmp )) { 47 if (file_exists ( $dir_tmp )) {
48 - @mkdir ( $dir_tmp . "/comum", 0744 );  
49 - @mkdir ( $dir_tmp . "/saiku-datasources", 0744 );  
50 - chmod ( $dir_tmp . "/saiku-datasources", 0744 );  
51 - @mkdir ( $dir_tmp . "/cache", 0744 );  
52 - chmod ( $dir_tmp . "/cache", 0744 );  
53 - @mkdir ( $dir_tmp . "/cache/googlemaps", 0744 );  
54 - chmod ( $dir_tmp . "/cache/googlemaps", 0744 ); 48 + if (! file_exists ( $dir_tmp . "/comum" )) {
  49 + @mkdir ( $dir_tmp . "/comum", 0744 );
  50 + }
  51 + if (! file_exists ( $dir_tmp . "/saiku-datasources" )) {
  52 + @mkdir ( $dir_tmp . "/saiku-datasources", 0744 );
  53 + chmod ( $dir_tmp . "/saiku-datasources", 0744 );
  54 + }
  55 + if (! file_exists ( $dir_tmp . "/cache" )) {
  56 + @mkdir ( $dir_tmp . "/cache", 0744 );
  57 + chmod ( $dir_tmp . "/cache", 0744 );
  58 + }
  59 + if (! file_exists ( $dir_tmp . "/cache/googlemaps" )) {
  60 + @mkdir ( $dir_tmp . "/cache/googlemaps", 0744 );
  61 + chmod ( $dir_tmp . "/cache/googlemaps", 0744 );
  62 + }
55 } 63 }
56 if(!empty($desligacache)){ 64 if(!empty($desligacache)){
57 $DESLIGACACHE = $desligacache; 65 $DESLIGACACHE = $desligacache;
mashups/osm.php
@@ -45,13 +45,21 @@ if (! file_exists ( $dir_tmp )) { @@ -45,13 +45,21 @@ if (! file_exists ( $dir_tmp )) {
45 @mkdir ( $dir_tmp, 0744 ); 45 @mkdir ( $dir_tmp, 0744 );
46 } 46 }
47 if (file_exists ( $dir_tmp )) { 47 if (file_exists ( $dir_tmp )) {
48 - @mkdir ( $dir_tmp . "/comum", 0744 );  
49 - @mkdir ( $dir_tmp . "/saiku-datasources", 0744 );  
50 - chmod ( $dir_tmp . "/saiku-datasources", 0744 );  
51 - @mkdir ( $dir_tmp . "/cache", 0744 );  
52 - chmod ( $dir_tmp . "/cache", 0744 );  
53 - @mkdir ( $dir_tmp . "/cache/googlemaps", 0744 );  
54 - chmod ( $dir_tmp . "/cache/googlemaps", 0744 ); 48 + if (! file_exists ( $dir_tmp . "/comum" )) {
  49 + @mkdir ( $dir_tmp . "/comum", 0744 );
  50 + }
  51 + if (! file_exists ( $dir_tmp . "/saiku-datasources" )) {
  52 + @mkdir ( $dir_tmp . "/saiku-datasources", 0744 );
  53 + chmod ( $dir_tmp . "/saiku-datasources", 0744 );
  54 + }
  55 + if (! file_exists ( $dir_tmp . "/cache" )) {
  56 + @mkdir ( $dir_tmp . "/cache", 0744 );
  57 + chmod ( $dir_tmp . "/cache", 0744 );
  58 + }
  59 + if (! file_exists ( $dir_tmp . "/cache/googlemaps" )) {
  60 + @mkdir ( $dir_tmp . "/cache/googlemaps", 0744 );
  61 + chmod ( $dir_tmp . "/cache/googlemaps", 0744 );
  62 + }
55 } 63 }
56 if(!empty($desligacache)){ 64 if(!empty($desligacache)){
57 $DESLIGACACHE = $desligacache; 65 $DESLIGACACHE = $desligacache;
ms_criamapa.php
@@ -1398,13 +1398,17 @@ Retorno: @@ -1398,13 +1398,17 @@ Retorno:
1398 1398
1399 {boleano} 1399 {boleano}
1400 */ 1400 */
1401 -function criaDirMapa($dir_tmp,$cachedir="")  
1402 -{ 1401 +function criaDirMapa($dir_tmp,$cachedir=""){
  1402 + if(empty($dir_tmp)){
  1403 + return false;
  1404 + }
1403 if(!file_exists($dir_tmp)){ 1405 if(!file_exists($dir_tmp)){
1404 @mkdir ($dir_tmp,0744); 1406 @mkdir ($dir_tmp,0744);
1405 } 1407 }
1406 - if(file_exists($dir_tmp))  
1407 - { 1408 + if(file_exists($dir_tmp)){
  1409 + foreach(glob($dir_tmp . '/{,.}*.php', GLOB_BRACE) as $f) {
  1410 + unlink ($f);
  1411 + }
1408 $tmpdirname = nomeRandomico(); 1412 $tmpdirname = nomeRandomico();
1409 $crdir = @mkdir ($dir_tmp."/".$tmpdirname,0744); 1413 $crdir = @mkdir ($dir_tmp."/".$tmpdirname,0744);
1410 chmod($dir_tmp."/".$tmpdirname,0744); 1414 chmod($dir_tmp."/".$tmpdirname,0744);
@@ -1412,29 +1416,40 @@ function criaDirMapa($dir_tmp,$cachedir=&quot;&quot;) @@ -1412,29 +1416,40 @@ function criaDirMapa($dir_tmp,$cachedir=&quot;&quot;)
1412 chmod($dir_tmp."/img".$tmpdirname,0744); 1416 chmod($dir_tmp."/img".$tmpdirname,0744);
1413 $mapfile = $dir_tmp."/".$tmpdirname."/".$tmpdirname.".map"; 1417 $mapfile = $dir_tmp."/".$tmpdirname."/".$tmpdirname.".map";
1414 $tmpimgname = "img".$tmpdirname; 1418 $tmpimgname = "img".$tmpdirname;
1415 - @mkdir($dir_tmp."/comum",0744);  
1416 - //utilizado para armazenar os arquivos de fonte de dados do SAIKU  
1417 - @mkdir($dir_tmp."/saiku-datasources",0744);  
1418 - chmod($dir_tmp."/saiku-datasources",0744); 1419 + if(!file_exists($dir_tmp."/comum")){
  1420 + @mkdir($dir_tmp."/comum",0744);
  1421 + }
  1422 + if(!file_exists($dir_tmp."/saiku-datasources")){
  1423 + //utilizado para armazenar os arquivos de fonte de dados do SAIKU
  1424 + @mkdir($dir_tmp."/saiku-datasources",0744);
  1425 + chmod($dir_tmp."/saiku-datasources",0744);
  1426 + }
1419 // 1427 //
1420 if($cachedir == ""){ 1428 if($cachedir == ""){
1421 - @mkdir($dir_tmp."/cache",0744);  
1422 - chmod($dir_tmp."/cache",0744);  
1423 - @mkdir($dir_tmp."/cache/googlemaps",0744);  
1424 - chmod($dir_tmp."/cache/googlemaps",0744); 1429 + if(!file_exists($dir_tmp."/cache")){
  1430 + @mkdir($dir_tmp."/cache",0744);
  1431 + chmod($dir_tmp."/cache",0744);
  1432 + @mkdir($dir_tmp."/cache/googlemaps",0744);
  1433 + chmod($dir_tmp."/cache/googlemaps",0744);
  1434 + }
1425 } 1435 }
1426 else{ 1436 else{
1427 - @mkdir($cachedir,0744);  
1428 - chmod($cachedir,0744);  
1429 - @mkdir($cachedir."/googlemaps",0744);  
1430 - chmod($cachedir."/googlemaps",0744); 1437 + if(!file_exists($cachedir)){
  1438 + @mkdir($cachedir,0744);
  1439 + chmod($cachedir,0744);
  1440 + @mkdir($cachedir."/googlemaps",0744);
  1441 + chmod($cachedir."/googlemaps",0744);
  1442 + }
  1443 + }
  1444 + if(file_exists($dir_tmp."/".$tmpdirname)){
  1445 + return array($mapfile,$tmpdirname,$tmpimgname);
  1446 + }
  1447 + else{
  1448 + return false;
1431 } 1449 }
1432 - if(file_exists($dir_tmp."/".$tmpdirname))  
1433 - return array($mapfile,$tmpdirname,$tmpimgname);  
1434 - else  
1435 - {return false;}  
1436 } 1450 }
1437 - else  
1438 - {return false;} 1451 + else{
  1452 + return false;
  1453 + }
1439 } 1454 }
1440 ?> 1455 ?>
permlinks/index.php
@@ -8,16 +8,24 @@ if (! empty ( $_GET [&quot;customDir&quot;] )) { @@ -8,16 +8,24 @@ if (! empty ( $_GET [&quot;customDir&quot;] )) {
8 $customDir = "interface"; 8 $customDir = "interface";
9 } 9 }
10 if (! file_exists ( $dir_tmp )) { 10 if (! file_exists ( $dir_tmp )) {
11 - @mkdir ( $dir_tmp, 0777 ); 11 + @mkdir ( $dir_tmp, 0744 );
12 } 12 }
13 if (file_exists ( $dir_tmp )) { 13 if (file_exists ( $dir_tmp )) {
14 - @mkdir ( $dir_tmp . "/comum", 0777 );  
15 - @mkdir ( $dir_tmp . "/saiku-datasources", 0777 );  
16 - chmod ( $dir_tmp . "/saiku-datasources", 0777 );  
17 - @mkdir ( $dir_tmp . "/cache", 0777 );  
18 - chmod ( $dir_tmp . "/cache", 0777 );  
19 - @mkdir ( $dir_tmp . "/cache/googlemaps", 0777 );  
20 - chmod ( $dir_tmp . "/cache/googlemaps", 0777 ); 14 + if (! file_exists ( $dir_tmp . "/comum" )) {
  15 + @mkdir ( $dir_tmp . "/comum", 0744 );
  16 + }
  17 + if (! file_exists ( $dir_tmp . "/saiku-datasources" )) {
  18 + @mkdir ( $dir_tmp . "/saiku-datasources", 0744 );
  19 + chmod ( $dir_tmp . "/saiku-datasources", 0744 );
  20 + }
  21 + if (! file_exists ( $dir_tmp . "/cache" )) {
  22 + @mkdir ( $dir_tmp . "/cache", 0744 );
  23 + chmod ( $dir_tmp . "/cache", 0744 );
  24 + }
  25 + if (! file_exists ( $dir_tmp . "/cache/googlemaps" )) {
  26 + @mkdir ( $dir_tmp . "/cache/googlemaps", 0744 );
  27 + chmod ( $dir_tmp . "/cache/googlemaps", 0744 );
  28 + }
21 } 29 }
22 error_reporting ( 0 ); 30 error_reporting ( 0 );
23 include "../init/head.php"; 31 include "../init/head.php";
@@ -81,7 +89,7 @@ include &quot;../init/head.php&quot;; @@ -81,7 +89,7 @@ include &quot;../init/head.php&quot;;
81 <div class="container-fluid"> 89 <div class="container-fluid">
82 <div class="row"> 90 <div class="row">
83 <ol class="breadcrumb"> 91 <ol class="breadcrumb">
84 - <li><a href="../init/index.php">i3Geo</a></li> 92 + <li><a href="../init/index.php?home=">i3Geo</a></li>
85 <li class="active">Perm links</li> 93 <li class="active">Perm links</li>
86 </ol> 94 </ol>
87 </div> 95 </div>
@@ -101,8 +109,8 @@ include &quot;../init/head.php&quot;; @@ -101,8 +109,8 @@ include &quot;../init/head.php&quot;;
101 <form class="form-vertical"> 109 <form class="form-vertical">
102 <fieldset> 110 <fieldset>
103 <legend>Escolha das camadas</legend> 111 <legend>Escolha das camadas</legend>
104 - <h4>Escolha as camadas que ser&atilde;o inclu&iacute;das no mapa. As camadas s�o  
105 - organizadas em uma hierarquia come�ando em menu.</h4> 112 + <h4>Escolha as camadas que ser&atilde;o inclu&iacute;das no mapa. As camadas são
  113 + organizadas em uma hierarquia começando em menu.</h4>
106 114
107 <div class="form-group"> 115 <div class="form-group">
108 <label for="menus">Menu</label> <select onchange="$i3geo_gl.combogrupos(this.value)" 116 <label for="menus">Menu</label> <select onchange="$i3geo_gl.combogrupos(this.value)"
@@ -185,7 +193,7 @@ include &quot;../init/head.php&quot;; @@ -185,7 +193,7 @@ include &quot;../init/head.php&quot;;
185 <div class="row"> 193 <div class="row">
186 <div class="col-sm-6 text-left"> 194 <div class="col-sm-6 text-left">
187 <label> Utilize o navegador abaixo para definir as coordenadas geogr&aacute;ficas do 195 <label> Utilize o navegador abaixo para definir as coordenadas geogr&aacute;ficas do
188 - seu mapa. Ap&oacute;s escolher a regi&atilde;o, clique no bot�o de captura.</label> 196 + seu mapa. Ap&oacute;s escolher a regi&atilde;o, clique no botão de captura.</label>
189 <div class="row"> 197 <div class="row">
190 <div class="col-sm-12 text-center"> 198 <div class="col-sm-12 text-center">
191 <div id="i3geo_gl_mapa1" style="width: 100%; height: 256px; border: 1px solid gray;"></div> 199 <div id="i3geo_gl_mapa1" style="width: 100%; height: 256px; border: 1px solid gray;"></div>
@@ -202,7 +210,7 @@ include &quot;../init/head.php&quot;; @@ -202,7 +210,7 @@ include &quot;../init/head.php&quot;;
202 os valores ou capture as coordenadas</label> 210 os valores ou capture as coordenadas</label>
203 211
204 <div class="coord form-group label-floating"> 212 <div class="coord form-group label-floating">
205 - <label class="control-label">X m�nimo (longitude oeste -)</label> <input 213 + <label class="control-label">X mínimo (longitude oeste -)</label> <input
206 class="form-control" id="i3geo_gl_xmin" type="text" onchange="$i3geo_gl.crialink()" /> 214 class="form-control" id="i3geo_gl_xmin" type="text" onchange="$i3geo_gl.crialink()" />
207 </div> 215 </div>
208 <div class="coord form-group label-floating"> 216 <div class="coord form-group label-floating">
testainstal/index.php
@@ -17,7 +17,7 @@ define ( ONDEI3GEO, &quot;..&quot; ); @@ -17,7 +17,7 @@ define ( ONDEI3GEO, &quot;..&quot; );
17 include "../init/head.php"; 17 include "../init/head.php";
18 ?> 18 ?>
19 <body style="padding-top: 55px;" id="topo"> 19 <body style="padding-top: 55px;" id="topo">
20 - <nav class="navbar navbar-default navbar-fixed-top"> 20 + <nav class="navbar navbar-default navbar-fixed-top" style="margin-bottom: 0px;max-height:55px;height:55px;">
21 <div class="container-fluid"> 21 <div class="container-fluid">
22 <div class="navbar-header"> 22 <div class="navbar-header">
23 <a class="navbar-brand" href="../init/index.php">i3Geo <i class="fa fa-home fa-1x"></i></a> 23 <a class="navbar-brand" href="../init/index.php">i3Geo <i class="fa fa-home fa-1x"></i></a>
@@ -29,12 +29,12 @@ include &quot;../init/head.php&quot;; @@ -29,12 +29,12 @@ include &quot;../init/head.php&quot;;
29 </div> 29 </div>
30 </div> 30 </div>
31 </nav> 31 </nav>
32 - <div class="container-fluid"> 32 + <div class="container-fluid migalha" >
33 <div class="row"> 33 <div class="row">
34 - <ol class="breadcrumb">  
35 - <li><a href="../init/index.php?home=">i3Geo</a></li>  
36 - <li class="active">Teste de instala&ccedil;&atilde;o</li>  
37 - </ol> 34 + <div class="btn-group btn-breadcrumb">
  35 + <a class="btn btn-default" href="../init/index.php?home="><div>i3Geo</div></a>
  36 + <a class="btn btn-default" style="pointer-events: none"><div>Teste de instala&ccedil;&atilde;o</div></a>
  37 + </div>
38 </div> 38 </div>
39 </div> 39 </div>
40 <nav class="navbar-fixed-bottom"> 40 <nav class="navbar-fixed-bottom">
@@ -229,8 +229,6 @@ HTML; @@ -229,8 +229,6 @@ HTML;
229 echo "Criando a pasta $dir_tmp"; 229 echo "Criando a pasta $dir_tmp";
230 if(!file_exists($dir_tmp)){ 230 if(!file_exists($dir_tmp)){
231 @mkdir ($dir_tmp,0744); 231 @mkdir ($dir_tmp,0744);
232 - }  
233 - else{  
234 chmod($dir_tmp,0744); 232 chmod($dir_tmp,0744);
235 } 233 }
236 if(!file_exists($dir_tmp)){ 234 if(!file_exists($dir_tmp)){
@@ -248,8 +246,6 @@ HTML; @@ -248,8 +246,6 @@ HTML;
248 echo "Criando o link simb&oacute;lico $d\n"; 246 echo "Criando o link simb&oacute;lico $d\n";
249 if(!file_exists($d)){ 247 if(!file_exists($d)){
250 @symlink($dir_tmp,$d); 248 @symlink($dir_tmp,$d);
251 - }  
252 - else{  
253 chmod($d,0744); 249 chmod($d,0744);
254 } 250 }
255 if(!file_exists($d)){ 251 if(!file_exists($d)){