From 4a1544cfdca6451f8e02af2ab81c7eb91997e5bd Mon Sep 17 00:00:00 2001 From: "Shamiso.Jaravaza" <33659194+ssj365@users.noreply.github.com> Date: Mon, 11 Mar 2024 12:36:56 -0600 Subject: [PATCH 1/2] MDL-79239 mod_bigbluebuttonbn: Remove DPA * Removed dpa * Plugin remains disabled by default --- mod/bigbluebuttonbn/classes/local/config.php | 2 - mod/bigbluebuttonbn/classes/settings.php | 19 ------ ...luebutton_module_disabled_notification.php | 23 ++----- .../lang/en/bigbluebuttonbn.php | 15 +++-- mod/bigbluebuttonbn/lang/en/deprecated.txt | 7 ++ mod/bigbluebuttonbn/lib.php | 22 ------ .../tests/behat/add_instance.feature | 2 +- .../tests/behat/behat_mod_bigbluebuttonbn.php | 10 --- .../tests/behat/completion.feature | 2 +- .../tests/behat/edit_instance.feature | 2 +- .../tests/behat/end_meeting.feature | 2 +- .../tests/behat/group_mode.feature | 2 +- .../tests/behat/guest_access.feature | 2 +- .../tests/behat/join_meeting.feature | 2 +- .../tests/behat/join_meeting_as_guest.feature | 2 +- .../tests/behat/lock_settings.feature | 2 +- .../tests/behat/meeting_roles.feature | 2 +- .../tests/behat/recordings.feature | 2 +- .../tests/behat/recordings_import.feature | 2 +- mod/bigbluebuttonbn/tests/behat/roles.feature | 2 +- mod/bigbluebuttonbn/tests/behat/room.feature | 2 +- .../tests/behat/start_meeting.feature | 2 +- .../tests/behat/subplugins.feature | 2 +- mod/bigbluebuttonbn/tests/generator/lib.php | 1 - mod/bigbluebuttonbn/tests/lib_test.php | 67 ------------------- .../tests/local/extension_test.php | 1 - 26 files changed, 36 insertions(+), 163 deletions(-) diff --git a/mod/bigbluebuttonbn/classes/local/config.php b/mod/bigbluebuttonbn/classes/local/config.php index 9a27d3fc56f..c209a37f1bc 100644 --- a/mod/bigbluebuttonbn/classes/local/config.php +++ b/mod/bigbluebuttonbn/classes/local/config.php @@ -36,8 +36,6 @@ class config { /** @var string Default bigbluebutton server shared secret */ public const DEFAULT_SHARED_SECRET = '0b21fcaf34673a8c3ec8ed877d76ae34'; - /** @var string Default bigbluebutton data processing agreement url */ - public const DEFAULT_DPA_URL = 'https://blindsidenetworks.com/dpa-moodle-free-tier'; /** @var string the default bigbluebutton checksum algorithm */ public const DEFAULT_CHECKSUM_ALGORITHM = 'SHA256'; diff --git a/mod/bigbluebuttonbn/classes/settings.php b/mod/bigbluebuttonbn/classes/settings.php index 79f9a86ed0d..ae5584df96b 100644 --- a/mod/bigbluebuttonbn/classes/settings.php +++ b/mod/bigbluebuttonbn/classes/settings.php @@ -167,15 +167,6 @@ class settings { ); $settingsgeneral->add($item); - if (empty($CFG->bigbluebuttonbn_default_dpa_accepted)) { - $settingsgeneral->add(new admin_setting_configcheckbox( - 'bigbluebuttonbn_default_dpa_accepted', - get_string('acceptdpa', 'mod_bigbluebuttonbn'), - get_string('enablingbigbluebuttondpainfo', 'mod_bigbluebuttonbn', config::DEFAULT_DPA_URL), - 0 - )); - } - $item = new admin_setting_configtext( 'bigbluebuttonbn_server_url', get_string('config_server_url', 'bigbluebuttonbn'), @@ -220,16 +211,6 @@ class settings { $settingsgeneral ); - $item = new \admin_setting_description( - 'bigbluebuttonbn_dpa_info', - '', - get_string('config_dpa_note', 'bigbluebuttonbn', config::DEFAULT_DPA_URL), - ); - $this->add_conditional_element( - 'dpa_info', - $item, - $settingsgeneral - ); $item = new admin_setting_configtext( 'bigbluebuttonbn_poll_interval', get_string('config_poll_interval', 'bigbluebuttonbn'), diff --git a/mod/bigbluebuttonbn/classes/task/send_bigbluebutton_module_disabled_notification.php b/mod/bigbluebuttonbn/classes/task/send_bigbluebutton_module_disabled_notification.php index 0da79bad316..cb5fffcdcbd 100644 --- a/mod/bigbluebuttonbn/classes/task/send_bigbluebutton_module_disabled_notification.php +++ b/mod/bigbluebuttonbn/classes/task/send_bigbluebutton_module_disabled_notification.php @@ -23,7 +23,7 @@ use core\message\message; use mod_bigbluebuttonbn\local\config; /** - * Ad-hoc task to send a notification related to the disabling of the BigBlueButton activity module. + * Deprecated Ad-hoc task to send a notification related to the disabling of the BigBlueButton activity module. * * The ad-hoc tasks sends a notification to the administrator informing that the BigBlueButton activity module has * been disabled and they are required to confirm their acceptance of the data processing agreement prior to @@ -34,25 +34,12 @@ use mod_bigbluebuttonbn\local\config; * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class send_bigbluebutton_module_disabled_notification extends adhoc_task { - /** * Execute the task. */ - public function execute(): void { - $message = new message(); - $message->component = 'moodle'; - $message->name = 'notices'; - $message->userfrom = \core_user::get_noreply_user(); - $message->userto = get_admin(); - $message->notification = 1; - $message->contexturl = (new \moodle_url('/admin/modules.php'))->out(false); - $message->contexturlname = get_string('modsettings', 'admin'); - $message->subject = get_string('bigbluebuttondisablednotification_subject', 'mod_bigbluebuttonbn'); - $message->fullmessageformat = FORMAT_HTML; - $message->fullmessagehtml = get_string('bigbluebuttondisablednotification', 'mod_bigbluebuttonbn', - config::DEFAULT_DPA_URL); - $message->smallmessage = strip_tags($message->fullmessagehtml); - - message_send($message); + public function execute() { + // Log the debug message. + $message = "Attempted to run deprecated send_bigbluebutton_module_disabled_notification task."; + debugging($message, DEBUG_DEVELOPER); } } diff --git a/mod/bigbluebuttonbn/lang/en/bigbluebuttonbn.php b/mod/bigbluebuttonbn/lang/en/bigbluebuttonbn.php index e47c59ce9d8..2c87c32c0ce 100644 --- a/mod/bigbluebuttonbn/lang/en/bigbluebuttonbn.php +++ b/mod/bigbluebuttonbn/lang/en/bigbluebuttonbn.php @@ -26,7 +26,6 @@ defined('MOODLE_INTERNAL') || die(); $string['activityoverview'] = 'You have upcoming BigBlueButton sessions'; -$string['acceptdpa'] = 'I understand and accept the data processing agreement'; $string['bbbduetimeoverstartingtime'] = 'The close time must be later than the open time.'; $string['bbbdurationwarning'] = 'The maximum duration for this session is %duration% minutes.'; $string['bbbrecordwarning'] = 'This session may be recorded.'; @@ -45,12 +44,7 @@ $string['bigbluebuttonbn:deleterecordings'] = 'Delete recordings'; $string['bigbluebuttonbn:importrecordings'] = 'Import recordings'; $string['bigbluebuttonbn:viewallrecordingformats'] = 'View all recording formats'; $string['bigbluebuttonbn'] = 'BigBlueButton'; -$string['bigbluebuttondisablednotification_subject'] = 'BigBlueButton activity module disabled.'; -$string['bigbluebuttondisablednotification'] = 'The BigBlueButton activity module has been disabled and any existing BigBlueButton course activities are currently not accessible. Prior to re-enabling this plugin, please ensure that you have read and accepted the data processing agreement with Blindside Networks Inc.'; $string['cannotperformaction'] = 'Cannot perform action {$a} on this recording'; -$string['enablingbigbluebutton'] = 'Enabling BigBlueButton activity'; -$string['enablingbigbluebuttondpainfo'] = 'In order to meet your data protection obligations, prior to enabling this plugin, you may need to ensure that you have read and accepted the Blindside Networks data processing agreement. Please consult with your own privacy professionals for advice.'; -$string['dpainfonotsigned'] = 'Before enabling this plugin, you must confirm that you have read and accepted the Blindside Networks data processing agreement.'; $string['indicator:cognitivedepth'] = 'BigBlueButton cognitive'; $string['indicator:cognitivedepth_help'] = 'This indicator is based on the cognitive depth reached by the student in a BigBlueButton activity.'; $string['indicator:socialbreadth'] = 'BigBlueButton social'; @@ -127,7 +121,6 @@ $string['sendnotification'] = 'Send notification'; $string['minute'] = 'minute'; $string['minutes'] = 'minutes'; -$string['config_dpa_note'] = 'Note: In order to meet your data protection obligations, before using a service provider for this plugin, you must ensure that you have read and accepted the service provider\'s data processing agreement. For the default free BigBlueButton service, this is the Blindside Networks data processing agreement. Please consult with your own privacy professionals for advice.'; $string['config_guestaccess_enabled'] = 'External guest access'; $string['config_guestaccess_enabled_description'] = 'Allow users without an account on your site to access the room.'; @@ -667,3 +660,11 @@ $string['completionview'] = 'Require view'; $string['completionview_desc'] = 'View the room'; $string['completionattendancegroup_help'] = 'Attending the meeting for (n) minutes is required for completion.'; $string['completionengagementgroup_help'] = 'Active participation during the session is required for completion.'; +// Deprecated since Moodle 4.4 +$string['acceptdpa'] = 'I understand and accept the data processing agreement'; +$string['bigbluebuttondisablednotification_subject'] = 'BigBlueButton activity module disabled.'; +$string['bigbluebuttondisablednotification'] = 'The BigBlueButton activity module has been disabled and any existing BigBlueButton course activities are currently not accessible. Prior to re-enabling this plugin, please ensure that you have read and accepted the data processing agreement with Blindside Networks Inc.'; +$string['enablingbigbluebutton'] = 'Enabling BigBlueButton activity'; +$string['enablingbigbluebuttondpainfo'] = 'In order to meet your data protection obligations, prior to enabling this plugin, you may need to ensure that you have read and accepted the Blindside Networks data processing agreement. Please consult with your own privacy professionals for advice.'; +$string['dpainfonotsigned'] = 'Before enabling this plugin, you must confirm that you have read and accepted the Blindside Networks data processing agreement.'; +$string['config_dpa_note'] = 'Note: In order to meet your data protection obligations, before using a service provider for this plugin, you must ensure that you have read and accepted the service provider\'s data processing agreement. For the default free BigBlueButton service, this is the Blindside Networks data processing agreement. Please consult with your own privacy professionals for advice.'; diff --git a/mod/bigbluebuttonbn/lang/en/deprecated.txt b/mod/bigbluebuttonbn/lang/en/deprecated.txt index d9ce987c4e9..ae08997abc1 100644 --- a/mod/bigbluebuttonbn/lang/en/deprecated.txt +++ b/mod/bigbluebuttonbn/lang/en/deprecated.txt @@ -2,3 +2,10 @@ completionview,mod_bigbluebuttonbn completionview_desc,mod_bigbluebuttonbn completionattendancegroup_help,mod_bigbluebuttonbn completionengagementgroup_help,mod_bigbluebuttonbn +acceptdpa,mod_bigbluebuttonbn +bigbluebuttondisablednotification_subject,mod_bigbluebuttonbn +bigbluebuttondisablednotification,mod_bigbluebuttonbn +enablingbigbluebutton,mod_bigbluebuttonbn +enablingbigbluebuttondpainfo,mod_bigbluebuttonbn +dpainfonotsigned,mod_bigbluebuttonbn +config_dpa_note,mod_bigbluebuttonbn diff --git a/mod/bigbluebuttonbn/lib.php b/mod/bigbluebuttonbn/lib.php index b9ad514bca6..e7c649ba271 100644 --- a/mod/bigbluebuttonbn/lib.php +++ b/mod/bigbluebuttonbn/lib.php @@ -719,28 +719,6 @@ function bigbluebuttonbn_print_recent_activity(object $course, bool $viewfullnam return true; } -/** - * Callback method executed prior to enabling the activity module. - * - * @return bool Whether to proceed and enable the plugin or not. - */ -function bigbluebuttonbn_pre_enable_plugin_actions(): bool { - global $PAGE; - - // If the default server configuration is used and the administrator has not accepted the default data processing - // agreement, do not enable the plugin. Instead, display a dynamic form where the administrator can confirm that he - // accepts the DPA prior to enabling the plugin. - if (config::get('server_url') === config::DEFAULT_SERVER_URL && !config::get('default_dpa_accepted')) { - $url = new moodle_url('/admin/category.php', ['category' => 'modbigbluebuttonbnfolder']); - \core\notification::add( - get_string('dpainfonotsigned', 'mod_bigbluebuttonbn', $url->out(false)), - \core\notification::ERROR - ); - return false; - } - // Otherwise, continue and enable the plugin. - return true; -} /** * Creates a number of BigblueButtonBN activities. diff --git a/mod/bigbluebuttonbn/tests/behat/add_instance.feature b/mod/bigbluebuttonbn/tests/behat/add_instance.feature index 602f593725c..2e84cca6a3c 100644 --- a/mod/bigbluebuttonbn/tests/behat/add_instance.feature +++ b/mod/bigbluebuttonbn/tests/behat/add_instance.feature @@ -6,7 +6,7 @@ Feature: bigbluebuttonbn instance Background: Make sure that a course is created Given a BigBlueButton mock server is configured - And I accept dpa and enable bigbluebuttonbn plugin + And I enable "bigbluebuttonbn" "mod" plugin And the following "courses" exist: | fullname | shortname | category | | Test course | Test course | 0 | diff --git a/mod/bigbluebuttonbn/tests/behat/behat_mod_bigbluebuttonbn.php b/mod/bigbluebuttonbn/tests/behat/behat_mod_bigbluebuttonbn.php index ffe5bd69513..7b6b4b54325 100644 --- a/mod/bigbluebuttonbn/tests/behat/behat_mod_bigbluebuttonbn.php +++ b/mod/bigbluebuttonbn/tests/behat/behat_mod_bigbluebuttonbn.php @@ -59,16 +59,6 @@ class behat_mod_bigbluebuttonbn extends behat_base { } } - /** - * Accept dpa and enable bigbluebuttonbn plugin. - * - * @When /^I accept dpa and enable bigbluebuttonbn plugin$/ - */ - public function i_accept_dpa_and_enable_bigbluebuttonbn_plugin(): void { - set_config('bigbluebuttonbn_default_dpa_accepted', true); - $this->execute('behat_general::i_enable_plugin', ['bigbluebuttonbn', 'mod']); - } - /** * Check that the TEST_MOD_BIGBLUEBUTTONBN_MOCK_SERVER is defined, so we can connect to the mock server. * diff --git a/mod/bigbluebuttonbn/tests/behat/completion.feature b/mod/bigbluebuttonbn/tests/behat/completion.feature index fe208aa3573..26df1b2a604 100644 --- a/mod/bigbluebuttonbn/tests/behat/completion.feature +++ b/mod/bigbluebuttonbn/tests/behat/completion.feature @@ -2,7 +2,7 @@ Feature: As a user I can complete a BigblueButtonBN activity by usual or custom criteria Background: - Given I accept dpa and enable bigbluebuttonbn plugin + Given I enable "bigbluebuttonbn" "mod" plugin And the following "courses" exist: | fullname | shortname | category | enablecompletion | | Test course | C1 | 0 | 1 | diff --git a/mod/bigbluebuttonbn/tests/behat/edit_instance.feature b/mod/bigbluebuttonbn/tests/behat/edit_instance.feature index d303818dc06..58a6c9f1344 100644 --- a/mod/bigbluebuttonbn/tests/behat/edit_instance.feature +++ b/mod/bigbluebuttonbn/tests/behat/edit_instance.feature @@ -4,7 +4,7 @@ Feature: I can edit a bigbluebutton instance Background: Make sure that a course is created Given a BigBlueButton mock server is configured - And I accept dpa and enable bigbluebuttonbn plugin + And I enable "bigbluebuttonbn" "mod" plugin And the following config values are set as admin: | bigbluebuttonbn_voicebridge_editable | 1 | And the following "courses" exist: diff --git a/mod/bigbluebuttonbn/tests/behat/end_meeting.feature b/mod/bigbluebuttonbn/tests/behat/end_meeting.feature index 8090997a61b..7a6d91a5db3 100644 --- a/mod/bigbluebuttonbn/tests/behat/end_meeting.feature +++ b/mod/bigbluebuttonbn/tests/behat/end_meeting.feature @@ -6,7 +6,7 @@ Feature: Test the ability to end a meeting Background: Given a BigBlueButton mock server is configured - And I accept dpa and enable bigbluebuttonbn plugin + And I enable "bigbluebuttonbn" "mod" plugin Scenario Outline: Only a BigBlueButton moderator can end a session Given the following course exists: diff --git a/mod/bigbluebuttonbn/tests/behat/group_mode.feature b/mod/bigbluebuttonbn/tests/behat/group_mode.feature index 837b42f8767..fb4b21c2a1d 100644 --- a/mod/bigbluebuttonbn/tests/behat/group_mode.feature +++ b/mod/bigbluebuttonbn/tests/behat/group_mode.feature @@ -5,7 +5,7 @@ Feature: Test the module in group mode. # groupmode 1 = separate groups, we force the group # groupmode 2 = visible group Given a BigBlueButton mock server is configured - And I accept dpa and enable bigbluebuttonbn plugin + And I enable "bigbluebuttonbn" "mod" plugin And the following "courses" exist: | fullname | shortname | category | groupmode | groupmodeforce | | Test Course 1 | C1 | 0 | 1 | 1 | diff --git a/mod/bigbluebuttonbn/tests/behat/guest_access.feature b/mod/bigbluebuttonbn/tests/behat/guest_access.feature index b371cff41eb..b26b486954a 100644 --- a/mod/bigbluebuttonbn/tests/behat/guest_access.feature +++ b/mod/bigbluebuttonbn/tests/behat/guest_access.feature @@ -3,7 +3,7 @@ Feature: Guest access allows external users to connect to a meeting Background: Given a BigBlueButton mock server is configured - And I accept dpa and enable bigbluebuttonbn plugin + And I enable "bigbluebuttonbn" "mod" plugin And the following "courses" exist: | fullname | shortname | category | | Test Course 1 | C1 | 0 | diff --git a/mod/bigbluebuttonbn/tests/behat/join_meeting.feature b/mod/bigbluebuttonbn/tests/behat/join_meeting.feature index 6eb1deeff32..5b180e8af22 100644 --- a/mod/bigbluebuttonbn/tests/behat/join_meeting.feature +++ b/mod/bigbluebuttonbn/tests/behat/join_meeting.feature @@ -4,7 +4,7 @@ Feature: Test the ability to run the full meeting lifecycle (start to end) Background: Given a BigBlueButton mock server is configured - And I accept dpa and enable bigbluebuttonbn plugin + And I enable "bigbluebuttonbn" "mod" plugin And the following config values are set as admin: | bigbluebuttonbn_userlimit_editable | 1 | And the following course exists: diff --git a/mod/bigbluebuttonbn/tests/behat/join_meeting_as_guest.feature b/mod/bigbluebuttonbn/tests/behat/join_meeting_as_guest.feature index 4a2c4edae47..b1bdc4a0857 100644 --- a/mod/bigbluebuttonbn/tests/behat/join_meeting_as_guest.feature +++ b/mod/bigbluebuttonbn/tests/behat/join_meeting_as_guest.feature @@ -3,7 +3,7 @@ Feature: Test the ability to run the full meeting lifecycle (start to end) for g Background: Given a BigBlueButton mock server is configured - And I accept dpa and enable bigbluebuttonbn plugin + And I enable "bigbluebuttonbn" "mod" plugin And the following config values are set as admin: | bigbluebuttonbn_guestaccess_enabled | 1 | And the following course exists: diff --git a/mod/bigbluebuttonbn/tests/behat/lock_settings.feature b/mod/bigbluebuttonbn/tests/behat/lock_settings.feature index 9f6a6f1b6d8..b037e6f5851 100644 --- a/mod/bigbluebuttonbn/tests/behat/lock_settings.feature +++ b/mod/bigbluebuttonbn/tests/behat/lock_settings.feature @@ -6,7 +6,7 @@ Feature: Test that the meeting has the right lock setting. Background: Given a BigBlueButton mock server is configured - And I accept dpa and enable bigbluebuttonbn plugin + And I enable "bigbluebuttonbn" "mod" plugin @javascript Scenario Outline: Teacher should be able to set the right lock feature in a given meeting diff --git a/mod/bigbluebuttonbn/tests/behat/meeting_roles.feature b/mod/bigbluebuttonbn/tests/behat/meeting_roles.feature index 37d0a7509a7..22ef21354c6 100644 --- a/mod/bigbluebuttonbn/tests/behat/meeting_roles.feature +++ b/mod/bigbluebuttonbn/tests/behat/meeting_roles.feature @@ -6,7 +6,7 @@ Feature: Test that meeting roles are sent to the server Background: Given a BigBlueButton mock server is configured - And I accept dpa and enable bigbluebuttonbn plugin + And I enable "bigbluebuttonbn" "mod" plugin @javascript Scenario Outline: Users should receive the appropriate role when joining the meeting diff --git a/mod/bigbluebuttonbn/tests/behat/recordings.feature b/mod/bigbluebuttonbn/tests/behat/recordings.feature index 91ede6f5c1a..d516919a8bc 100644 --- a/mod/bigbluebuttonbn/tests/behat/recordings.feature +++ b/mod/bigbluebuttonbn/tests/behat/recordings.feature @@ -4,7 +4,7 @@ Feature: The recording can be managed through the room page Background: Make sure that import recording is enabled and course, activities and recording exists Given a BigBlueButton mock server is configured - And I accept dpa and enable bigbluebuttonbn plugin + And I enable "bigbluebuttonbn" "mod" plugin And the following "courses" exist: | fullname | shortname | category | | Test Course 1 | C1 | 0 | diff --git a/mod/bigbluebuttonbn/tests/behat/recordings_import.feature b/mod/bigbluebuttonbn/tests/behat/recordings_import.feature index e5f442bce3f..851c9d68d73 100644 --- a/mod/bigbluebuttonbn/tests/behat/recordings_import.feature +++ b/mod/bigbluebuttonbn/tests/behat/recordings_import.feature @@ -7,7 +7,7 @@ Feature: Manage and list recordings And the following config values are set as admin: | bigbluebuttonbn_importrecordings_enabled | 1 | | bigbluebuttonbn_importrecordings_from_deleted_enabled | 1 | - And I accept dpa and enable bigbluebuttonbn plugin + And I enable "bigbluebuttonbn" "mod" plugin And the following "courses" exist: | fullname | shortname | category | | Test Course 1 | C1 | 0 | diff --git a/mod/bigbluebuttonbn/tests/behat/roles.feature b/mod/bigbluebuttonbn/tests/behat/roles.feature index 9e83ca6915b..a6eace3731d 100644 --- a/mod/bigbluebuttonbn/tests/behat/roles.feature +++ b/mod/bigbluebuttonbn/tests/behat/roles.feature @@ -5,7 +5,7 @@ Feature: Set role as Bigbluebuttonbn moderator I need to see the list of roles Background: - Given I accept dpa and enable bigbluebuttonbn plugin + Given I enable "bigbluebuttonbn" "mod" plugin And the following "course" exist: | fullname | shortname | | Course 1 | C1 | diff --git a/mod/bigbluebuttonbn/tests/behat/room.feature b/mod/bigbluebuttonbn/tests/behat/room.feature index 484a417b43b..4b6f8435a06 100644 --- a/mod/bigbluebuttonbn/tests/behat/room.feature +++ b/mod/bigbluebuttonbn/tests/behat/room.feature @@ -3,7 +3,7 @@ Feature: The recording can be managed through the room page and as a user I can Background: Make sure that import recording is enabled and course, activities and recording exists Given a BigBlueButton mock server is configured - And I accept dpa and enable bigbluebuttonbn plugin + And I enable "bigbluebuttonbn" "mod" plugin And the following "courses" exist: | fullname | shortname | category | | Test Course 1 | C1 | 0 | diff --git a/mod/bigbluebuttonbn/tests/behat/start_meeting.feature b/mod/bigbluebuttonbn/tests/behat/start_meeting.feature index 3b1d7cd4171..f8f2d783e3c 100644 --- a/mod/bigbluebuttonbn/tests/behat/start_meeting.feature +++ b/mod/bigbluebuttonbn/tests/behat/start_meeting.feature @@ -6,7 +6,7 @@ Feature: Test the ability to start a meeting Background: Given a BigBlueButton mock server is configured - And I accept dpa and enable bigbluebuttonbn plugin + And I enable "bigbluebuttonbn" "mod" plugin Scenario Outline: Users should be able to join a session depending on the Wait for moderator to join setting Given the following course exists: diff --git a/mod/bigbluebuttonbn/tests/behat/subplugins.feature b/mod/bigbluebuttonbn/tests/behat/subplugins.feature index d098b395a19..227904dc17a 100644 --- a/mod/bigbluebuttonbn/tests/behat/subplugins.feature +++ b/mod/bigbluebuttonbn/tests/behat/subplugins.feature @@ -5,7 +5,7 @@ Feature: BigBlueButtonBN Subplugins test I can see the additional settings coming from the subplugins in the edit form Background: Make sure that the BigBlueButtonBN plugin is enabled - Given I accept dpa and enable bigbluebuttonbn plugin + Given I enable "bigbluebuttonbn" "mod" plugin And the following "courses" exist: | fullname | shortname | category | enablecompletion | | Test course | Test course | 0 | 1 | diff --git a/mod/bigbluebuttonbn/tests/generator/lib.php b/mod/bigbluebuttonbn/tests/generator/lib.php index 5328ba9ca40..c6970e6909d 100644 --- a/mod/bigbluebuttonbn/tests/generator/lib.php +++ b/mod/bigbluebuttonbn/tests/generator/lib.php @@ -50,7 +50,6 @@ class mod_bigbluebuttonbn_generator extends \testing_module_generator { */ public function create_instance($record = null, array $options = null) { // Prior to creating the instance, make sure that the BigBlueButton module is enabled. - set_config('bigbluebuttonbn_default_dpa_accepted', true); $modules = \core_plugin_manager::instance()->get_plugins_of_type('mod'); if (!$modules['bigbluebuttonbn']->is_enabled()) { mod::enable_plugin('bigbluebuttonbn', true); diff --git a/mod/bigbluebuttonbn/tests/lib_test.php b/mod/bigbluebuttonbn/tests/lib_test.php index ae24f29bba8..f91121d54c2 100644 --- a/mod/bigbluebuttonbn/tests/lib_test.php +++ b/mod/bigbluebuttonbn/tests/lib_test.php @@ -698,71 +698,4 @@ class lib_test extends \advanced_testcase { $this->assertFalse(mod_bigbluebuttonbn_core_calendar_is_event_visible($event)); } - /** - * Check the bigbluebuttonbn_pre_enable_plugin_actions function. - * - * @covers ::bigbluebuttonbn_pre_enable_plugin_actions - * @dataProvider bigbluebuttonbn_pre_enable_plugin_actions_provider - * @param bool $initialstate - * @param bool $expected - * @param int $notificationcount - */ - public function test_bigbluebuttonbn_pre_enable_plugin_actions( - ?bool $initialstate, - bool $expected, - int $notificationcount - ): void { - $this->resetAfterTest(true); - - set_config('bigbluebuttonbn_default_dpa_accepted', $initialstate); - - $this->assertEquals($expected, bigbluebuttonbn_pre_enable_plugin_actions()); - $this->assertCount($notificationcount, \core\notification::fetch()); - } - - /** - * Check the bigbluebuttonbn_pre_enable_plugin_actions function. - * - * @covers ::bigbluebuttonbn_pre_enable_plugin_actions - * @dataProvider bigbluebuttonbn_pre_enable_plugin_actions_provider - * @param bool $initialstate - * @param bool $expected - * @param int $notificationcount - */ - public function test_enable_plugin( - ?bool $initialstate, - bool $expected, - int $notificationcount - ): void { - $this->resetAfterTest(true); - - set_config('bigbluebuttonbn_default_dpa_accepted', $initialstate); - $this->assertEquals($expected, \core\plugininfo\mod::enable_plugin('bigbluebuttonbn', 1)); - $this->assertCount($notificationcount, \core\notification::fetch()); - } - - /** - * Data provider for bigbluebuttonbn_pre_enable_plugin_actions tests. - * - * @return array - */ - public function bigbluebuttonbn_pre_enable_plugin_actions_provider(): array { - return [ - 'Initially unset' => [ - null, - false, - 1, - ], - 'Set to false' => [ - false, - false, - 1, - ], - 'Initially set' => [ - true, - true, - 0, - ], - ]; - } } diff --git a/mod/bigbluebuttonbn/tests/local/extension_test.php b/mod/bigbluebuttonbn/tests/local/extension_test.php index 02561cb7bd5..a342441468a 100644 --- a/mod/bigbluebuttonbn/tests/local/extension_test.php +++ b/mod/bigbluebuttonbn/tests/local/extension_test.php @@ -397,7 +397,6 @@ class extension_test extends \advanced_testcase { */ private function enable_plugins(bool $bbbenabled) { // First make sure that either BBB is enabled or not. - set_config('bigbluebuttonbn_default_dpa_accepted', $bbbenabled); \core\plugininfo\mod::enable_plugin('bigbluebuttonbn', $bbbenabled ? 1 : 0); $plugin = extension::BBB_EXTENSION_PLUGIN_NAME . '_simple'; if ($bbbenabled) { From b88cf030a356b0bb0fad53aa4f69a0e1747784ca Mon Sep 17 00:00:00 2001 From: "Shamiso.Jaravaza" <33659194+ssj365@users.noreply.github.com> Date: Wed, 20 Mar 2024 08:51:30 -0600 Subject: [PATCH 2/2] MDL-79239 mod_bigbluebuttonbn: Server cred warning * Added warning messages about credentials * Activity still accessible when using test-moodle/test-install --- mod/bigbluebuttonbn/classes/local/config.php | 25 +++++++++- .../classes/output/view_page.php | 25 ---------- mod/bigbluebuttonbn/classes/settings.php | 15 ++++-- .../classes/test/testcase_helper_trait.php | 3 ++ .../lang/en/bigbluebuttonbn.php | 33 +++++++------ mod/bigbluebuttonbn/lang/en/deprecated.txt | 1 + .../behat/add_instance_in_empty_state.feature | 48 +++++++++++++++++++ .../tests/behat/behat_mod_bigbluebuttonbn.php | 4 ++ .../tests/external/can_join_test.php | 1 + .../external/completion_validate_test.php | 1 + .../tests/external/end_meeting_test.php | 1 + .../get_bigbluebuttons_by_courses_test.php | 1 + .../tests/external/get_join_url_test.php | 1 + .../tests/external/get_recordings_test.php | 1 + .../external/view_bigbluebuttonbn_test.php | 1 + mod/bigbluebuttonbn/view.php | 12 +++++ 16 files changed, 126 insertions(+), 47 deletions(-) create mode 100644 mod/bigbluebuttonbn/tests/behat/add_instance_in_empty_state.feature diff --git a/mod/bigbluebuttonbn/classes/local/config.php b/mod/bigbluebuttonbn/classes/local/config.php index c209a37f1bc..9f47b5fdcc7 100644 --- a/mod/bigbluebuttonbn/classes/local/config.php +++ b/mod/bigbluebuttonbn/classes/local/config.php @@ -65,8 +65,8 @@ class config { */ protected static function defaultvalues(): array { return [ - 'server_url' => self::DEFAULT_SERVER_URL, - 'shared_secret' => self::DEFAULT_SHARED_SECRET, + 'server_url' => '', + 'shared_secret' => '', 'voicebridge_editable' => false, 'importrecordings_enabled' => false, 'importrecordings_from_deleted_enabled' => false, @@ -175,6 +175,27 @@ class config { return (boolean) self::get('importrecordings_enabled'); } + /** + * Check if bbb server credentials are invalid. + * + * @return bool + */ + public static function server_credentials_invalid(): bool { + // Test server credentials across all versions of the plugin are flagged. + $parsedurl = parse_url(self::get('server_url')); + $defaultserverurl = parse_url(self::DEFAULT_SERVER_URL); + if (!isset($parsedurl['host'])) { + return false; + } + if (strpos($parsedurl['host'], $defaultserverurl['host']) === 0) { + return true; + } + if (strpos($parsedurl['host'], 'test-install.blindsidenetworks.com') === 0) { + return true; + } + return false; + } + /** * Wraps current settings in an array. * diff --git a/mod/bigbluebuttonbn/classes/output/view_page.php b/mod/bigbluebuttonbn/classes/output/view_page.php index 90848202b75..d2662d03ade 100644 --- a/mod/bigbluebuttonbn/classes/output/view_page.php +++ b/mod/bigbluebuttonbn/classes/output/view_page.php @@ -66,14 +66,6 @@ class view_page implements renderable, templatable { 'joinurl' => $this->instance->get_join_url(), ]; - if ($this->show_default_server_warning()) { - $templatedata->serverwarning = (new notification( - get_string('view_warning_default_server', 'mod_bigbluebuttonbn'), - notification::NOTIFY_WARNING, - false - ))->export_for_template($output); - } - $viewwarningmessage = config::get('general_warning_message'); if ($this->show_view_warning() && !empty($viewwarningmessage)) { $templatedata->sitenotification = (object) [ @@ -127,23 +119,6 @@ class view_page implements renderable, templatable { return $templatedata; } - /** - * Whether to show the default server warning. - * - * @return bool - */ - protected function show_default_server_warning(): bool { - if (!$this->instance->is_admin()) { - return false; - } - - if (config::DEFAULT_SERVER_URL != config::get('server_url')) { - return false; - } - - return true; - } - /** * Whether to show the view warning. * diff --git a/mod/bigbluebuttonbn/classes/settings.php b/mod/bigbluebuttonbn/classes/settings.php index ae5584df96b..e874d9b1bbc 100644 --- a/mod/bigbluebuttonbn/classes/settings.php +++ b/mod/bigbluebuttonbn/classes/settings.php @@ -152,7 +152,7 @@ class settings { * @throws \coding_exception */ protected function add_general_settings(): admin_settingpage { - global $CFG; + global $CFG, $OUTPUT; $settingsgeneral = new admin_settingpage( $this->section, get_string('config_general', 'bigbluebuttonbn'), @@ -167,11 +167,20 @@ class settings { ); $settingsgeneral->add($item); + if (config::server_credentials_invalid()) { + // A notification should appear when default credentials are used. + $settingsgeneral->add(new admin_setting_heading( + 'bigbluebuttonbn_notification', + '', + $OUTPUT->notification(get_string('credentials_warning', 'mod_bigbluebuttonbn'), 'error') + )); + } + $item = new admin_setting_configtext( 'bigbluebuttonbn_server_url', get_string('config_server_url', 'bigbluebuttonbn'), get_string('config_server_url_description', 'bigbluebuttonbn'), - config::DEFAULT_SERVER_URL, + '', PARAM_RAW ); $item->set_updatedcallback( @@ -190,7 +199,7 @@ class settings { 'bigbluebuttonbn_shared_secret', get_string('config_shared_secret', 'bigbluebuttonbn'), get_string('config_shared_secret_description', 'bigbluebuttonbn'), - config::DEFAULT_SHARED_SECRET + '' ); $this->add_conditional_element( 'shared_secret', diff --git a/mod/bigbluebuttonbn/classes/test/testcase_helper_trait.php b/mod/bigbluebuttonbn/classes/test/testcase_helper_trait.php index df44bc74669..b1a0778d91b 100644 --- a/mod/bigbluebuttonbn/classes/test/testcase_helper_trait.php +++ b/mod/bigbluebuttonbn/classes/test/testcase_helper_trait.php @@ -26,6 +26,7 @@ namespace mod_bigbluebuttonbn\test; use context_module; use mod_bigbluebuttonbn\instance; +use mod_bigbluebuttonbn\local\config; use mod_bigbluebuttonbn\local\proxy\recording_proxy; use mod_bigbluebuttonbn\meeting; use stdClass; @@ -158,6 +159,8 @@ trait testcase_helper_trait { } try { $this->getDataGenerator()->get_plugin_generator('mod_bigbluebuttonbn')->reset_mock(); + // Mock server expects a value. By default this field is empty. + set_config('bigbluebuttonbn_shared_secret', config::DEFAULT_SHARED_SECRET); } catch (\moodle_exception $e) { $this->markTestSkipped( 'Cannot connect to the mock server for this test. Make sure that TEST_MOD_BIGBLUEBUTTONBN_MOCK_SERVER points diff --git a/mod/bigbluebuttonbn/lang/en/bigbluebuttonbn.php b/mod/bigbluebuttonbn/lang/en/bigbluebuttonbn.php index 2c87c32c0ce..6423bcbdff7 100644 --- a/mod/bigbluebuttonbn/lang/en/bigbluebuttonbn.php +++ b/mod/bigbluebuttonbn/lang/en/bigbluebuttonbn.php @@ -26,6 +26,7 @@ defined('MOODLE_INTERNAL') || die(); $string['activityoverview'] = 'You have upcoming BigBlueButton sessions'; +$string['credentials_warning'] = 'The use of default server credentials will soon expire (see note above to obtain new credentials).'; $string['bbbduetimeoverstartingtime'] = 'The close time must be later than the open time.'; $string['bbbdurationwarning'] = 'The maximum duration for this session is %duration% minutes.'; $string['bbbrecordwarning'] = 'This session may be recorded.'; @@ -73,6 +74,10 @@ $string['resetrecordings_help'] = 'Deleting the recordings will make them inacce $string['search:activity'] = 'BigBlueButton - activity information'; $string['search:tags'] = 'BigBlueButton - tags information'; $string['settings'] = 'BigBlueButton settings'; + +$string['settings_credential_warning_no_capability'] = 'The use of default server credentials will soon expire. To use BigBlueButton your site will require new server credentials. Please contact your site administrator for help with this.'; +$string['settings_credential_warning'] = 'Default BigBlueButton plugin credentials will soon expire. See BigBlueButton plugin settings (opens in a new window) for more information.'; + $string['privacy:metadata:bigbluebuttonbn'] = 'BigBlueButton session configuration'; $string['privacy:metadata:bigbluebuttonbn:participants'] = 'A list of rules that define the role users will have in the BigBlueButton session. A user ID may be stored as permissions can be granted per role or per user.'; $string['privacy:metadata:bigbluebuttonbn_logs'] = 'Stores events triggered when using the plugin.'; @@ -126,19 +131,13 @@ $string['config_guestaccess_enabled'] = 'External guest access'; $string['config_guestaccess_enabled_description'] = 'Allow users without an account on your site to access the room.'; $string['config_general'] = 'General settings'; -$string['config_general_description'] = 'These settings are always used.'; +$string['config_general_description'] = 'To set up BigBlueButton, you can either use your own BigBlueButton server and credentials, or obtain credentials through the Blindside Networks Registration Portal (opens in a new window).'; $string['config_profile_picture_enabled'] = 'Show profile pictures'; $string['config_profile_picture_enabled_description'] = 'Should profile pictures of participants be shown in BigBlueButton sessions?'; $string['config_server_url'] = 'BigBlueButton server URL'; -$string['config_server_url_description'] = 'The default credentials are for a free BigBlueButton service for Moodle (opens in new window) provided by Blindside Networks with restrictions as follows: -
    -
  1. The maximum length for each session is 60 minutes
  2. -
  3. The maximum number of concurrent users per session is 25
  4. -
  5. Recordings expire after seven (7) days and are not downloadable
  6. -
  7. Student webcams are only visible to the moderator.
  8. -
'; +$string['config_server_url_description'] = 'The server URL of your BigBlueButton server '; $string['config_shared_secret'] = 'BigBlueButton shared secret'; -$string['config_shared_secret_description'] = 'The security secret of your BigBlueButton server. The default secret is for a free BigBlueButton service provided by Blindside Networks.'; +$string['config_shared_secret_description'] = 'The security secret of your BigBlueButton server.'; $string['config_checksum_algorithm'] = 'BigBlueButton server checksum algorithm'; $string['config_checksum_algorithm_description'] = 'SHA1 is compatible with older servers. SHA256 and SHA512 are more secure. SHA512 is FIPS 140-2 compliant.'; @@ -622,13 +621,6 @@ $string['notification_recording_ready_subject'] = 'Recording available'; $string['view_error_meeting_not_running'] = 'Something went wrong; the session is not running.'; $string['view_error_current_state_not_found'] = 'Current state was not found. The recording may have been deleted or the BigBlueButton server is not compatible with the action performed.'; $string['view_error_action_not_completed'] = 'Action could not be completed'; -$string['view_warning_default_server'] = 'This site is using a free BigBlueButton service for Moodle (opens in new window) provided by Blindside Networks with restrictions as follows: -
    -
  1. The maximum length for each session is 60 minutes
  2. -
  3. The maximum number of concurrent users per session is 25
  4. -
  5. Recordings expire after seven (7) days and are not downloadable
  6. -
  7. Student webcams are only visible to the moderator.
  8. -
'; $string['view_room'] = 'View room'; $string['index_error_noinstances'] = 'There are no instances of BigBlueButton rooms'; @@ -660,7 +652,7 @@ $string['completionview'] = 'Require view'; $string['completionview_desc'] = 'View the room'; $string['completionattendancegroup_help'] = 'Attending the meeting for (n) minutes is required for completion.'; $string['completionengagementgroup_help'] = 'Active participation during the session is required for completion.'; -// Deprecated since Moodle 4.4 +// Deprecated since Moodle 4.4. $string['acceptdpa'] = 'I understand and accept the data processing agreement'; $string['bigbluebuttondisablednotification_subject'] = 'BigBlueButton activity module disabled.'; $string['bigbluebuttondisablednotification'] = 'The BigBlueButton activity module has been disabled and any existing BigBlueButton course activities are currently not accessible. Prior to re-enabling this plugin, please ensure that you have read and accepted the data processing agreement with Blindside Networks Inc.'; @@ -668,3 +660,10 @@ $string['enablingbigbluebutton'] = 'Enabling BigBlueButton activity'; $string['enablingbigbluebuttondpainfo'] = 'In order to meet your data protection obligations, prior to enabling this plugin, you may need to ensure that you have read and accepted the Blindside Networks data processing agreement. Please consult with your own privacy professionals for advice.'; $string['dpainfonotsigned'] = 'Before enabling this plugin, you must confirm that you have read and accepted the Blindside Networks data processing agreement.'; $string['config_dpa_note'] = 'Note: In order to meet your data protection obligations, before using a service provider for this plugin, you must ensure that you have read and accepted the service provider\'s data processing agreement. For the default free BigBlueButton service, this is the Blindside Networks data processing agreement. Please consult with your own privacy professionals for advice.'; +$string['view_warning_default_server'] = 'This site is using a free BigBlueButton service for Moodle (opens in new window) provided by Blindside Networks with restrictions as follows: +
    +
  1. The maximum length for each session is 60 minutes
  2. +
  3. The maximum number of concurrent users per session is 25
  4. +
  5. Recordings expire after seven (7) days and are not downloadable
  6. +
  7. Student webcams are only visible to the moderator.
  8. +
'; diff --git a/mod/bigbluebuttonbn/lang/en/deprecated.txt b/mod/bigbluebuttonbn/lang/en/deprecated.txt index ae08997abc1..936094c9171 100644 --- a/mod/bigbluebuttonbn/lang/en/deprecated.txt +++ b/mod/bigbluebuttonbn/lang/en/deprecated.txt @@ -9,3 +9,4 @@ enablingbigbluebutton,mod_bigbluebuttonbn enablingbigbluebuttondpainfo,mod_bigbluebuttonbn dpainfonotsigned,mod_bigbluebuttonbn config_dpa_note,mod_bigbluebuttonbn +view_warning_default_server,mod_bigbluebuttonbn diff --git a/mod/bigbluebuttonbn/tests/behat/add_instance_in_empty_state.feature b/mod/bigbluebuttonbn/tests/behat/add_instance_in_empty_state.feature new file mode 100644 index 00000000000..04b69feab1e --- /dev/null +++ b/mod/bigbluebuttonbn/tests/behat/add_instance_in_empty_state.feature @@ -0,0 +1,48 @@ +@mod @mod_bigbluebuttonbn @javascript +Feature: I can create a bigbluebuttonbn instance with default server + In case the BigBlueButton server has not been configured + As a user + I want to see a notification message + + Background: Make sure that a course is created + Given I enable "bigbluebuttonbn" "mod" plugin + And the following "courses" exist: + | fullname | shortname | category | + | Test course | Test course | 0 | + And the following "users" exist: + | username | firstname | lastname | email | + | user1 | User1G1 | 1 | user1@example.com | + | teacher1 | TeacherG1 | 1 | teacher1@example.com | + And the following "course enrolments" exist: + | user | course | role | + | user1 | Test course | student | + | teacher1 | Test course | editingteacher | + And the following "activities" exist: + | activity | course | name | type | + | bigbluebuttonbn | Test course | BBB Instance name | 0 | + | bigbluebuttonbn | Test course | BBB Instance name 2 | 1 | + | bigbluebuttonbn | Test course | BBB Instance name 3 | 2 | + And I am on the "Test course" "course" page logged in as "admin" + + Scenario Outline: Add an activity using default server for the three types of instance types + When I change window size to "large" + And I add a bigbluebuttonbn activity to course "Test course" section "1" + And I select "" from the "Instance type" singleselect + Then I should see "Restrict access" + + Examples: + | type | + | Room with recordings | + | Room only | + | Recordings only | + + Scenario Outline: Users should see a notification message when accessing activities if the default server is used + When I am on the "BBB Instance name" Activity page logged in as + Then "Join session" "link" should exist + And I "" + + Examples: + | user | shouldseemessage | messageexist | + | user1 | The use of default server credentials will soon expire.| should not see | + | teacher1 | The use of default server credentials will soon expire.| should see | + | admin | Default BigBlueButton plugin credentials will soon expire.| should see | diff --git a/mod/bigbluebuttonbn/tests/behat/behat_mod_bigbluebuttonbn.php b/mod/bigbluebuttonbn/tests/behat/behat_mod_bigbluebuttonbn.php index 7b6b4b54325..6f1190de394 100644 --- a/mod/bigbluebuttonbn/tests/behat/behat_mod_bigbluebuttonbn.php +++ b/mod/bigbluebuttonbn/tests/behat/behat_mod_bigbluebuttonbn.php @@ -28,6 +28,7 @@ require_once(__DIR__ . '/../../../../lib/behat/behat_base.php'); use Behat\Behat\Hook\Scope\BeforeScenarioScope; use Behat\Gherkin\Node\TableNode; use mod_bigbluebuttonbn\instance; +use mod_bigbluebuttonbn\local\config; use mod_bigbluebuttonbn\test\subplugins_test_helper_trait; use Moodle\BehatExtension\Exception\SkippedException; require_once(__DIR__ . '../../../classes/test/subplugins_test_helper_trait.php'); @@ -57,6 +58,9 @@ class behat_mod_bigbluebuttonbn extends behat_base { if (defined('TEST_MOD_BIGBLUEBUTTONBN_MOCK_SERVER')) { $this->send_mock_request('backoffice/reset'); } + // Fields are empty by default which causes tests to fail. + set_config('bigbluebuttonbn_server_url', config::DEFAULT_SERVER_URL); + set_config('bigbluebuttonbn_shared_secret', config::DEFAULT_SHARED_SECRET); } /** diff --git a/mod/bigbluebuttonbn/tests/external/can_join_test.php b/mod/bigbluebuttonbn/tests/external/can_join_test.php index 8fe1d7080ee..597bb8e44cb 100644 --- a/mod/bigbluebuttonbn/tests/external/can_join_test.php +++ b/mod/bigbluebuttonbn/tests/external/can_join_test.php @@ -61,6 +61,7 @@ class can_join_test extends \externallib_advanced_testcase { * Test execute API CALL with no instance */ public function test_execute_no_instance() { + $this->resetAfterTest(); $canjoin = $this->can_join(1234, 5678); $this->assertIsArray($canjoin); diff --git a/mod/bigbluebuttonbn/tests/external/completion_validate_test.php b/mod/bigbluebuttonbn/tests/external/completion_validate_test.php index df6524095a0..f3dbf16a2b1 100644 --- a/mod/bigbluebuttonbn/tests/external/completion_validate_test.php +++ b/mod/bigbluebuttonbn/tests/external/completion_validate_test.php @@ -63,6 +63,7 @@ class completion_validate_test extends \externallib_advanced_testcase { * Test execute API CALL with no instance */ public function test_execute_no_instance() { + $this->resetAfterTest(); $result = $this->completion_validate(1234); $this->assertIsArray($result); diff --git a/mod/bigbluebuttonbn/tests/external/end_meeting_test.php b/mod/bigbluebuttonbn/tests/external/end_meeting_test.php index d3fd82e4822..c079cc89df6 100644 --- a/mod/bigbluebuttonbn/tests/external/end_meeting_test.php +++ b/mod/bigbluebuttonbn/tests/external/end_meeting_test.php @@ -63,6 +63,7 @@ class end_meeting_test extends \externallib_advanced_testcase { * Test execute API CALL with no instance */ public function test_execute_no_instance() { + $this->resetAfterTest(); $this->expectException(moodle_exception::class); $endmeeting = $this->end_meeting(1234, 5678); } diff --git a/mod/bigbluebuttonbn/tests/external/get_bigbluebuttons_by_courses_test.php b/mod/bigbluebuttonbn/tests/external/get_bigbluebuttons_by_courses_test.php index cd0db474008..a963ba499bd 100644 --- a/mod/bigbluebuttonbn/tests/external/get_bigbluebuttons_by_courses_test.php +++ b/mod/bigbluebuttonbn/tests/external/get_bigbluebuttons_by_courses_test.php @@ -63,6 +63,7 @@ class get_bigbluebuttons_by_courses_test extends \externallib_advanced_testcase * Test execute API CALL with no instance */ public function test_execute_no_instance() { + $this->resetAfterTest(); $bbbactivities = $this->get_bigbluebuttons_by_courses([1234, 5678]); $this->assertIsArray($bbbactivities); diff --git a/mod/bigbluebuttonbn/tests/external/get_join_url_test.php b/mod/bigbluebuttonbn/tests/external/get_join_url_test.php index 9036916d61e..e245b37d18c 100644 --- a/mod/bigbluebuttonbn/tests/external/get_join_url_test.php +++ b/mod/bigbluebuttonbn/tests/external/get_join_url_test.php @@ -63,6 +63,7 @@ class get_join_url_test extends \externallib_advanced_testcase { * Test execute API CALL with no instance */ public function test_execute_no_instance() { + $this->resetAfterTest(); $this->expectExceptionMessageMatches('/No such instance.*/'); $joinurl = $this->get_join_url(1234, 5678); diff --git a/mod/bigbluebuttonbn/tests/external/get_recordings_test.php b/mod/bigbluebuttonbn/tests/external/get_recordings_test.php index 96b85bc4816..ca106e9e1d3 100644 --- a/mod/bigbluebuttonbn/tests/external/get_recordings_test.php +++ b/mod/bigbluebuttonbn/tests/external/get_recordings_test.php @@ -63,6 +63,7 @@ class get_recordings_test extends \externallib_advanced_testcase { * Test execute API CALL with no instance */ public function test_execute_wrong_instance() { + $this->resetAfterTest(); $getrecordings = $this->get_recordings(1234); $this->assertIsArray($getrecordings); diff --git a/mod/bigbluebuttonbn/tests/external/view_bigbluebuttonbn_test.php b/mod/bigbluebuttonbn/tests/external/view_bigbluebuttonbn_test.php index 31e0ca4574b..1b9f6983600 100644 --- a/mod/bigbluebuttonbn/tests/external/view_bigbluebuttonbn_test.php +++ b/mod/bigbluebuttonbn/tests/external/view_bigbluebuttonbn_test.php @@ -63,6 +63,7 @@ class view_bigbluebuttonbn_test extends \externallib_advanced_testcase { * Test execute API CALL with no instance */ public function test_execute_no_instance() { + $this->resetAfterTest(); $bbbactivities = $this->view_bigbluebuttonbn(1234); $this->assertIsArray($bbbactivities); diff --git a/mod/bigbluebuttonbn/view.php b/mod/bigbluebuttonbn/view.php index faa5bc8de43..74175cddd1c 100644 --- a/mod/bigbluebuttonbn/view.php +++ b/mod/bigbluebuttonbn/view.php @@ -26,6 +26,7 @@ */ use mod_bigbluebuttonbn\instance; +use mod_bigbluebuttonbn\local\config; use mod_bigbluebuttonbn\local\exceptions\server_not_available_exception; use mod_bigbluebuttonbn\local\proxy\bigbluebutton_proxy; use mod_bigbluebuttonbn\logger; @@ -87,6 +88,17 @@ try { echo $OUTPUT->header(); +// Valid credentials have not been setup, then we output a message to teachers and admin. +if (config::server_credentials_invalid()) { + if (has_capability('moodle/site:config', context_system::instance())) { + $settingslink = new moodle_url('/admin/settings.php', ['section' => 'modsettingbigbluebuttonbn']); + echo $OUTPUT->notification(get_string('settings_credential_warning', 'bigbluebuttonbn', + ['settingslink' => $settingslink->out()]), 'notifywarning'); + } else if (has_capability('moodle/course:manageactivities', context_course::instance($course->id))) { + echo $OUTPUT->notification(get_string('settings_credential_warning_no_capability', 'bigbluebuttonbn'), 'notifywarning'); + } +} + // Validate if the user is in a role allowed to join. if (!$instance->can_join() && $instance->get_type() != instance::TYPE_RECORDING_ONLY) { if (isguestuser()) {