From dc40a7a9eaab3b9d897dbcf79e2c2010a3d53abe Mon Sep 17 00:00:00 2001 From: Marcin Haba Date: Sat, 5 Aug 2017 20:04:35 +0200 Subject: [PATCH] baculum: Fix sqlite db support --- gui/baculum/protected/API/Class/APIDbModule.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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 { -- 2.39.5