Code Duplication    Length = 5-5 lines in 2 locations

src/Controller/UsersController.php 2 locations

@@ 527-531 (lines=5) @@
524
                        return $this->Flash->error(__("Please, complete all fields !"));
525
                    }
526
527
                    if (!(new DefaultPasswordHasher)->check($data['old_password'], $user->password)) {
528
                        $this->set(compact('user', 'oldEmail'));
529
530
                        return $this->Flash->error(__("Your old password don't match !"));
531
                    }
532
533
                    $this->Users->patchEntity($user, $this->request->getParsedBody(), ['validate' => 'settings']);
534
                    if ($this->Users->save($user)) {
@@ 632-636 (lines=5) @@
629
630
        $user = $this->Users->get($this->Auth->user('id'));
631
632
        if (!(new DefaultPasswordHasher)->check($this->request->getData('password'), $user->password)) {
633
            $this->Flash->error(__("Your password doesn't match !"));
634
635
            return $this->redirect(['action' => 'settings']);
636
        }
637
638
        $user->is_deleted = true;
639