test/dummy/app/controllers/application_controller.rb in optimacms-0.1.15 vs test/dummy/app/controllers/application_controller.rb in optimacms-0.1.17
- old
+ new
@@ -1,5 +1,18 @@
class ApplicationController < ActionController::Base
# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
protect_from_forgery with: :exception
+
+
+ #before_filter :authenticate_beta if Rails.env.development? && Rails.application.config.TEST_ADMIN_PWD!=''
+ before_filter :authenticate_beta if Rails.env.development?
+
+ def authenticate_beta
+ authenticate_or_request_with_http_basic('Administration') do |username, password|
+ #username == 'admin' && password == Rails.application.config.TEST_ADMIN_PWD
+ username == 'admin' && password == 'admin'
+ end
+ end
+
+
end