On Nov 7, 2010, at 10:19 AM, Scorpio wrote:

> Hi, I've got a site in the works and I managed to figure out most
> stuff I need by now but there is one thing I dunno how to fix. As an
> admin I'd like to have the ability to reset user passwords and emails
> (if say some sort of error occurs) no questions asked. I'd like to
> have a form in the admin/users/Y-XXX that shows me the unencrypted
> password of a user and his email with the ability to change them at
> will.
> 
> I've tried getting the password in front but when I want to reset it
> I'm always aked for the current pass and being admin I find it kinda
> ridiculous tbh. Any help?

+1 on Bryan's point about not storing cleartext passwords.

On the other issue, the problem is the validation that runs when you're saving 
the record:

    def validate_current_password_when_changing_password
      changing_password? && !authenticated?(current_password) and errors.add 
:current_password, 
Hobo::Translations.ht("hobo.messages.current_password_is_not_correct", :default 
=> "is not correct")
    end

You could try just alias_method_chaining it in your user model; acting_user 
*should* be set when it runs.

Alternatively, you could add a reset_password lifecycle step that's always 
available to admins. This would autogenerate a snazzy little page and provide a 
good place to email the user the new password.

--Matt Jones

-- 
You received this message because you are subscribed to the Google Groups "Hobo 
Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/hobousers?hl=en.

Reply via email to