Commit 991e36f6adfaef45981221d358afe89e9720f010
1 parent
e336f28a
Exists in
master
and in
7 other branches
correção na substituicao da conexão
Showing
1 changed file
with
18 additions
and
7 deletions
Show diff stats
ogc.php
@@ -157,7 +157,6 @@ foreach ($_GET as $k=>$v) | @@ -157,7 +157,6 @@ foreach ($_GET as $k=>$v) | ||
157 | {$tema = $v;} | 157 | {$tema = $v;} |
158 | if(strtolower($k) == "layer") | 158 | if(strtolower($k) == "layer") |
159 | {$tema = $v;} | 159 | {$tema = $v;} |
160 | - | ||
161 | } | 160 | } |
162 | if(isset($tema)) | 161 | if(isset($tema)) |
163 | {$tipo = "";} | 162 | {$tipo = "";} |
@@ -211,14 +210,28 @@ if ($tipo == "") | @@ -211,14 +210,28 @@ if ($tipo == "") | ||
211 | { | 210 | { |
212 | if ($postgis_mapa != "") | 211 | if ($postgis_mapa != "") |
213 | { | 212 | { |
214 | - if ($l->connectiontype == MS_POSTGIS) | 213 | + if ($layer->connectiontype == MS_POSTGIS) |
214 | + { | ||
215 | + $lcon = $l->connection; | ||
216 | + if (($lcon == " ") || ($lcon == "") || (in_array($lcon,array_keys($postgis_mapa)))) | ||
215 | { | 217 | { |
216 | - if(!is_array($postgis_mapa)) | ||
217 | - $l->set("connection",$postgis_mapa); | 218 | + // |
219 | + //o metadata CONEXAOORIGINAL guarda o valor original para posterior substituição | ||
220 | + // | ||
221 | + if(($lcon == " ") || ($lcon == "")) | ||
222 | + { | ||
223 | + $l->set("connection",$postgis_mapa); | ||
224 | + $l->setmetadata("CONEXAOORIGINAL",$lcon); | ||
225 | + } | ||
218 | else | 226 | else |
219 | - $l->set("connection",$postgis_mapa[$l->connection]); | 227 | + { |
228 | + $l->set("connection",$postgis_mapa[$lcon]); | ||
229 | + $l->setmetadata("CONEXAOORIGINAL",$lcon); | ||
230 | + } | ||
220 | } | 231 | } |
221 | } | 232 | } |
233 | + | ||
234 | + } | ||
222 | } | 235 | } |
223 | autoClasses(&$l,$oMap); | 236 | autoClasses(&$l,$oMap); |
224 | ms_newLayerObj($oMap, $l); | 237 | ms_newLayerObj($oMap, $l); |
@@ -277,12 +290,10 @@ else | @@ -277,12 +290,10 @@ else | ||
277 | } | 290 | } |
278 | } | 291 | } |
279 | } | 292 | } |
280 | - | ||
281 | ms_ioinstallstdouttobuffer(); | 293 | ms_ioinstallstdouttobuffer(); |
282 | $oMap->owsdispatch($req); | 294 | $oMap->owsdispatch($req); |
283 | $contenttype = ms_iostripstdoutbuffercontenttype(); | 295 | $contenttype = ms_iostripstdoutbuffercontenttype(); |
284 | header("Content-type: $contenttype"); | 296 | header("Content-type: $contenttype"); |
285 | ms_iogetStdoutBufferBytes(); | 297 | ms_iogetStdoutBufferBytes(); |
286 | ms_ioresethandlers(); | 298 | ms_ioresethandlers(); |
287 | - | ||
288 | ?> | 299 | ?> |
289 | \ No newline at end of file | 300 | \ No newline at end of file |