From 6966c1ec7e69b6ef6869d62ffd0aa5d2cc69f9bf Mon Sep 17 00:00:00 2001 From: Angel Fernando Quiroz Campos Date: Wed, 27 Apr 2022 15:33:17 -0500 Subject: [PATCH] Plugin: BBB: Show plugin_bbb_multiple_urls_cron_apply_to_all in first access URL only --- plugin/bbb/cron_close_meeting.php | 2 +- plugin/bbb/lib/bbb.lib.php | 2 +- plugin/bbb/lib/bbb_plugin.class.php | 63 ++++++++++++++++------------- 3 files changed, 36 insertions(+), 31 deletions(-) diff --git a/plugin/bbb/cron_close_meeting.php b/plugin/bbb/cron_close_meeting.php index 43b6a3d426..36cc3f40df 100644 --- a/plugin/bbb/cron_close_meeting.php +++ b/plugin/bbb/cron_close_meeting.php @@ -10,7 +10,7 @@ $plugin = BBBPlugin::create(); $meetingTable = Database::get_main_table('plugin_bbb_meeting'); $roomTable = Database::get_main_table('plugin_bbb_room'); -$applyAllUrls = $plugin->get('plugin_bbb_multiple_urls_cron_apply_to_all'); +$applyAllUrls = 'true' === $plugin->get('plugin_bbb_multiple_urls_cron_apply_to_all'); $bbb = new bbb(); if ($bbb->pluginEnabled) { diff --git a/plugin/bbb/lib/bbb.lib.php b/plugin/bbb/lib/bbb.lib.php index 9aebc6b404..cf1e19bcc1 100755 --- a/plugin/bbb/lib/bbb.lib.php +++ b/plugin/bbb/lib/bbb.lib.php @@ -1880,7 +1880,7 @@ class bbb * * @return array */ - public function getActiveSessions($allSites = false) + public function getActiveSessions(bool $allSites = false) { $where = ['where' => ['status = ?' => 1]]; diff --git a/plugin/bbb/lib/bbb_plugin.class.php b/plugin/bbb/lib/bbb_plugin.class.php index c10ebd589e..9edd7cfda5 100755 --- a/plugin/bbb/lib/bbb_plugin.class.php +++ b/plugin/bbb/lib/bbb_plugin.class.php @@ -44,38 +44,43 @@ class BBBPlugin extends Plugin */ protected function __construct() { + $settings = [ + 'tool_enable' => 'boolean', + 'host' => 'text', + 'salt' => 'text', + 'enable_global_conference' => 'boolean', + 'enable_global_conference_per_user' => 'boolean', + 'enable_conference_in_course_groups' => 'boolean', + 'enable_global_conference_link' => 'boolean', + 'disable_download_conference_link' => 'boolean', + 'max_users_limit' => 'text', + 'global_conference_allow_roles' => [ + 'type' => 'select', + 'options' => [ + PLATFORM_ADMIN => get_lang('Administrator'), + COURSEMANAGER => get_lang('Teacher'), + STUDENT => get_lang('Student'), + STUDENT_BOSS => get_lang('StudentBoss'), + ], + 'attributes' => ['multiple' => 'multiple'], + ], + 'allow_regenerate_recording' => 'boolean', + // Default course settings, must be the same as $course_settings + 'big_blue_button_record_and_store' => 'checkbox', + 'bbb_enable_conference_in_groups' => 'checkbox', + 'bbb_force_record_generation' => 'checkbox', + 'disable_course_settings' => 'boolean', + 'meeting_duration' => 'text', + ]; + + if (1 === (int) api_get_current_access_url_id()) { + $settings['plugin_bbb_multiple_urls_cron_apply_to_all'] = 'checkbox'; + } + parent::__construct( '2.10', 'Julio Montoya, Yannick Warnier, Angel Fernando Quiroz Campos, Jose Angel Ruiz, Ghazi Triki, Adnen Manssouri', - [ - 'tool_enable' => 'boolean', - 'host' => 'text', - 'salt' => 'text', - 'enable_global_conference' => 'boolean', - 'enable_global_conference_per_user' => 'boolean', - 'enable_conference_in_course_groups' => 'boolean', - 'enable_global_conference_link' => 'boolean', - 'disable_download_conference_link' => 'boolean', - 'max_users_limit' => 'text', - 'global_conference_allow_roles' => [ - 'type' => 'select', - 'options' => [ - PLATFORM_ADMIN => get_lang('Administrator'), - COURSEMANAGER => get_lang('Teacher'), - STUDENT => get_lang('Student'), - STUDENT_BOSS => get_lang('StudentBoss'), - ], - 'attributes' => ['multiple' => 'multiple'], - ], - 'allow_regenerate_recording' => 'boolean', - // Default course settings, must be the same as $course_settings - 'big_blue_button_record_and_store' => 'checkbox', - 'bbb_enable_conference_in_groups' => 'checkbox', - 'bbb_force_record_generation' => 'checkbox', - 'disable_course_settings' => 'boolean', - 'meeting_duration' => 'text', - 'plugin_bbb_multiple_urls_cron_apply_to_all' => 'checkbox', - ] + $settings ); $this->isAdminPlugin = true;