From: Marcin Haba Date: Sat, 5 Aug 2017 18:04:35 +0000 (+0200) Subject: baculum: Fix sqlite db support X-Git-Tag: Release-9.0.3~7 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=dc40a7a9eaab3b9d897dbcf79e2c2010a3d53abe;p=bacula%2Fbacula baculum: Fix sqlite db support --- diff --git a/gui/baculum/protected/API/Class/APIDbModule.php b/gui/baculum/protected/API/Class/APIDbModule.php index 9440c6b08d..2d71139b1d 100644 --- a/gui/baculum/protected/API/Class/APIDbModule.php +++ b/gui/baculum/protected/API/Class/APIDbModule.php @@ -87,7 +87,12 @@ class APIDbModule extends TActiveRecord { $db_connection = null; if ((array_key_exists('enabled', $db_params) && $db_params['enabled'] === '1') || $force === true) { $dsn = self::getDsn($db_params); - $db_connection = new TDbConnection($dsn, $db_params['login'], $db_params['password']); + $db_connection = null; + if (array_key_exists('login', $db_params) && array_key_exists('password', $db_params)) { + $db_connection = new TDbConnection($dsn, $db_params['login'], $db_params['password']); + } else { + $db_connection = new TDbConnection($dsn); + } $db_connection->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $db_connection->setAttribute(PDO::ATTR_CASE, PDO::CASE_LOWER); } else {