diff --git a/src/dba/AbstractModelFactory.class.php b/src/dba/AbstractModelFactory.class.php index b0e77bc64..5fd7ccf38 100755 --- a/src/dba/AbstractModelFactory.class.php +++ b/src/dba/AbstractModelFactory.class.php @@ -682,9 +682,16 @@ public function massUpdate($options) { * @return PDO */ public function getDB($test = false) { - $dsn = 'mysql:dbname=' . DBA_DB . ";" . "host=" . DBA_SERVER; - $user = DBA_USER; - $password = DBA_PASS; + if(!$test) { + $dsn = 'mysql:dbname=' . DBA_DB . ";" . "host=" . DBA_SERVER; + $user = DBA_USER; + $password = DBA_PASS; + }else{ + global $CONN; + $dsn = 'mysql:dbname=' . $CONN['db'] . ";" . "host=" . $CONN['server']; + $user = $CONN['user']; + $password = $CONN['pass']; + } if ($this->dbh !== null) { return $this->dbh;