From 0802446717097618ed3a287277299f166ff8c0a7 Mon Sep 17 00:00:00 2001 From: Edmar Moretti Date: Tue, 8 Nov 2016 15:31:59 -0200 Subject: [PATCH] Mudança das rotinas que criam a pasta ms_tmp para evitar criá-la quando já existir ou quando subpastas existirem --- init/index.php | 30 ++++++++++++++++++++++-------- mapas/index.php | 24 ++++++++++++++++-------- mashups/openlayers.php | 22 +++++++++++++++------- mashups/osm.php | 22 +++++++++++++++------- ms_criamapa.php | 59 +++++++++++++++++++++++++++++++++++++---------------------- permlinks/index.php | 34 +++++++++++++++++++++------------- testainstal/index.php | 16 ++++++---------- 7 files changed, 132 insertions(+), 75 deletions(-) diff --git a/init/index.php b/init/index.php index 3f757ce..757942e 100755 --- a/init/index.php +++ b/init/index.php @@ -15,6 +15,9 @@ */ define ( ONDEI3GEO, ".." ); include (dirname ( __FILE__ ) . "/../ms_configura.php"); +if(empty($dir_tmp)){ + exit; +} if (! empty ( $_GET ["customDir"] )) { $customDir = strip_tags ( $_GET ["customDir"] ); } else if (empty ( $customDir )) { @@ -25,14 +28,25 @@ if (! file_exists ( $dir_tmp )) { @mkdir ( $dir_tmp, 0744 ); } if (file_exists ( $dir_tmp )) { - @mkdir ( $dir_tmp . "/comum", 0744 ); - chmod ( $dir_tmp . "/comum", 0744 ); - @mkdir ( $dir_tmp . "/saiku-datasources", 0744 ); - chmod ( $dir_tmp . "/saiku-datasources", 0744 ); - @mkdir ( $dir_tmp . "/cache", 0744 ); - chmod ( $dir_tmp . "/cache", 0744 ); - @mkdir ( $dir_tmp . "/cache/googlemaps", 0744 ); - chmod ( $dir_tmp . "/cache/googlemaps", 0744 ); + if(!file_exists($dir_tmp . "/comum")){ + @mkdir ( $dir_tmp . "/comum", 0744 ); + chmod ( $dir_tmp . "/comum", 0744 ); + } + if(!file_exists($dir_tmp . "/saiku-datasources")){ + @mkdir ( $dir_tmp . "/saiku-datasources", 0744 ); + chmod ( $dir_tmp . "/saiku-datasources", 0744 ); + } + if(!file_exists($dir_tmp . "/cache")){ + @mkdir ( $dir_tmp . "/cache", 0744 ); + chmod ( $dir_tmp . "/cache", 0744 ); + } + if(!file_exists($dir_tmp . "/cache/googlemaps")){ + @mkdir ( $dir_tmp . "/cache/googlemaps", 0744 ); + chmod ( $dir_tmp . "/cache/googlemaps", 0744 ); + } + foreach(glob($dir_tmp . '/{,.}*.php', GLOB_BRACE) as $f) { + unlink ($f); + } } error_reporting ( 0 ); include "head.php"; diff --git a/mapas/index.php b/mapas/index.php index ce7421a..b89b668 100755 --- a/mapas/index.php +++ b/mapas/index.php @@ -10,13 +10,21 @@ if (! file_exists ( $dir_tmp )) { @mkdir ( $dir_tmp, 0744 ); } if (file_exists ( $dir_tmp )) { - @mkdir ( $dir_tmp . "/comum", 0744 ); - @mkdir ( $dir_tmp . "/saiku-datasources", 0744 ); - chmod ( $dir_tmp . "/saiku-datasources", 0744 ); - @mkdir ( $dir_tmp . "/cache", 0744 ); - chmod ( $dir_tmp . "/cache", 0744 ); - @mkdir ( $dir_tmp . "/cache/googlemaps", 0744 ); - chmod ( $dir_tmp . "/cache/googlemaps", 0744 ); + if (! file_exists ( $dir_tmp . "/comum" )) { + @mkdir ( $dir_tmp . "/comum", 0744 ); + } + if (! file_exists ( $dir_tmp . "/saiku-datasources" )) { + @mkdir ( $dir_tmp . "/saiku-datasources", 0744 ); + chmod ( $dir_tmp . "/saiku-datasources", 0744 ); + } + if (! file_exists ( $dir_tmp . "/cache" )) { + @mkdir ( $dir_tmp . "/cache", 0744 ); + chmod ( $dir_tmp . "/cache", 0744 ); + } + if (! file_exists ( $dir_tmp . "/cache/googlemaps" )) { + @mkdir ( $dir_tmp . "/cache/googlemaps", 0744 ); + chmod ( $dir_tmp . "/cache/googlemaps", 0744 ); + } } error_reporting ( 0 ); include "../init/head.php"; @@ -171,7 +179,7 @@ include "../init/head.php";