From 991e36f6adfaef45981221d358afe89e9720f010 Mon Sep 17 00:00:00 2001 From: Edmar Moretti Date: Tue, 14 Oct 2008 13:55:22 +0000 Subject: [PATCH] correção na substituicao da conexão --- ogc.php | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/ogc.php b/ogc.php index 4a9ba98..1a3fb4d 100644 --- a/ogc.php +++ b/ogc.php @@ -157,7 +157,6 @@ foreach ($_GET as $k=>$v) {$tema = $v;} if(strtolower($k) == "layer") {$tema = $v;} - } if(isset($tema)) {$tipo = "";} @@ -211,14 +210,28 @@ if ($tipo == "") { if ($postgis_mapa != "") { - if ($l->connectiontype == MS_POSTGIS) + if ($layer->connectiontype == MS_POSTGIS) + { + $lcon = $l->connection; + if (($lcon == " ") || ($lcon == "") || (in_array($lcon,array_keys($postgis_mapa)))) { - if(!is_array($postgis_mapa)) - $l->set("connection",$postgis_mapa); + // + //o metadata CONEXAOORIGINAL guarda o valor original para posterior substituição + // + if(($lcon == " ") || ($lcon == "")) + { + $l->set("connection",$postgis_mapa); + $l->setmetadata("CONEXAOORIGINAL",$lcon); + } else - $l->set("connection",$postgis_mapa[$l->connection]); + { + $l->set("connection",$postgis_mapa[$lcon]); + $l->setmetadata("CONEXAOORIGINAL",$lcon); + } } } + + } } autoClasses(&$l,$oMap); ms_newLayerObj($oMap, $l); @@ -277,12 +290,10 @@ else } } } - ms_ioinstallstdouttobuffer(); $oMap->owsdispatch($req); $contenttype = ms_iostripstdoutbuffercontenttype(); header("Content-type: $contenttype"); ms_iogetStdoutBufferBytes(); ms_ioresethandlers(); - ?> \ No newline at end of file -- libgit2 0.21.2