From 536552b118b2796ccbad1d059c415c4faad2eb36 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Mon, 30 Jul 2007 19:12:27 +0200 Subject: PGSQL auth backend - connect via socket FS#1198 If the server field is empty in configuration the postgres backend will try to connect via a local socket to the server darcs-hash:20070730171227-7ad00-83bb5c4e60fec79e116343b1043a0dfe9800f82b.gz --- inc/auth/pgsql.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'inc/auth') diff --git a/inc/auth/pgsql.class.php b/inc/auth/pgsql.class.php index cb3d2319f..ae8d08666 100644 --- a/inc/auth/pgsql.class.php +++ b/inc/auth/pgsql.class.php @@ -43,7 +43,7 @@ class auth_pgsql extends auth_mysql { $this->defaultgroup = $conf['defaultgroup']; // set capabilities based upon config strings set - if (empty($this->cnf['server']) || empty($this->cnf['user']) || + if (empty($this->cnf['user']) || empty($this->cnf['password']) || empty($this->cnf['database'])){ if ($this->cnf['debug']) msg("PgSQL err: insufficient configuration.",-1,__LINE__,__FILE__); @@ -281,7 +281,7 @@ class auth_pgsql extends auth_mysql { */ function _openDB() { if (!$this->dbcon) { - $dsn = 'host='.$this->cnf['server']; + $dsn = $this->cnf['server'] ? 'host='.$this->cnf['server'] : ''; $dsn .= ' port='.$this->cnf['port']; $dsn .= ' dbname='.$this->cnf['database']; $dsn .= ' user='.$this->cnf['user']; -- cgit v1.2.3