diff --git a/mod/bigbluebuttonbn/classes/local/config.php b/mod/bigbluebuttonbn/classes/local/config.php index a7caaa0c2a2..ccb3053d8f3 100644 --- a/mod/bigbluebuttonbn/classes/local/config.php +++ b/mod/bigbluebuttonbn/classes/local/config.php @@ -30,10 +30,10 @@ use mod_bigbluebuttonbn\recording; class config { /** @var string Default bigbluebutton server url */ - public const DEFAULT_SERVER_URL = 'http://test-install.blindsidenetworks.com/bigbluebutton/'; + public const DEFAULT_SERVER_URL = 'https://test-moodle.blindsidenetworks.com/bigbluebutton/'; /** @var string Default bigbluebutton server shared secret */ - public const DEFAULT_SHARED_SECRET = '8cd8ef52e8e101574e400365b55e11a6'; + public const DEFAULT_SHARED_SECRET = '0b21fcaf34673a8c3ec8ed877d76ae34'; /** * Returns moodle version. diff --git a/mod/bigbluebuttonbn/db/upgrade.php b/mod/bigbluebuttonbn/db/upgrade.php index 1481aa2287a..49255086c3c 100644 --- a/mod/bigbluebuttonbn/db/upgrade.php +++ b/mod/bigbluebuttonbn/db/upgrade.php @@ -25,6 +25,7 @@ */ use mod_bigbluebuttonbn\plugin; +use mod_bigbluebuttonbn\local\config; defined('MOODLE_INTERNAL') || die(); @@ -420,6 +421,16 @@ function xmldb_bigbluebuttonbn_upgrade($oldversion = 0) { upgrade_mod_savepoint(true, 2021083101, 'bigbluebuttonbn'); } + if ($oldversion < 2021091408) { + // Change BigBliueButton Server credentials to new defaults if test-install is being used. + if (config::get('server_url') == 'http://test-install.blindsidenetworks.com/bigbluebutton/') { + set_config('bigbluebuttonbn_server_url', config::DEFAULT_SERVER_URL); + set_config('bigbluebuttonbn_shared_secret', config::DEFAULT_SHARED_SECRET); + } + // Bigbluebuttonbn savepoint reached. + upgrade_mod_savepoint(true, 2021091408, 'bigbluebuttonbn'); + } + return true; } diff --git a/mod/bigbluebuttonbn/lang/en/bigbluebuttonbn.php b/mod/bigbluebuttonbn/lang/en/bigbluebuttonbn.php index a31f6c845a9..d8639bb7fb8 100644 --- a/mod/bigbluebuttonbn/lang/en/bigbluebuttonbn.php +++ b/mod/bigbluebuttonbn/lang/en/bigbluebuttonbn.php @@ -129,7 +129,7 @@ $string['config_general_description'] = 'These settings are always used'; $string['config_server_url'] = 'BigBlueButton Server URL'; $string['config_server_url_description'] = 'The URL of your BigBlueButton server must end with /bigbluebutton/. (This default URL is for a BigBlueButton server provided by Blindside Networks that you can use for testing.)'; $string['config_shared_secret'] = 'BigBlueButton Shared Secret'; -$string['config_shared_secret_description'] = 'The security salt of your BigBlueButton server. (This default salt is for a BigBlueButton server provided by Blindside Networks that you can use for testing.)'; +$string['config_shared_secret_description'] = 'The security secret of your BigBlueButton server. (This default secret is for a BigBlueButton server provided by Blindside Networks that you can use for testing.)'; $string['config_recording'] = 'Configuration for "Record meeting" feature'; $string['config_recording_description'] = 'These settings are feature specific'; @@ -315,7 +315,7 @@ $string['index_confirm_end'] = 'Do you wish to end the virtual class?'; $string['index_disabled'] = 'disabled'; $string['index_enabled'] = 'enabled'; $string['index_ending'] = 'Ending the virtual classroom ... please wait'; -$string['index_error_checksum'] = 'A checksum error occurred. Make sure you entered the correct salt.'; +$string['index_error_checksum'] = 'A checksum error occurred. Make sure you entered the correct secret.'; $string['index_error_forciblyended'] = 'Unable to join this meeting because it has been manually ended.'; $string['index_error_unable_display'] = 'Unable to display the meetings. Please check the url of the BigBlueButton server AND check to see if the BigBlueButton server is running.'; $string['index_heading_actions'] = 'Actions'; diff --git a/mod/bigbluebuttonbn/tests/behat/behat_mod_bigbluebuttonbn.php b/mod/bigbluebuttonbn/tests/behat/behat_mod_bigbluebuttonbn.php index 08649f34c48..373d27aaba2 100644 --- a/mod/bigbluebuttonbn/tests/behat/behat_mod_bigbluebuttonbn.php +++ b/mod/bigbluebuttonbn/tests/behat/behat_mod_bigbluebuttonbn.php @@ -96,10 +96,10 @@ XPATH * Send a query to the mock server * * @param string $endpoint - * @throws coding_exception + * @param array $params */ - protected function send_mock_request(string $endpoint): void { - $url = $this->get_mocked_server_url($endpoint); + protected function send_mock_request(string $endpoint, array $params = []): void { + $url = $this->get_mocked_server_url($endpoint, $params); $curl = new \curl(); $curl->get($url->out_omit_querystring(), $url->params()); @@ -173,7 +173,10 @@ XPATH * @Given the BigBlueButtonBN server has sent recording ready notifications */ public function trigger_recording_ready_notification(): void { - $this->send_mock_request('backoffice/sendNotifications'); + $this->send_mock_request('backoffice/sendNotifications', [ + 'secret' => \mod_bigbluebuttonbn\local\config::DEFAULT_SHARED_SECRET, + ] + ); } } diff --git a/mod/bigbluebuttonbn/version.php b/mod/bigbluebuttonbn/version.php index b081fdc7701..cde2191b569 100644 --- a/mod/bigbluebuttonbn/version.php +++ b/mod/bigbluebuttonbn/version.php @@ -27,6 +27,6 @@ defined('MOODLE_INTERNAL') || die; -$plugin->version = 2021091407; +$plugin->version = 2021091408; $plugin->requires = 2020061500; $plugin->component = 'mod_bigbluebuttonbn';