mirror of
https://github.com/processwire/processwire.git
synced 2025-08-11 09:14:58 +02:00
Fix issue processwire/processwire-issues#1381
This commit is contained in:
@@ -556,6 +556,18 @@ class ProcessForgotPassword extends Process implements ConfigurableModule {
|
|||||||
*/
|
*/
|
||||||
protected function step4_completeReset($id, $form) {
|
protected function step4_completeReset($id, $form) {
|
||||||
|
|
||||||
|
$confirmInputfields = array();
|
||||||
|
foreach($this->confirmFields as $fieldName) {
|
||||||
|
$field = $this->wire()->fields->get($fieldName);
|
||||||
|
$inputfield = $form->getChildByName($fieldName);
|
||||||
|
if(!$inputfield) continue;
|
||||||
|
if($field && $field->hasFlag(Field::flagUnique)) {
|
||||||
|
// unique flag does not apply to this input scenario
|
||||||
|
$inputfield->hasField = null;
|
||||||
|
}
|
||||||
|
$confirmInputfields[$fieldName] = $inputfield;
|
||||||
|
}
|
||||||
|
|
||||||
/** @var WireInput $input */
|
/** @var WireInput $input */
|
||||||
$input = $this->wire('input');
|
$input = $this->wire('input');
|
||||||
$form->processInput($input->post);
|
$form->processInput($input->post);
|
||||||
@@ -578,9 +590,7 @@ class ProcessForgotPassword extends Process implements ConfigurableModule {
|
|||||||
/** @var User $user */
|
/** @var User $user */
|
||||||
$user = $this->wire('users')->get((int) $id);
|
$user = $this->wire('users')->get((int) $id);
|
||||||
|
|
||||||
foreach($this->confirmFields as $fieldName) {
|
foreach($confirmInputfields as $fieldName => $f) {
|
||||||
$f = $form->getChildByName($fieldName);
|
|
||||||
if(!$f) continue;
|
|
||||||
$fv = $f->attr('value');
|
$fv = $f->attr('value');
|
||||||
$uv = $user->get($fieldName);
|
$uv = $user->get($fieldName);
|
||||||
if(empty($fv) && empty($uv)) continue;
|
if(empty($fv) && empty($uv)) continue;
|
||||||
|
Reference in New Issue
Block a user