Skip to content

Commit

Permalink
LIMS-743: Get MOTD from database (#611)
Browse files Browse the repository at this point in the history
Co-authored-by: Mark Williams <[email protected]>
  • Loading branch information
ndg63276 and Mark Williams authored Sep 25, 2023
1 parent feca5b6 commit 066b15b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion api/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
use SynchWeb\Database\DatabaseParent;
use SynchWeb\ImagingShared;
use SynchWeb\Dispatch;
use SynchWeb\Options;

require 'vendor/autoload.php';

Expand Down Expand Up @@ -71,8 +72,9 @@ function setupApplication($mode): Slim
$dhl_enable, $dhl_link, $scale_grid, $scale_grid_end_date, $preset_proposal, $timezone,
$valid_components, $enabled_container_types, $ifsummary;
$app->contentType('application/json');
$options = $app->container['options'];
$app->response()->body(json_encode(array(
'motd' => $motd,
'motd' => $options->get('motd', $motd),
'authentication_type' => $authentication_type,
'cas_url' => $cas_url,
'cas_sso' => $cas_sso,
Expand Down Expand Up @@ -145,4 +147,8 @@ function setupDependencyInjectionContainer($app)
$app->container->singleton('dispatch', function () use ($app) {
return new Dispatch($app, $app->container['db'], $app->container['user']);
});

$app->container->singleton('options', function () use ($app) {
return new Options($app->container['db']);
});
}
2 changes: 1 addition & 1 deletion api/src/Options.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ private function _retrieve() {

$this->options = array();
foreach ($options as $o) {
$this->options[$o['NAME']] = unserialize($o['VALUE']);
$this->options[$o['NAME']] = $o['VALUE'];
if ($o['UI'] == 1) $this->public[$o['NAME']] = $this->options[$o['NAME']];

}
Expand Down

0 comments on commit 066b15b

Please sign in to comment.