Commit 64b2c7d0a37dc5dacc225bbc679fec9363847646
1 parent
e2895e59
Exists in
master
and in
7 other branches
Incluida rotina de substituicao de conexão
Showing
1 changed file
with
8 additions
and
1 deletions
Show diff stats
admin/php/parsemapfile.php
... | ... | @@ -229,7 +229,7 @@ function legendaSimples($layername) |
229 | 229 | // |
230 | 230 | function mapfile() |
231 | 231 | { |
232 | - global $codigoLayer,$mapfile,$mapa,$objcontype,$objlayertypes,$forcawms; | |
232 | + global $codigoLayer,$mapfile,$mapa,$objcontype,$objlayertypes,$forcawms,$postgis_mapa; | |
233 | 233 | $layers = $mapa->getalllayernames(); |
234 | 234 | $dados = array(); |
235 | 235 | $xml = "<"."\x3F"."xml version='1.0' encoding='ISO-8859-1' "."\x3F".">"; |
... | ... | @@ -310,6 +310,13 @@ function mapfile() |
310 | 310 | { |
311 | 311 | $xml .= "<connection>\n"; |
312 | 312 | $con = $layer->connection; |
313 | + if (($con == " ") || ($con == "") || (in_array($con,array_keys($postgis_mapa)))) | |
314 | + { | |
315 | + if(($con == " ") || ($con == "")) | |
316 | + {$con = $postgis_mapa;} | |
317 | + else | |
318 | + {$con = $postgis_mapa[$con];} | |
319 | + } | |
313 | 320 | $xml .= "<user>".preg_replace('/.*user\s*=\s*([a-zA-Z0-9_.]+).*/i', '\1', $con)."</user>\n"; |
314 | 321 | $xml .= "<password>".preg_replace('/.*password\s*=\s*([a-zA-Z0-9_.]+).*/i', '\1', $con)."</password>\n"; |
315 | 322 | $xml .= "<dbname>".preg_replace('/.*dbname\s*=\s*([a-zA-Z0-9_.]+).*/i', '\1', $con)."</dbname>\n"; | ... | ... |