From 1c3f3adcfef462919c36bc0db75e76639a0d599a Mon Sep 17 00:00:00 2001 From: Akhil Date: Sat, 28 May 2022 15:32:15 +0530 Subject: [PATCH 1/2] Fix recovery email patch --- Dockerfile | 2 +- patches/006-recovery-email-changes.patch | 17 ++++++++++------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index 915a591f..a5e4fdc5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,7 +17,7 @@ ARG ECLOUD_LAUNCHER_JOB_ID="308979" ARG GOOGLE_INTEGRATION_VERSION="1.0.6" ARG LDAP_WRITE_SUPPORT_VERSION="1.4.0" -RUN sed -i 's/22,2,8,1/22,2,8,10/' ${BASE_DIR}/version.php +RUN sed -i 's/22,2,8,1/22,2,8,11/' ${BASE_DIR}/version.php COPY custom_entrypoint.sh / RUN chmod +x /custom_entrypoint.sh RUN mkdir -p /var/www/skeleton/Documents && mkdir -p /var/www/skeleton/Images diff --git a/patches/006-recovery-email-changes.patch b/patches/006-recovery-email-changes.patch index 38c6657f..8f2bc148 100644 --- a/patches/006-recovery-email-changes.patch +++ b/patches/006-recovery-email-changes.patch @@ -1,6 +1,6 @@ ---- ./core/Controller/LostController.php 2022-05-27 14:46:14.400838300 +0530 -+++ .//core/Controller/LostController-new.php 2022-05-27 14:46:16.710838300 +0530 -@@ -174,6 +174,20 @@ +--- ./core/Controller/LostController.php 2022-05-25 15:07:44.582984541 +0530 ++++ .//core/Controller/LostController-new.php 2022-05-28 15:29:43.418394746 +0530 +@@ -174,8 +174,23 @@ */ protected function checkPasswordResetToken(string $token, string $userId): void { try { @@ -8,7 +8,6 @@ + $domainSuffix = !empty($domain) ? '@' . $domain : ''; + $altDomain = $this->config->getSystemValue('alt_mail_domain', ''); + $altDomainSuffix = !empty($altDomain) ? '@' . $altDomain : ''; -+ + if(stristr($userId, $domainSuffix) !== FALSE) { + $userId = str_replace($domainSuffix, '', $userId); + } @@ -19,9 +18,14 @@ + $userId = $userId . $domainSuffix; + } $user = $this->userManager->get($userId); - $this->verificationToken->check($token, $user, 'lostpassword', $user ? $user->getEMailAddress() : '', true); +- $this->verificationToken->check($token, $user, 'lostpassword', $user ? $user->getEMailAddress() : '', true); ++ $recoveryEmail = $this->config->getUserValue($userId, 'email-recovery', 'recovery-email'); ++ $mailAddress = is_null($recoveryEmail) ? '' : $recoveryEmail; ++ $this->verificationToken->check($token, $user, 'lostpassword', $mailAddress, true); } catch (InvalidTokenException $e) { -@@ -287,8 +301,22 @@ + $error = $e->getCode() === InvalidTokenException::TOKEN_EXPIRED + ? $this->l10n->t('Could not reset password because the token is expired') +@@ -287,8 +302,21 @@ * @throws \OCP\PreConditionNotMetException */ protected function sendEmail($input) { @@ -38,7 +42,6 @@ + if(!$this->userManager->userExists($input) ) { + $input = $input . $domainSuffix; + } -+ $user = $this->findUserByIdOrMail($input); - $email = $user->getEMailAddress(); + $email = $this->config->getUserValue($user->getUID(), 'email-recovery', 'recovery-email'); -- GitLab From 7a4b2cd8649a1b62ae47e05ceef067aa13d9b382 Mon Sep 17 00:00:00 2001 From: Akhil Date: Sat, 28 May 2022 15:39:49 +0530 Subject: [PATCH 2/2] fix path --- patches/006-recovery-email-changes.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/patches/006-recovery-email-changes.patch b/patches/006-recovery-email-changes.patch index 8f2bc148..bffaf5b3 100644 --- a/patches/006-recovery-email-changes.patch +++ b/patches/006-recovery-email-changes.patch @@ -1,5 +1,5 @@ --- ./core/Controller/LostController.php 2022-05-25 15:07:44.582984541 +0530 -+++ .//core/Controller/LostController-new.php 2022-05-28 15:29:43.418394746 +0530 ++++ ./core/Controller/LostController-new.php 2022-05-28 15:29:43.418394746 +0530 @@ -174,8 +174,23 @@ */ protected function checkPasswordResetToken(string $token, string $userId): void { -- GitLab