diff --git a/lib/Settings/Admin.php b/lib/Settings/Admin.php index 6097a83..881375d 100644 --- a/lib/Settings/Admin.php +++ b/lib/Settings/Admin.php @@ -8,7 +8,7 @@ use OCP\Settings\ISettings; class Admin implements ISettings { - /** @var IConfig */ + /** @var IConfig */ private $config; /** diff --git a/lib/Settings/Personal.php b/lib/Settings/Personal.php index 348b82c..6dd1b46 100644 --- a/lib/Settings/Personal.php +++ b/lib/Settings/Personal.php @@ -4,15 +4,40 @@ namespace OCA\BigBlueButton\Settings; use OCP\AppFramework\Http\TemplateResponse; use OCP\Settings\ISettings; +use OCP\IConfig; +use \OCP\IL10N; class Personal implements ISettings { + /** @var IConfig */ + private $config; + + /** @var IL10N */ + private $l; + + /** + * Admin constructor. + * + * @param IConfig $config + */ + public function __construct(IConfig $config, IL10N $l) + { + $this->config = $config; + $this->l = $l; + } + /** * @return TemplateResponse */ public function getForm() { - return new TemplateResponse('bbb', 'manager'); + $warning = ''; + + if (empty($this->config->getAppValue('bbb', 'api.url')) || empty($this->config->getAppValue('bbb', 'api.secret'))) { + $warning = $this->l->t('API url or secret not configured. Please contact your administrator.'); + } + + return new TemplateResponse('bbb', 'manager', ['warning' => $warning]); } /** diff --git a/templates/manager.php b/templates/manager.php index 800630b..2d059d3 100644 --- a/templates/manager.php +++ b/templates/manager.php @@ -3,3 +3,9 @@ script('bbb', 'manager'); ?>
+ + +