| @@ 48-58 (lines=11) @@ | ||
| 45 | ||
| 46 | parent::__construct($controller, 'LDAPAuthenticator', $name); |
|
| 47 | ||
| 48 | if (Config::inst()->get(LDAPAuthenticator::class, 'allow_email_login') === 'yes') { |
|
| 49 | $loginField = TextField::create( |
|
| 50 | 'Login', |
|
| 51 | _t('LDAPLoginForm.USERNAMEOREMAIL', 'Username or email'), |
|
| 52 | null, |
|
| 53 | null, |
|
| 54 | $this |
|
| 55 | ); |
|
| 56 | } else { |
|
| 57 | $loginField = TextField::create('Login', _t('LDAPLoginForm.USERNAME', 'Username'), null, null, $this); |
|
| 58 | } |
|
| 59 | ||
| 60 | $this->Fields()->replaceField('Email', $loginField); |
|
| 61 | $this->setValidator(new RequiredFields('Login', 'Password')); |
|
| @@ 157-167 (lines=11) @@ | ||
| 154 | */ |
|
| 155 | public function lostPasswordForm() |
|
| 156 | { |
|
| 157 | if (Config::inst()->get(LDAPAuthenticator::class, 'allow_email_login') === 'yes') { |
|
| 158 | $loginField = TextField::create( |
|
| 159 | 'Login', |
|
| 160 | _t('LDAPLoginForm.USERNAMEOREMAIL', 'Username or email'), |
|
| 161 | null, |
|
| 162 | null, |
|
| 163 | $this |
|
| 164 | ); |
|
| 165 | } else { |
|
| 166 | $loginField = TextField::create('Login', _t('LDAPLoginForm.USERNAME', 'Username'), null, null, $this); |
|
| 167 | } |
|
| 168 | ||
| 169 | $action = FormAction::create('forgotPassword', _t('Security.BUTTONSEND', 'Send me the password reset link')); |
|
| 170 | return LostPasswordForm::create( |
|