]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/user_controller.rb
Merge branch 'master' into terms
[rails.git] / app / controllers / user_controller.rb
index 603fb2a49aef8a61b0054b907e3bb4f3cd1d1ca5..43a6db790bc8e25375f15bf0ef57778b31d9dc0f 100644 (file)
@@ -25,7 +25,11 @@ class UserController < ApplicationController
     @legale = params[:legale] || OSM.IPToCountry(request.remote_ip) || APP_CONFIG['default_legale']
     @text = OSM.legal_text_for_country(@legale)
 
-    if @user.invalid?
+    if request.xhr?
+      render :update do |page|
+        page.replace_html "contributorTerms", :partial => "terms"
+      end
+    elsif @user.invalid?
       render :action => 'new'
     end
   end
@@ -35,6 +39,8 @@ class UserController < ApplicationController
 
     if Acl.find_by_address(request.remote_ip, :conditions => {:k => "no_account_creation"})
       render :action => 'new'
+    elsif params[:decline]
+      redirect_to t 'user.terms.declined'
     else
       @user = User.new(params[:user])