Completed
Pull Request — master (#7007)
by Simon
08:19
created

LostPasswordForm::getFormFields()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 0
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
4
namespace SilverStripe\Security\MemberAuthenticator;
5
6
use SilverStripe\Forms\EmailField;
7
use SilverStripe\Forms\FieldList;
8
use SilverStripe\Forms\FormAction;
9
10
/**
11
 * Class LostPasswordForm handles the requests for lost password form generation
12
 *
13
 * We need the MemberLoginForm for the getFormFields logic.
14
 */
15
class LostPasswordForm extends MemberLoginForm
16
{
17
18
    /**
19
     * Create a single EmailField form that has the capability
20
     * of using the MemberLoginForm Authenticator
21
     *
22
     * @return FieldList
23
     */
24
    public function getFormFields()
25
    {
26
        return FieldList::create(
27
            EmailField::create('Email', _t('SilverStripe\\Security\\Member.EMAIL', 'Email'))
28
        );
29
    }
30
31
    /**
32
     * Give the member a friendly button to push
33
     *
34
     * @return FieldList
35
     */
36
    public function getFormActions()
37
    {
38
        return FieldList::create(
39
            FormAction::create(
40
                'forgotPassword',
41
                _t('SilverStripe\\Security\\Security.BUTTONSEND', 'Send me the password reset link')
42
            )
43
        );
44
    }
45
}
46