Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 75430bff authored by Akhil's avatar Akhil 🙂
Browse files

Added patches for recovery email field

parent e5c55cb1
Loading
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -54,6 +54,8 @@ RUN patch -u ${BASE_DIR}/core/Controller/ContactsMenuController.php -i ${TMP_PAT
RUN cd ${BASE_DIR} && patch -p0 < ${TMP_PATCH_DIR}/005-autocomplete-user-leak-core.patch
RUN cd ${BASE_DIR}/custom_apps && patch -p0 < ${TMP_PATCH_DIR}/005-autocomplete-user-leak-custom-app.patch
RUN patch -u ${BASE_DIR}/custom_apps/notes/lib/Service/NoteUtil.php -i ${TMP_PATCH_DIR}/006-notes-url-fix.patch
RUN patch -u ${BASE_DIR}/core/Controller/LostController.php -i ${TMP_PATCH_DIR}/007-recovery-email-field.patch
RUN patch -u ${BASE_DIR}/apps/settings/templates/settings/personal/personal.info.php -i {TMP_PATCH_DIR}/008-readonly-email-input.patch
RUN rm -rf ${TMP_PATCH_DIR}

# autocomplete leak tweak apps frontend with sed, disable group suggestion
+21 −0
Original line number Diff line number Diff line
--- LostControllerOriginal.php	2021-03-19 13:10:46.342012019 +0530
+++ LostController.php	2021-03-19 15:51:12.563247349 +0530
@@ -205,7 +205,8 @@
                 }
 
                 try {
-                        $mailAddress = !is_null($user->getEMailAddress()) ? $user->getEMailAddress() : '';
+                        $recoveryEmail = $this->config->getUserValue($userId, 'email-recovery', 'recovery-email');
+                        $mailAddress = !is_null($recoveryEmail) ? $recoveryEmail : '';
                         $decryptedToken = $this->crypto->decrypt($encryptedToken, $mailAddress.$this->config->getSystemValue('secret'));
                 } catch (\Exception $e) {
                         throw new \Exception($this->l10n->t('Couldn\'t reset password because the token is invalid'));
@@ -334,7 +335,7 @@
          */
         protected function sendEmail($input) {
                 $user = $this->findUserByIdOrMail($input);
-                $email = $user->getEMailAddress();
+                $email = $this->config->getUserValue($user->getUID(), 'email-recovery', 'recovery-email');
 
                 if (empty($email)) {
                         throw new ResetPasswordException('Could not send reset e-mail since there is no email for username ' . $input);
+11 −0
Original line number Diff line number Diff line
--- personal.info.original.php	2021-03-19 16:10:31.527079347 +0530
+++ personal.info.php	2021-03-19 16:12:12.689345081 +0530
@@ -150,7 +150,7 @@
                                 <input type="email" name="email" id="email" value="<?php p($_['email']); ?>"
                                         <?php if(!$_['displayNameChangeSupported']) { print_unescaped('class="hidden"'); } ?>
                                            placeholder="<?php p($l->t('Your email address')); ?>"
-                                           autocomplete="on" autocapitalize="none" autocorrect="off" />
+                                           autocomplete="on" autocapitalize="none" autocorrect="off" readonly />
                                 <span class="icon-checkmark hidden"></span>
                                 <span class="icon-error hidden" ></span>
                                 <?php if(!$_['displayNameChangeSupported']) { ?>