mirror of
https://github.com/processwire/processwire.git
synced 2025-08-09 16:26:59 +02:00
Fix issue processwire/processwire-issues#1381
This commit is contained in:
@@ -555,6 +555,18 @@ class ProcessForgotPassword extends Process implements ConfigurableModule {
|
||||
*
|
||||
*/
|
||||
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 */
|
||||
$input = $this->wire('input');
|
||||
@@ -578,9 +590,7 @@ class ProcessForgotPassword extends Process implements ConfigurableModule {
|
||||
/** @var User $user */
|
||||
$user = $this->wire('users')->get((int) $id);
|
||||
|
||||
foreach($this->confirmFields as $fieldName) {
|
||||
$f = $form->getChildByName($fieldName);
|
||||
if(!$f) continue;
|
||||
foreach($confirmInputfields as $fieldName => $f) {
|
||||
$fv = $f->attr('value');
|
||||
$uv = $user->get($fieldName);
|
||||
if(empty($fv) && empty($uv)) continue;
|
||||
|
Reference in New Issue
Block a user