From 07027df18175c67503b5f70a2ece311389025f60 Mon Sep 17 00:00:00 2001 From: alf Date: Sun, 9 Jan 2022 22:50:31 +0300 Subject: [PATCH] v1.1 --- config.inc.php.dist | 2 +- password_recovery.php | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/config.inc.php.dist b/config.inc.php.dist index dec8fe4..ccdb848 100644 --- a/config.inc.php.dist +++ b/config.inc.php.dist @@ -18,7 +18,7 @@ $config['pr_fields'] = [ $config['pr_admin_email'] = 'postmaster@your.domain.com'; // Use secret question/answer to confirmation password recovery -$config['pr_use_question'] = true; +$config['pr_use_question'] = false; // Use message with code to confirmation password recovery $config['pr_use_confirm_code'] = true; diff --git a/password_recovery.php b/password_recovery.php index 6227272..12b48ad 100644 --- a/password_recovery.php +++ b/password_recovery.php @@ -324,6 +324,12 @@ class password_recovery extends rcube_plugin { } } } + + if (!$this->rc->config->get('pr_use_question')) { + unset($new_fields['question']); + unset($new_fields['answer']); + } + $p['form']['addressing']['content'] = $new_fields; if($this->user['username']){