Code Duplication    Length = 4-5 lines in 4 locations

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

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

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

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