Code Duplication    Length = 4-5 lines in 4 locations

app/lib/FFCMS/Controllers/User/ForgotPassword.php 2 locations

@@ 210-213 (lines=4) @@
207
208
        // load in the forgot password reset code row
209
        $usersDataMapper->load([$usersDataMapper->quotekey('value')." = ? AND ".$usersDataMapper->quotekey('key')." = 'forgot-password-code'", $f3->get('REQUEST.code')]);
210
        if (null == $usersDataMapper->uuid) {
211
            $this->notify(_('Unknown password reset code!'), 'error');
212
            return $f3->reroute($redirectUrlStep2);
213
        }
214
215
        // check that the user exists for the reset code
216
        $uuid = $f3->get('REQUEST.uuid');
@@ 218-221 (lines=4) @@
215
        // check that the user exists for the reset code
216
        $uuid = $f3->get('REQUEST.uuid');
217
        $usersMapper->load(['uuid = ?', $uuid]);
218
        if (null == $usersMapper->uuid) {
219
            $this->notify(_('Unknown user for reset code!'), 'error');
220
            return $f3->reroute($redirectUrlStep2);
221
        }
222
223
        // check that the password hint answer is correct
224
        $password_answer = $f3->get('REQUEST.password_answer');

app/lib/FFCMS/Controllers/User/User.php 2 locations

@@ 410-414 (lines=5) @@
407
408
        // load in the forgot password reset code row
409
        $usersDataMapper->load([$usersDataMapper->quotekey('value')." = ? AND ".$usersDataMapper->quotekey('key')." = 'confirm_email_code'", $f3->get('REQUEST.code')]);
410
        if (null == $usersDataMapper->uuid) {
411
            $this->notify(_('Unknown password reset code!'), 'error');
412
            $f3->reroute('@index');
413
            return;
414
        }
415
416
        // check that the user exists for the reset code
417
        $usersMapper->load(['uuid = ?', $usersDataMapper->users_uuid]);
@@ 418-422 (lines=5) @@
415
416
        // check that the user exists for the reset code
417
        $usersMapper->load(['uuid = ?', $usersDataMapper->users_uuid]);
418
        if (null == $usersDataMapper->uuid) {
419
            $this->notify(_('Unknown user for confirmation code!'), 'error');
420
            $f3->reroute('@index');
421
            return;
422
        }
423
424
        // update account status to 'confirmed'
425
        $usersMapper->status = 'confirmed';