* VRFS-238 done

This commit is contained in:
Seth Call 2013-02-07 21:11:47 -06:00
parent c94434f43a
commit 4053f16a2a
3 changed files with 12 additions and 0 deletions

View File

@ -4,6 +4,10 @@ class UsersController < ApplicationController
before_filter :correct_user, only: [:edit, :update]
before_filter :admin_user, only: :destroy
rescue_from 'JamRuby::PermissionError' do |exception|
@exception = exception
render :file => 'public/403.html', :status => 403, :layout => false
end
def index
@users = User.paginate(page: params[:page])

View File

@ -91,5 +91,8 @@ module SampleApp
config.websocket_gateway_max_stale_connection_time = 1800
config.websocket_gateway_internal_debug = false
config.websocket_gateway_port = 6767
# set this to false if you want to disable signups (lock down public user creation)
config.signup_enabled = true
end
end

View File

@ -15,6 +15,11 @@ class UserManager < BaseManager
@user = User.new
# check if we have disabled signup for this site.
unless SampleApp::Application.config.signup_enabled
raise PermissionError, "Signups are currently disabled"
end
location_hash = MaxMindManager.lookup(remote_ip);
# TODO: figure out why can't user verify_recaptcha here