auth by ip

This commit is contained in:
Timothy N. Tsvetkov 2011-04-11 16:56:22 +04:00
parent e3b12e4a1a
commit 4da241672b
2 changed files with 8 additions and 1 deletions

View File

@ -10,4 +10,10 @@ class ApplicationController < ActionController::Base
"application" "application"
end end
end end
def authenticate_by_ip!
if request.remote_ip != APP_CONFIG['auth_by_ip']
render :nothing => true, :status => 403
end
end
end end

View File

@ -1,5 +1,6 @@
class BuildListsController < ApplicationController class BuildListsController < ApplicationController
before_filter :authenticate_user! before_filter :authenticate_user!, :except => [:status_build, :pre_build, :post_build, :circle_build, :new_bbdt]
before_filter :authenticate_by_ip!, :only => [:status_build, :pre_build, :post_build, :circle_build, :new_bbdt]
before_filter :find_platform, :only => [:index, :filter, :show] before_filter :find_platform, :only => [:index, :filter, :show]
before_filter :find_repository, :only => [:index, :filter, :show] before_filter :find_repository, :only => [:index, :filter, :show]
before_filter :find_project, :only => [:index, :filter, :show] before_filter :find_project, :only => [:index, :filter, :show]