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 15 */
16 16 define ( ONDEI3GEO, ".." );
17 17 include (dirname ( __FILE__ ) . "/../ms_configura.php");
  18 +if(empty($dir_tmp)){
  19 + exit;
  20 +}
18 21 if (! empty ( $_GET ["customDir"] )) {
19 22 $customDir = strip_tags ( $_GET ["customDir"] );
20 23 } else if (empty ( $customDir )) {
... ... @@ -25,14 +28,25 @@ if (! file_exists ( $dir_tmp )) {
25 28 @mkdir ( $dir_tmp, 0744 );
26 29 }
27 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 51 error_reporting ( 0 );
38 52 include "head.php";
... ...
mapas/index.php
... ... @@ -10,13 +10,21 @@ if (! file_exists ( $dir_tmp )) {
10 10 @mkdir ( $dir_tmp, 0744 );
11 11 }
12 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 29 error_reporting ( 0 );
22 30 include "../init/head.php";
... ... @@ -171,7 +179,7 @@ include "../init/head.php";
171 179 <div class="container-fluid">
172 180 <div class="row">
173 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 183 <li class="active">Mapas de usu&aacute;rios</li>
176 184 <li><a title="RSS" href="../admin/rssmapas.php"><i class="material-icons ">rss_feed</i></a>&nbsp;
177 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 45 @mkdir ( $dir_tmp, 0744 );
46 46 }
47 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 64 if(!empty($desligacache)){
57 65 $DESLIGACACHE = $desligacache;
... ...
mashups/osm.php
... ... @@ -45,13 +45,21 @@ if (! file_exists ( $dir_tmp )) {
45 45 @mkdir ( $dir_tmp, 0744 );
46 46 }
47 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 64 if(!empty($desligacache)){
57 65 $DESLIGACACHE = $desligacache;
... ...
ms_criamapa.php
... ... @@ -1398,13 +1398,17 @@ Retorno:
1398 1398  
1399 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 1405 if(!file_exists($dir_tmp)){
1404 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 1412 $tmpdirname = nomeRandomico();
1409 1413 $crdir = @mkdir ($dir_tmp."/".$tmpdirname,0744);
1410 1414 chmod($dir_tmp."/".$tmpdirname,0744);
... ... @@ -1412,29 +1416,40 @@ function criaDirMapa($dir_tmp,$cachedir=&quot;&quot;)
1412 1416 chmod($dir_tmp."/img".$tmpdirname,0744);
1413 1417 $mapfile = $dir_tmp."/".$tmpdirname."/".$tmpdirname.".map";
1414 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 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 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 8 $customDir = "interface";
9 9 }
10 10 if (! file_exists ( $dir_tmp )) {
11   - @mkdir ( $dir_tmp, 0777 );
  11 + @mkdir ( $dir_tmp, 0744 );
12 12 }
13 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 30 error_reporting ( 0 );
23 31 include "../init/head.php";
... ... @@ -81,7 +89,7 @@ include &quot;../init/head.php&quot;;
81 89 <div class="container-fluid">
82 90 <div class="row">
83 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 93 <li class="active">Perm links</li>
86 94 </ol>
87 95 </div>
... ... @@ -101,8 +109,8 @@ include &quot;../init/head.php&quot;;
101 109 <form class="form-vertical">
102 110 <fieldset>
103 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 115 <div class="form-group">
108 116 <label for="menus">Menu</label> <select onchange="$i3geo_gl.combogrupos(this.value)"
... ... @@ -185,7 +193,7 @@ include &quot;../init/head.php&quot;;
185 193 <div class="row">
186 194 <div class="col-sm-6 text-left">
187 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 197 <div class="row">
190 198 <div class="col-sm-12 text-center">
191 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 210 os valores ou capture as coordenadas</label>
203 211  
204 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 214 class="form-control" id="i3geo_gl_xmin" type="text" onchange="$i3geo_gl.crialink()" />
207 215 </div>
208 216 <div class="coord form-group label-floating">
... ...
testainstal/index.php
... ... @@ -17,7 +17,7 @@ define ( ONDEI3GEO, &quot;..&quot; );
17 17 include "../init/head.php";
18 18 ?>
19 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 21 <div class="container-fluid">
22 22 <div class="navbar-header">
23 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 29 </div>
30 30 </div>
31 31 </nav>
32   - <div class="container-fluid">
  32 + <div class="container-fluid migalha" >
33 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 38 </div>
39 39 </div>
40 40 <nav class="navbar-fixed-bottom">
... ... @@ -229,8 +229,6 @@ HTML;
229 229 echo "Criando a pasta $dir_tmp";
230 230 if(!file_exists($dir_tmp)){
231 231 @mkdir ($dir_tmp,0744);
232   - }
233   - else{
234 232 chmod($dir_tmp,0744);
235 233 }
236 234 if(!file_exists($dir_tmp)){
... ... @@ -248,8 +246,6 @@ HTML;
248 246 echo "Criando o link simb&oacute;lico $d\n";
249 247 if(!file_exists($d)){
250 248 @symlink($dir_tmp,$d);
251   - }
252   - else{
253 249 chmod($d,0744);
254 250 }
255 251 if(!file_exists($d)){
... ...