Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Forum Module /

Discuss the Forum Module.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

ConfirmedPasswordField content length on edit


Go to End


2 Posts   1524 Views

Avatar
midoriberlin

Community Member, 5 Posts

15 October 2011 at 3:31am

Hello,

I'm setting up a basic login/register/edit profile sequence and am having a minor problem with it I'm hoping someone can help me with.

I have a ConfirmedPasswordField in my edit profile page that loads details from the $Member. I can save and edit here just fine but the minor problem is that I think it's showing the sha1 characters in the circled out characters for existing passwords.

e.g. I create a user with a password of 'elf' and then go to the edit profile screen. The change password and confirm password fields have content in them that is, I'm guessing, the sha1 code i.e. instead of seeing *** in the fields, I see ********************************************************

Is there a way I can get the hidden characters to reflect the actual length of the password? I'm not sure if this is possible...

The other potential solution was mentioned here ( http://api.silverstripe.org/2.4/forms/fields-formattedinput/ConfirmedPasswordField.html#methodperformReadonlyTransformation ) where the poster suggested making the password fields empty and then not saving them. I can do this but that then triggers validation. If I turn off the validation then they can potentially set their passwords to an empty string.

So...not the biggest problem in the world but wondering if i'm the only one who has experienced it?

Any help appreciated.

Regards,

Andrew

Avatar
Willr

Forum Moderator, 5523 Posts

15 October 2011 at 8:35pm

Is there a way I can get the hidden characters to reflect the actual length of the password? I'm not sure if this is possible...

No there is no way to get the information about the original password (thats the goal of hashing and salting the string in the first place!).