mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
ENHANCEMENT: Updated Member->getMemberFormFields() to use scaffolding and to be in line with Member->getCMSFields().
From: Andrew Short <andrewjshort@gmail.com> (from r97401) git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@97436 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
8361a41c16
commit
168114d4e2
41
security/Member.php
Normal file → Executable file
41
security/Member.php
Normal file → Executable file
@ -416,7 +416,6 @@ class Member extends DataObject {
|
||||
$e->send();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns the fields for the member form - used in the registration/profile module.
|
||||
* It should return fields that are editable by the admin and the logged-in user.
|
||||
@ -424,15 +423,39 @@ class Member extends DataObject {
|
||||
* @return FieldSet Returns a {@link FieldSet} containing the fields for
|
||||
* the member form.
|
||||
*/
|
||||
function getMemberFormFields() {
|
||||
$fields = new FieldSet(
|
||||
new TextField("FirstName", _t('Member.FIRSTNAME', 'First Name')),
|
||||
new TextField("Surname", _t('Member.SURNAME', "Surname")),
|
||||
new TextField("Email", _t('Member.EMAIL', "Email", PR_MEDIUM, 'Noun')),
|
||||
new TextField("Password", _t('Member.PASSWORD', 'Password'))
|
||||
);
|
||||
public function getMemberFormFields() {
|
||||
$fields = parent::getFrontendFields();
|
||||
|
||||
$this->extend('augmentMemberFormFields', $fields);
|
||||
$fields->replaceField('Password', $password = new ConfirmedPasswordField (
|
||||
'Password',
|
||||
$this->fieldLabel('Password'),
|
||||
null,
|
||||
null,
|
||||
(bool) $this->ID
|
||||
));
|
||||
$password->setCanBeEmpty(true);
|
||||
|
||||
$fields->replaceField('Locale', new DropdownField (
|
||||
'Locale',
|
||||
$this->fieldLabel('Locale'),
|
||||
i18n::get_existing_translations(),
|
||||
(($this->Locale) ? $this->Locale : i18n::get_locale())
|
||||
));
|
||||
|
||||
$fields->removeByName('RememberLoginToken');
|
||||
$fields->removeByName('NumVisit');
|
||||
$fields->removeByName('LastVisited');
|
||||
$fields->removeByName('Bounced');
|
||||
$fields->removeByName('AutoLoginHash');
|
||||
$fields->removeByName('AutoLoginExpired');
|
||||
$fields->removeByName('PasswordEncryption');
|
||||
$fields->removeByName('Salt');
|
||||
$fields->removeByName('PasswordExpiry');
|
||||
$fields->removeByName('FailedLoginCount');
|
||||
$fields->removeByName('LastViewed');
|
||||
$fields->removeByName('LockedOutUntil');
|
||||
|
||||
$this->extend('updateMemberFormFields', $fields);
|
||||
return $fields;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user