before_filter :authorize_web, :except => [:api_read, :api_details, :api_gpx_files]
before_filter :set_locale, :except => [:api_read, :api_details, :api_gpx_files]
before_filter :require_user, :only => [:account, :go_public, :make_friend, :remove_friend]
before_filter :authorize_web, :except => [:api_read, :api_details, :api_gpx_files]
before_filter :set_locale, :except => [:api_read, :api_details, :api_gpx_files]
before_filter :require_user, :only => [:account, :go_public, :make_friend, :remove_friend]
before_filter :check_database_readable, :except => [:login, :api_read, :api_details, :api_gpx_files]
before_filter :check_database_writable, :only => [:new, :account, :confirm, :confirm_email, :lost_password, :reset_password, :go_public, :make_friend, :remove_friend]
before_filter :check_api_readable, :only => [:api_read, :api_details, :api_gpx_files]
before_filter :check_database_readable, :except => [:login, :api_read, :api_details, :api_gpx_files]
before_filter :check_database_writable, :only => [:new, :account, :confirm, :confirm_email, :lost_password, :reset_password, :go_public, :make_friend, :remove_friend]
before_filter :check_api_readable, :only => [:api_read, :api_details, :api_gpx_files]
# Already agreed to terms, so just show settings
redirect_to :action => :account, :display_name => @user.display_name
# Already agreed to terms, so just show settings
redirect_to :action => :account, :display_name => @user.display_name
@user.terms_agreed = Time.now.getutc
@user.terms_seen = true
@user.openid_url = nil if @user.openid_url and @user.openid_url.empty?
if @user.save
@user.terms_agreed = Time.now.getutc
@user.terms_seen = true
@user.openid_url = nil if @user.openid_url and @user.openid_url.empty?
if @user.save
- referer_params = Rack::Utils.parse_query(URI(session[:referer]).query)
- referer = welcome_path(referer_params.slice(:lat, :lon, :zoom, :editor))
+ uri = URI(session[:referer])
+ /map=(.*)\/(.*)\/(.*)/.match(uri.fragment) do |m|
+ editor = Rack::Utils.parse_query(uri.query).slice('editor')
+ referer = welcome_path({'zoom' => m[1],
+ 'lat' => m[2],
+ 'lon' => m[3]}.merge(editor))
+ end
redirect_to :action => 'account', :display_name => @user.display_name
else
flash[:error] = t 'user.confirm_email.failure'
redirect_to :action => 'account', :display_name => @user.display_name
else
flash[:error] = t 'user.confirm_email.failure'
+
+ ##
+ # return permitted user parameters
+ def user_params
+ params.require(:user).permit(:email, :email_confirmation, :display_name, :openid_url, :pass_crypt, :pass_crypt_confirmation)
+ end
+
+ ##
+ # check signup acls
+ def check_signup_allowed(email = nil)
+ if email.nil?
+ domain = nil
+ else
+ domain = email.split("@").last
+ end
+
+ if blocked = Acl.no_account_creation(request.remote_ip, domain)
+ logger.info "Blocked signup from #{request.remote_ip} for #{email}"
+
+ render :action => 'blocked'
+ end
+
+ not blocked
+ end