Skip to content
This repository has been archived by the owner on Sep 6, 2018. It is now read-only.

Commit

Permalink
admin_ -> copy_
Browse files Browse the repository at this point in the history
  • Loading branch information
javan committed May 16, 2011
1 parent 7d57637 commit 94e18c2
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions lib/copy/generators/site/config.ru
Expand Up @@ -16,8 +16,8 @@ Copy::Server.config do
# to use or set them as environment variables.
# Heroku friendly: http://devcenter.heroku.com/articles/config-vars
#
# set :admin_username, ENV['COPY_USERNAME']
# set :admin_password, ENV['COPY_PASSWORD']
# set :copy_username, ENV['COPY_USERNAME']
# set :copy_password, ENV['COPY_PASSWORD']

# Enter the URL to your data store.
# "redis://", "mongodb://", "mysql://", "postgres://", and "sqlite://" are supported.
Expand Down
4 changes: 2 additions & 2 deletions lib/copy/server.rb
Expand Up @@ -17,9 +17,9 @@ def protected!
end

def authorized?
return false unless settings.respond_to?(:admin_username) && settings.respond_to?(:admin_password)
return false unless settings.respond_to?(:copy_username) && settings.respond_to?(:copy_password)
@auth ||= Rack::Auth::Basic::Request.new(request.env)
@auth.provided? && @auth.basic? && @auth.credentials && @auth.credentials == [settings.admin_username, settings.admin_password]
@auth.provided? && @auth.basic? && @auth.credentials && @auth.credentials == [settings.copy_username, settings.copy_password]
end

def set_cache_control_header
Expand Down
2 changes: 1 addition & 1 deletion lib/copy/version.rb
@@ -1,3 +1,3 @@
module Copy
VERSION = '0.0.4'
VERSION = '0.0.41'
end
4 changes: 2 additions & 2 deletions test/test_helper.rb
Expand Up @@ -37,8 +37,8 @@ def setup

def setup_auth(user, pass)
app.config do
set :admin_username, user
set :admin_password, pass
set :copy_username, user
set :copy_password, pass
end
end

Expand Down

0 comments on commit 94e18c2

Please sign in to comment.