Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

removing feeds feature

  • Loading branch information...
commit 737b4b8ebd994705ada3de05ddedb2c1b5008d5a 1 parent 2a78ba4
Subba Rao Pasupuleti subbarao authored
4 Gemfile.lock
View
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
- admin_data (0.0.1)
+ admin_data (1.3.0)
rails (~> 3.1)
will_paginate (>= 3.0.0)
@@ -108,7 +108,7 @@ GEM
treetop (1.4.12)
polyglot
polyglot (>= 0.3.1)
- tzinfo (0.3.36)
+ tzinfo (0.3.37)
will_paginate (3.0.4)
PLATFORMS
48 app/controllers/admin_data/feed_controller.rb
View
@@ -1,48 +0,0 @@
-module AdminData
-
- class FeedController < ApplicationController
-
- before_filter :ensure_is_allowed_to_view_feed
-
- def index
- if params[:klasss].blank?
- render :text => "Usage: http://localhost:3000/admin_data/feed/user replace user with your model name"
- return
- end
-
- begin
- @klass = Util.camelize_constantize(params[:klasss])
- @title = "Feeds from admin_data #{@klass.name}"
- @description = "feeds from AdminData #{@klass.name}"
- @records = @klass.find(:all, :order => "#{@klass.primary_key} desc", :limit => 100)
- rescue NameError
- render :text => "No constant was found with name #{params[:klasss]}"
- end
- end
-
- private
-
- def ensure_is_allowed_to_view_feed
- render :text => 'not authorized' unless is_allowed_to_view_feed?(self)
- end
-
- def is_allowed_to_view_feed?(controller)
- return true if Rails.env.development?
-
- if AdminData.config.feed_authentication_user_id.blank?
- Rails.logger.info 'No user id has been supplied for feed'
- return false
- elsif AdminData.config.feed_authentication_password.blank?
- Rails.logger.info 'No password has been supplied for feed'
- return false
- end
-
- userid = AdminData.config.feed_authentication_user_id
- password = AdminData.config.feed_authentication_password
- authenticator = AdminData::Authenticator.new(userid, password)
- authenticator.verify(controller)
- end
-
- end
-
-end
1  lib/admin_data.rb
View
@@ -17,7 +17,6 @@ class NoCreatedAtColumnException < Exception
autoload :ActiveRecordUtil
autoload :SetupConfig
autoload :DateUtil
- autoload :Authenticator
autoload :Search
autoload :Analytics
autoload :ModelFinder
15 lib/admin_data/authenticator.rb
View
@@ -1,15 +0,0 @@
-# HttpBasic authenticator for feed authentication
-module AdminData
- class Authenticator
-
- def initialize(userid, password)
- @userid = userid
- @password = password
- end
-
- def verify(controller)
- controller.authenticate_or_request_with_http_basic { |_u, _p| (_u == @userid) && (_p == @password) }
- end
-
- end
-end
Please sign in to comment.
Something went wrong with that request. Please try again.