diff --git a/admin/config.inc b/admin/config.inc index 349120e..d5b361c 100644 --- a/admin/config.inc +++ b/admin/config.inc @@ -1,20 +1,24 @@ 'legacyworlds', - "password" => 'password for the standard database user', - "adminUser" => 'legacyworlds_admin', - "adminPassword" => 'password for the administrative database user', - "ctrlFifo" =>'/tmp/.lwFifo', - "ctrlPath" =>'/tmp/.lwControl' + 'host' => '127.0.0.1', + 'database' => 'legacyworlds', + 'user' => 'legacyworlds', + 'password' => 'password for the standard database user', + 'adminUser' => 'legacyworlds_admin', + 'adminPassword' => 'password for the administrative database user', + 'ctrlFifo' =>'/tmp/.lwFifo', + 'ctrlPath' =>'/tmp/.lwControl' ); function __dbConnect($admin = false) { global $aConfig; + $h = $aConfig['host']; + $d = $aConfig['database']; $u = $aConfig[$admin ? 'adminUser' : 'user']; $p = $aConfig[$admin ? 'adminPassword' : 'password']; - $cString = "dbname='legacyworlds' host='127.0.0.1' sslmode='prefer' user='$u' password='$p'"; + $cString = "dbname='$d' host='$h' sslmode='prefer' user='$u' password='$p'"; return pg_connect($cString); }