Code Duplication    Length = 16-18 lines in 2 locations

AdminModule/presenters/LoginPresenter.php 1 location

@@ 49-64 (lines=16) @@
46
        $this->setLayout('login');
47
    }
48
49
    public function signInFormSubmitted($form)
50
    {
51
        try {
52
            $values = $form->getValues();
53
            if ($values->remember) {
54
                $this->getUser()->setExpiration('+ 14 days', false);
55
            } else {
56
                $this->getUser()->setExpiration('+ 20 minutes', true);
57
            }
58
            $this->getUser()->login($values->username, $values->password);
59
            $this->forward('Homepage:');
60
        } catch (NS\AuthenticationException $e) {
61
            $this->flashMessage($this->translation[$e->getMessage()], 'danger');
62
            $form->addError($e->getMessage());
63
        }
64
    }
65
66
    public function actionOut()
67
    {

FrontendModule/presenters/LoginPresenter.php 1 location

@@ 63-80 (lines=18) @@
60
        $this->setLayout('login');
61
    }
62
63
    public function signInFormSubmitted($form)
64
    {
65
66
        try {
67
            $values = $form->getValues();
68
            if ($values->remember) {
69
                $this->getUser()->setExpiration('+ 14 days', false);
70
            } else {
71
                $this->getUser()->setExpiration('+ 20 minutes', true);
72
            }
73
            $this->getUser()->login($values->username, $values->password);
74
            $this->flashMessage('Přihlášení bylo úspěšné', 'success');
75
            $this->forward('Homepage:');
76
        } catch (NS\AuthenticationException $e) {
77
            $this->flashMessage($this->translation[$e->getMessage()], 'danger');
78
            $form->addError($e->getMessage());
79
        }
80
    }
81
82
}
83