- if current_user&.terms_agreed?
- # Already agreed to terms, so just show settings
- redirect_to :action => :account, :display_name => current_user.display_name
- elsif current_user.nil? && session[:new_user].nil?
- redirect_to :action => :login, :referer => request.fullpath
- end
- end
- end
-
- def save
- @title = t "users.new.title"
-
- if params[:decline] || !(params[:read_tou] && params[:read_ct])
- if current_user
- current_user.terms_seen = true
-
- flash[:notice] = { :partial => "users/terms_declined_flash" } if current_user.save
-
- if params[:referer]
- redirect_to safe_referer(params[:referer])
- else
- redirect_to :action => :account, :display_name => current_user.display_name
- end
- elsif params[:decline]
- redirect_to t("users.terms.declined")
- else
- redirect_to :action => :terms
- end
- elsif current_user
- unless current_user.terms_agreed?
- current_user.consider_pd = params[:user][:consider_pd]
- current_user.tou_agreed = Time.now.getutc
- current_user.terms_agreed = Time.now.getutc
- current_user.terms_seen = true