summaryrefslogtreecommitdiff
path: root/db.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2010-08-24 14:12:04 +0400
committerAndrew Dolgov <[email protected]>2010-08-24 14:12:04 +0400
commit1d064e0da50c53708a593e50932fe35eddc55278 (patch)
tree1d975cebab726b5452538585ccc7cdffcbadce2c /db.php
parent6485f0a6b60a98503e704e2b3f2d5512a66b620b (diff)
allow connections to pgsql without password
Diffstat (limited to 'db.php')
-rw-r--r--db.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/db.php b/db.php
index c07aa9fa2..844bd0e41 100644
--- a/db.php
+++ b/db.php
@@ -5,7 +5,11 @@ require_once "config.php";
function db_connect($host, $user, $pass, $db) {
if (DB_TYPE == "pgsql") {
- $string = "dbname=$db user=$user password=$pass";
+ $string = "dbname=$db user=$user";
+
+ if ($pass) {
+ $string .= " password=$pass";
+ }
if ($host) {
$string .= " host=$host";