diff --git a/plugin/bbb/CHANGELOG.md b/plugin/bbb/CHANGELOG.md index da1ab42db2..97d33a3580 100644 --- a/plugin/bbb/CHANGELOG.md +++ b/plugin/bbb/CHANGELOG.md @@ -1,3 +1,7 @@ +Version 2.11 - 2022-04 +---------------------- +* Add option to close all rooms on all campus on a multi-url enviroment + Version 2.10 - 2021-10 ---------------------- * Add support for multiple recording formats diff --git a/plugin/bbb/cron_close_meeting.php b/plugin/bbb/cron_close_meeting.php index a94f3b5e86..43b6a3d426 100644 --- a/plugin/bbb/cron_close_meeting.php +++ b/plugin/bbb/cron_close_meeting.php @@ -10,9 +10,11 @@ $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'); + $bbb = new bbb(); if ($bbb->pluginEnabled) { - $activeSessions = $bbb->getActiveSessions(); + $activeSessions = $bbb->getActiveSessions($applyAllUrls); if (!empty($activeSessions)) { foreach ($activeSessions as $value) { diff --git a/plugin/bbb/lang/english.php b/plugin/bbb/lang/english.php index b12120fd2c..26b5327629 100755 --- a/plugin/bbb/lang/english.php +++ b/plugin/bbb/lang/english.php @@ -74,3 +74,5 @@ $strings['RoomClosed'] = 'Room closed'; $strings['RoomClosedComment'] = ' '; $strings['meeting_duration'] = 'Meeting duration (in minutes)'; $strings['big_blue_button_students_start_conference_in_groups'] = 'Allow students to start conference in their groups.'; +$strings['plugin_bbb_multiple_urls_cron_apply_to_all'] = 'Automatically closes all rooms on ALL campuses.'; +$strings['plugin_bbb_multiple_urls_cron_apply_to_all_help'] = 'Option for multi-url environments. Allows the CRON task to close all open rooms on mother and child campus.'; diff --git a/plugin/bbb/lang/spanish.php b/plugin/bbb/lang/spanish.php index dfd4dddde6..6be449b6d8 100755 --- a/plugin/bbb/lang/spanish.php +++ b/plugin/bbb/lang/spanish.php @@ -67,3 +67,5 @@ $strings['CreatedAt'] = 'Creado el'; $strings['ThereIsNoVideoConferenceActive'] = "No hay una videoconferencia actualmente activa"; $strings['meeting_duration'] = 'Duración de la reunión (en minutos)'; $strings['big_blue_button_students_start_conference_in_groups'] = 'Permitir a los estudiantes iniciar una videoconferencia en sus grupos.'; +$strings['plugin_bbb_multiple_urls_cron_apply_to_all'] = 'Cerrar automáticamente todas las salas sin actividad en TODOS los campus.'; +$strings['plugin_bbb_multiple_urls_cron_apply_to_all_help'] = 'Opción para entornos multi-url. Permite a la tarea CRON cerrar todas las salas abiertas del campus madre e hijos.'; diff --git a/plugin/bbb/lib/bbb.lib.php b/plugin/bbb/lib/bbb.lib.php index 4d0266ff38..9aebc6b404 100755 --- a/plugin/bbb/lib/bbb.lib.php +++ b/plugin/bbb/lib/bbb.lib.php @@ -1875,13 +1875,23 @@ class bbb /** * Get active session in the all platform + * + * @param boolean $allSites Parameter to indicate whether to get the result from all sites + * + * @return array */ - public function getActiveSessions() + public function getActiveSessions($allSites = false) { + $where = ['where' => ['status = ?' => 1]]; + + if (!$allSites) { + $where['where'][' AND access_url = ?'] = $this->accessUrl; + } + $meetingList = Database::select( '*', $this->table, - array('where' => array('status = ? AND access_url = ?' => array(1, $this->accessUrl))) + $where ); return $meetingList; diff --git a/plugin/bbb/lib/bbb_plugin.class.php b/plugin/bbb/lib/bbb_plugin.class.php index 346b5c955f..c10ebd589e 100755 --- a/plugin/bbb/lib/bbb_plugin.class.php +++ b/plugin/bbb/lib/bbb_plugin.class.php @@ -74,6 +74,7 @@ class BBBPlugin extends Plugin 'bbb_force_record_generation' => 'checkbox', 'disable_course_settings' => 'boolean', 'meeting_duration' => 'text', + 'plugin_bbb_multiple_urls_cron_apply_to_all' => 'checkbox', ] );