diff --git a/REDCapPRO.php b/REDCapPRO.php index e8d8c97..75bfef2 100644 --- a/REDCapPRO.php +++ b/REDCapPRO.php @@ -148,6 +148,9 @@ class REDCapPRO extends AbstractExternalModule public $LOGO_URL = "https://i.imgur.com/5Xq2Vqt.png"; public $LOGO_ALTERNATE_URL = "https://i.imgur.com/fu0t8V1.png"; + public $customLogoImage = null; // custom logo image on create password page + public $customLogoText = ''; // custom logo text for branding + //////////////\\\\\\\\\\\\\\ ///// REDCAP HOOKS \\\\\ //////////////\\\\\\\\\\\\\\ @@ -476,6 +479,29 @@ public function redcap_module_link_check_display($project_id, $link) return null; } + public function redcap_module_system_change_version($version, $old_version) + { + $this->logEvent("Module Version Changed", [ + "version" => $version, + "old_version" => $old_version, + "redcap_user" => $this->safeGetUsername() + ]); + + $new_version_number = explode('v', $version)[1]; + $old_version_number = explode('v', $old_version)[1]; + + // If upgrading from a previous version to version 0.4.5, + // assume all existing logs are genuine, create module token, + // and add the token to all existing logs. + $critical_version = "0.4.6"; + if ( + version_compare($new_version_number, $critical_version, ">=") && + version_compare($old_version_number, $critical_version, "<") + ) { + $this->updateLogsWithToken(); + } + } + //////////////////\\\\\\\\\\\\\\\\\\\ ///// EMAIL-RELATED METHODS \\\\\ @@ -542,7 +568,7 @@ public function sendEmailUpdateEmail(string $username, string $new_email, string $old_email_clean = \REDCap::escapeHtml($old_email); $new_email_clean = \REDCap::escapeHtml($new_email); $body = "
- img
+ " . $this->baseLogoImage() . "

" . $this->tt("email_update_greeting") . "

" . $this->tt("email_update_message1") . " ${username}