if Digest::SHA1.hexdigest(params[:oldpassword] =current_user.crypted_password
On Feb 10, 2008 8:31 PM, Stanley W.
<rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>
wrote:
>
> Hello,
> I''ve installed acts as authenticated plugin and I''m
trying to change it
> a little bit. I''ve created form where I can change my password.
There
> are 3 inputs: old pass, new and confirm new pass. In user model there
> is:
>
> (..)
> attr_accessor :password
> (..)
> validates_presence_of :password, :if =>
> :password_required?
> validates_presence_of :password_confirmation, :if =>
> :password_required?
> validates_length_of :password, :within => 4..40, :if =>
> :password_required?
> validates_confirmation_of :password, :if =>
> :password_required?
> (..)
>
> What should I do to check if old password is correct? Is it possible to
> use validates_ do do it?
>
> Cheers,
> Stan
> --
> Posted via http://www.ruby-forum.com/.
>
> >
>
--
Ryan Bigg
http://www.frozenplague.net
Feel free to add me to MSN and/or GTalk as this email.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---