]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/user_controller.rb
Include the event type in the JSON output of a note
[rails.git] / app / controllers / user_controller.rb
index 77370c311317b03e73e96c5e6c1f8f6bbbd7203f..a591906976b93863760e8d80070a7fab79c9817c 100644 (file)
@@ -38,7 +38,7 @@ class UserController < ApplicationController
       else
         render :action => 'terms'
       end
-    elsif Acl.match(request.remote_ip, params[:user][:email].split("@").last).where(:k => "no_account_creation").exists?
+    elsif params[:user] and Acl.no_account_creation(request.remote_ip, params[:user][:email].split("@").last)
       render :action => 'blocked'
     else
       session[:referer] = params[:referer]
@@ -112,7 +112,7 @@ class UserController < ApplicationController
       else
         redirect_to :action => :account, :display_name => @user.display_name
       end
-    elsif Acl.match(request.remote_ip, params[:user][:email].split("@").last).where(:k => "no_account_creation").exists?
+    elsif Acl.no_account_creation(request.remote_ip, params[:user][:email].split("@").last)
       render :action => 'blocked'
     else
       @user = User.new(params[:user])
@@ -271,7 +271,7 @@ class UserController < ApplicationController
                        :openid_url => params[:openid])
 
       flash.now[:notice] = t 'user.new.openid association'
-    elsif Acl.match(request.remote_ip).where(:k => "no_account_creation").exists?
+    elsif Acl.no_account_creation(request.remote_ip)
       render :action => 'blocked'
     end
   end
@@ -624,7 +624,7 @@ private
     cookies.permanent["_osm_username"] = user.display_name
 
     session[:user] = user.id
-    session_expires_after 1.month if session[:remember_me]
+    session_expires_after 28.days if session[:remember_me]
 
     target = session[:referer] || url_for(:controller => :site, :action => :index)
 
@@ -663,6 +663,8 @@ private
     if user.save
       set_locale
 
+      cookies.permanent["_osm_username"] = user.display_name
+
       if user.new_email.blank?
         flash.now[:notice] = t 'user.account.flash update success'
       else