- cache_sweeper :user_sweeper, :only => [:account, :hide, :unhide, :delete]
+ cache_sweeper :user_sweeper, :only => [:account, :set_status, :delete], :unless => OSM_STATUS == :database_offline
+
+ def terms
+ @title = t 'user.new.title'
+ @user = User.new(params[:user])
+
+ @legale = params[:legale] || OSM.IPToCountry(request.remote_ip) || APP_CONFIG['default_legale']
+ @text = OSM.legal_text_for_country(@legale)
+
+ if request.xhr?
+ render :update do |page|
+ page.replace_html "contributorTerms", :partial => "terms"
+ end
+ elsif @user.invalid?
+ render :action => 'new'
+ end
+ end