diff --git a/app/config/jilo-web.conf.php b/app/config/jilo-web.conf.php index 790a49a..2a0c975 100644 --- a/app/config/jilo-web.conf.php +++ b/app/config/jilo-web.conf.php @@ -10,8 +10,6 @@ return [ 'domain' => 'localhost', // subfolder for the web app, if any 'folder' => '/jilo-web/', - // database with logs from Jilo - 'jilo_database' => '../../jilo/jilo.db', // set to false to disable new registrations 'registration_enabled' => true, // will be displayed on login screen @@ -21,6 +19,7 @@ return [ // edit only if needed for tests or debugging //******************************************* + // database 'db' => [ // DB type for the web app, currently only "sqlite" is used 'db_type' => 'sqlite', @@ -29,6 +28,20 @@ return [ ], // system info 'version' => '0.1.1', + // development has verbose error messages, production has not + 'environment' => 'production', + + // ************************************* + // Maintained by the app, edit with care + // ************************************* + + 'platforms' => [ + '0' => [ + 'name' => 'meet.example.com', + // database with logs from Jilo + 'jilo_database' => '../../jilo/jilo.db', + ], + ], ]; ?> diff --git a/app/helpers/database.php b/app/helpers/database.php index 7d7ac9f..fa13a4e 100644 --- a/app/helpers/database.php +++ b/app/helpers/database.php @@ -1,20 +1,30 @@ 'sqlite', - 'dbFile' => $config['jilo_database'], + 'dbFile' => $dbFile, ]); } catch (Exception $e) { - $error = 'Error: ' . $e->getMessage(); + if ($config['environment'] === 'production') { + $error = 'There was an unexpected error. Please try again.'; + } else { + $error = 'Error: ' . $e->getMessage(); + } include '../app/templates/block-message.php'; exit(); } + // connecting to a jilo-web database of the web app } else { // sqlite database file diff --git a/app/pages/front.php b/app/pages/front.php index 21c97a2..01683ff 100644 --- a/app/pages/front.php +++ b/app/pages/front.php @@ -4,9 +4,12 @@ require_once '../app/classes/database.php'; require '../app/classes/conference.php'; require '../app/classes/participant.php'; +// by default we connect ot the first configured platform +$platform_id = $_REQUEST['platform'] ?? '0'; + // connect to database require '../app/helpers/database.php'; -$db = connectDB($config, 'jilo'); +$db = connectDB($config, 'jilo', $platform_id); //