+ end
+
+ def edit
+ if params[:user] and params[:user][:display_name] and params[:user][:description]
+ @user.display_name = params[:user][:display_name]
+ @user.description = params[:user][:description]
+ if @user.save
+ flash[:notice] = "User edited OK."
+ redirect_to :controller => 'user', :action => 'account'
+ end
+ end
+ end
+
+ def go_public
+ @user.data_public = true
+ @user.save
+ flash[:notice] = 'All your edits are now public'
+ redirect_to :controller => 'user', :action => 'account'
+ end
+
+ def lost_password
+ if params['user']['email']
+ user = User.find_by_email(params['user']['email'])
+ if user
+ user.token = User.make_token
+ user.save
+ Notifier::deliver_lost_password(user)
+ flash[:notice] = "Sorry you lost it :-( but an email is on it's way so you can reset it soon."
+ else
+ flash[:notice] = "Couldn't find that email address, sorry."
+ end
+ end
+ end