Tuesday, August 31, 2010

Re: Password field in 'Edit User' when using Auth

Thank you! That's really helpful... seems to be working now.

On 24 Aug, 17:58, cricket <zijn.digi...@gmail.com> wrote:
> On Tue, Aug 24, 2010 at 12:18 PM, WhyNotSmile <sharongilmor...@gmail.com> wrote:
> > I'm using the Auth component for my site, but having problems when it
> > comes to editing a user.  I want it so that the user can go to the
> > page 'Edit My Account', and see their current information, change
> > whatever they want, and save it.
>
> > The problem is with the password field.  If it is shown (with *s),
> > it's the hashed version which is shown, so it's really long.  When the
> > user saves the password, it gets hashed again. The same happens if
> > it's a hidden field.
>
> Auth does all this automatically. Have a look at the source.
>
> > If it's not shown, and there's just a blank field, firstly the user
> > may wonder why the field is blank, and type something in there, but
> > more importantly, they will then save a blank password.
>
> I would just leave it out altogether. You don't need to submit a value
> for password when editing any other fields.
>
> > Is there any way around this, or do I just have to have 'Change
> > Password' on a different page, and on the Edit page use an update
> > instead of a save (so that the password field can be left out
> > altogether)?
>
> That's what I do. Name your form elements "password_1" and
> "password_2" so Auth will leave them alone. Check that they're
> identical upon submission, then use savefield() to edit just the
> password column (after hashing, of course).

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.

You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

No comments: