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

LostPasswordForm   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Importance

Changes 0
Metric Value
dl 0
loc 31
rs 10
c 0
b 0
f 0
wmc 2
lcom 0
cbo 4

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getFormFields() 0 6 1
A getFormActions() 0 9 1
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