X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/2c666b42d7bbe20f95272a7ebecd7d9167762c44..85d17f257c338f668a1d17d9fc62a2f48ec84230:/app/controllers/user_controller.rb diff --git a/app/controllers/user_controller.rb b/app/controllers/user_controller.rb index 8c63f8b75..a59190697 100644 --- a/app/controllers/user_controller.rb +++ b/app/controllers/user_controller.rb @@ -38,6 +38,8 @@ class UserController < ApplicationController else render :action => 'terms' end + elsif params[:user] and Acl.no_account_creation(request.remote_ip, params[:user][:email].split("@").last) + render :action => 'blocked' else session[:referer] = params[:referer] @@ -79,9 +81,7 @@ class UserController < ApplicationController def save @title = t 'user.new.title' - if Acl.address(request.remote_ip).where(:k => "no_account_creation").exists? - render :action => 'new' - elsif params[:decline] + if params[:decline] if @user @user.terms_seen = true @@ -112,6 +112,8 @@ class UserController < ApplicationController else redirect_to :action => :account, :display_name => @user.display_name end + elsif Acl.no_account_creation(request.remote_ip, params[:user][:email].split("@").last) + render :action => 'blocked' else @user = User.new(params[:user]) @@ -269,6 +271,8 @@ class UserController < ApplicationController :openid_url => params[:openid]) flash.now[:notice] = t 'user.new.openid association' + elsif Acl.no_account_creation(request.remote_ip) + render :action => 'blocked' end end @@ -620,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) @@ -659,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