diff --git a/public/mod/bigbluebuttonbn/classes/local/helpers/reset.php b/public/mod/bigbluebuttonbn/classes/local/helpers/reset.php index b09a686685e..fcd30c6433a 100644 --- a/public/mod/bigbluebuttonbn/classes/local/helpers/reset.php +++ b/public/mod/bigbluebuttonbn/classes/local/helpers/reset.php @@ -54,9 +54,9 @@ class reset { true ); if ($recordings) { - // Remove all the recordings. + // Remove all the recordings locally only (do NOT delete from BBB server). foreach ($recordings as $recording) { - $recording->delete(); + $recording->set_skip_remote_deletion(true)->delete(); } } } diff --git a/public/mod/bigbluebuttonbn/classes/recording.php b/public/mod/bigbluebuttonbn/classes/recording.php index 57d0c5f06d7..86026a4af22 100644 --- a/public/mod/bigbluebuttonbn/classes/recording.php +++ b/public/mod/bigbluebuttonbn/classes/recording.php @@ -69,6 +69,9 @@ class recording extends persistent { /** @var bool Whether metadata been changed so the remote information needs to be updated ? */ protected $metadatachanged = false; + /** @var bool When true, skip remote BBB deletion in before_delete(). */ + protected $skipremotedeletion = false; + /** @var int A refresh period for recordings, defaults to 300s (5mins) */ public const RECORDING_REFRESH_DEFAULT_PERIOD = 300; @@ -436,6 +439,10 @@ class recording extends persistent { * @return void */ protected function before_delete() { + if ($this->skipremotedeletion) { + return; + } + $recordid = $this->get('recordingid'); if ($recordid && !$this->get('imported')) { recording_proxy::delete_recording($recordid); @@ -445,6 +452,18 @@ class recording extends persistent { } } + /** + * Mark this recording so that delete() only removes the local DB row + * and does NOT delete the recording from the BigBlueButton server. + * + * @param bool $skipremote + * @return $this + */ + public function set_skip_remote_deletion(bool $skipremote = true): self { + $this->skipremotedeletion = $skipremote; + return $this; + } + /** * Set name * diff --git a/public/mod/bigbluebuttonbn/lang/en/bigbluebuttonbn.php b/public/mod/bigbluebuttonbn/lang/en/bigbluebuttonbn.php index 0a246f88c0c..867c658d7dd 100644 --- a/public/mod/bigbluebuttonbn/lang/en/bigbluebuttonbn.php +++ b/public/mod/bigbluebuttonbn/lang/en/bigbluebuttonbn.php @@ -70,7 +70,7 @@ $string['resettags'] = 'Delete tags'; $string['resetlogs'] = 'Delete custom logs'; $string['resetrecordings'] = 'Delete recordings'; $string['resetlogs_help'] = 'Deleting the logs will result in lost references to recordings.'; -$string['resetrecordings_help'] = 'Deleting the recordings will make them inaccessible from anywhere. This action cannot be undone!'; +$string['resetrecordings_help'] = 'Deleting the recordings will remove them from this course. The media stored on the BigBlueButton server are not affected.'; $string['search:activity'] = 'BigBlueButton - activity information'; $string['search:tags'] = 'BigBlueButton - tags information'; @@ -537,7 +537,7 @@ $string['view_conference_action_end'] = 'End session'; $string['view_recording'] = 'recording'; $string['view_recording_link'] = 'imported link'; $string['view_recording_link_warning'] = 'This is a link pointing to a recording that was created in a different course or activity.'; -$string['view_recording_delete_confirmation'] = 'Are you sure you want to delete {$a}?'; +$string['view_recording_delete_confirmation'] = 'Are you sure you want to permanently delete the {$a}? This will remove the media file from the BigBlueButton server and cannot be undone.'; $string['view_recording_delete_confirmation_warning_s'] = 'This recording has {$a} link associated that was imported into a different course or activity. If the recording is deleted, this link will also be removed.'; $string['view_recording_delete_confirmation_warning_p'] = 'This recording has {$a} links associated that were imported into different courses or activities. If the recording is deleted, these links will also be removed.'; $string['view_recording_publish_confirmation'] = 'Are you sure you want to publish this {$a}?';