diff --git a/main/install/configuration.dist.php b/main/install/configuration.dist.php index 7b98d8c290..c635b3c785 100755 --- a/main/install/configuration.dist.php +++ b/main/install/configuration.dist.php @@ -1992,6 +1992,9 @@ VALUES (21, 13, 'send_notification_at_a_specific_date', 'Send notification at a // Ckeditor settings. //$_configuration['editor_settings'] = ['config' => ['youtube_responsive' => true]]; +// Configuration setting to force a cron process on all campus on a multisite enviroment +//$_configuration['multiple_urls_cron_apply_to_all'] = false; + // KEEP THIS AT THE END // -------- Custom DB changes // Add user activation by confirmation email diff --git a/plugin/bbb/cron_close_meeting.php b/plugin/bbb/cron_close_meeting.php index a94f3b5e86..ae0f2f6d21 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 = api_get_configuration_value('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/lib/bbb.lib.php b/plugin/bbb/lib/bbb.lib.php index 15c1d6b537..b575dc5697 100755 --- a/plugin/bbb/lib/bbb.lib.php +++ b/plugin/bbb/lib/bbb.lib.php @@ -1844,13 +1844,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;