]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/user_controller.rb
Merge branch 'master' into openID
[rails.git] / app / controllers / user_controller.rb
index 60e35016a45e37e6b55f5c41b208c34201230c42..cc12cc9e74ca2f3d69540cd39911b014cb3533ca 100644 (file)
@@ -36,13 +36,13 @@ class UserController < ApplicationController
           return 
         end   
       else
-      @user = User.new(params[:user])
+        @user = User.new(params[:user])
 
-      @user.visible = true
-      @user.data_public = true
-      @user.description = "" if @user.description.nil?
-      @user.creation_ip = request.remote_ip
-      @user.languages = request.user_preferred_languages
+        @user.visible = true
+        @user.data_public = true
+        @user.description = "" if @user.description.nil?
+        @user.creation_ip = request.remote_ip
+        @user.languages = request.user_preferred_languages
         #Set the openid_url to nil as for one it is used 
         #to check if the openid could be validated and secondly 
         #to not get dupplicate conflicts for an empty openid  
@@ -133,6 +133,8 @@ class UserController < ApplicationController
       @user.home_lat = params[:user][:home_lat]
       @user.home_lon = params[:user][:home_lon]
 
+      @user.openid_url = nil if (params[:user][:openid_url].length == 0)
+
       if @user.save
         set_locale
 
@@ -320,6 +322,10 @@ class UserController < ApplicationController
     @nickname = params['nickname']
     @email = params['email']
     @openID = params['openid']
+       
+    if !params['openid'].nil?
+         flash.now[:notice] = t 'user.new.openID association'
+       end
   end
 
   def login