#1705 - OpenID login details appearing in wrong place

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@44621 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Andrew O'Neil 2007-11-12 02:58:27 +00:00
parent 5165e64e9d
commit b636bf165a
3 changed files with 23 additions and 7 deletions

View File

@ -202,4 +202,21 @@ JS;
}
return true;
}
}
function saveInto(DataObject $record) {
if(!($this->canBeEmpty && !$this->value)) {
parent::saveInto($record);
}
}
/**
* Makes a pretty readonly field with some stars in it
*/
function performReadonlyTransformation() {
$stars = '*****';
$field = new ReadonlyField($this->name, $this->title ? $this->title : _t('Member.PASSWORD'), $stars);
$field->setForm($this->form);
return $field;
}
}

View File

@ -47,4 +47,4 @@ class PasswordField extends FormField {
}
}
?>
?>

View File

@ -706,6 +706,9 @@ class Member extends DataObject {
public function getCMSFields() {
$locale = ($this->Locale) ? $this->Locale : i18n::get_locale();
$password = new ConfirmedPasswordField('Password', 'Password');
$password->setCanBeEmpty(true);
$fields = new FieldSet(
//new TextField("Salutation", "Title"),
new HeaderField(_t('Member.PERSONALDETAILS', "Personal Details", PR_MEDIUM, 'Headline for formfields')),
@ -719,11 +722,7 @@ class Member extends DataObject {
i18n::get_existing_translations(),
$locale
),
new PasswordField("Password", _t('Member.PASSWORD'))
//new TextareaField("Address","Address"),
//new TextField("JobTitle", "Job Title"),
//new TextField( "Organisation", "Organisation" ),
//new OptionsetField("HTMLEmail","Mail Format", array( 1 => 'HTML', 0 => 'Text only' ) )
$password
);
$this->extend('updateCMSFields', $fields);