@user.data_public = true
@user.save
flash[:notice] = 'All your edits are now public'
- redirect_to :controller => 'user', :action => 'account'
+ redirect_to :controller => 'user', :action => 'account', :display_name => @user.display_name
end
def lost_password
- if params[:user][:email]
+ if params[:user] and params[:user][:email]
user = User.find_by_email(params['user']['email'])
if user
user.token = User.make_token
else
flash[:notice] = "Couldn't find that email address, sorry."
end
+ else
+ render :action => 'lost_password'
end
end
u.timeout = 1.day.from_now
u.save
session[:token] = u.token
- redirect_to :controller => 'site', :action => 'index'
+ if params[:next_controller] and params[:next_action]
+ redirect_to :controller => params[:next_controller], :action => params[:next_action]
+ else
+ redirect_to :controller => 'site', :action => 'index'
+ end
return
else
flash[:notice] = "Couldn't log in with those details"
end
end
session[:token] = nil
- redirect_to :controller => 'site', :action => 'index'
+ if params[:next_controller] and params[:next_action]
+ redirect_to :controller => params[:next_controller], :action => params[:next_action]
+ else
+ redirect_to :controller => 'site', :action => 'index'
+ end
end
def confirm