end
end
+ def reset_password
+ if params['token']
+ user = User.find_by_token(params['token'])
+ if user
+ pass = User.make_token(8)
+ user.pass_crypt = pass
+ user.save
+ Notifier::deliver_reset_password(user, pass)
+ flash[:notice] = "You're password has been changed and is on the way to your mailbox :-)"
+ else
+ flash[:notice] = "Didn't find that token, check the URL maybe?"
+ end
+ end
+ redirect_to :action => 'login'
+ end
+
def new
end
def lost_password( user )
@recipients = user.email
@from = 'abuse@openstreetmap.org'
- @subject = '[OpenStreetMap] Passwors reset request'
+ @subject = '[OpenStreetMap] Password reset request'
@body['url'] = "http://www.openstreetmap.org/user/reset_password?email=#{user.email}&token=#{user.token}"
end
+ def reset_password(user, pass)
+ @recipients = user.email
+ @from = 'abuse@openstreetmap.org'
+ @subject = '[OpenStreetMap] Password reset'
+ @body['pass'] = pass
+ end
+
end