From d58ae0c0755ee5c572dba25e57e41f467197629d Mon Sep 17 00:00:00 2001 From: "Eloy Lafuente (stronk7)" Date: Wed, 18 Oct 2017 00:44:20 +0200 Subject: [PATCH] MDL-36580 backup: Apply the decrypt() method to lti "secrets" --- mod/lti/backup/moodle2/restore_lti_stepslib.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mod/lti/backup/moodle2/restore_lti_stepslib.php b/mod/lti/backup/moodle2/restore_lti_stepslib.php index 989be59ca10..5b1a61a5255 100644 --- a/mod/lti/backup/moodle2/restore_lti_stepslib.php +++ b/mod/lti/backup/moodle2/restore_lti_stepslib.php @@ -84,6 +84,11 @@ class restore_lti_activity_structure_step extends restore_activity_structure_ste // TODO: MDL-34161 - Fix restore to support course/site tools & submissions. $data->typeid = 0; + // Try to decrypt resourcekey and password. Null if not possible (DB default). + // Note these fields were originally encrypted on backup using {link @encrypted_final_element}. + $data->resourcekey = $this->decrypt($data->resourcekey); + $data->password = $this->decrypt($data->password); + $newitemid = $DB->insert_record('lti', $data); // Immediately after inserting "activity" record, call this. -- 2.11.4.GIT