Sha256: 9d66a371299de25948460258db3fb8e325dfd6b39a30a0b386181439bdd64128
Contents?: true
Size: 823 Bytes
Versions: 10
Compression:
Stored size: 823 Bytes
Contents
module ComfortableMexicanSofa::AccessControl module AdminAuthentication # Set username and password in config/initializers/comfortable_mexican_sofa.rb # Like this: # ComfortableMexicanSofa::AccessControl::AdminAuthentication.username = 'myname' # ComfortableMexicanSofa::AccessControl::AdminAuthentication.password = 'mypassword' mattr_accessor :username, :password # Simple http_auth. When implementing some other form of authentication # this method should return +true+ if everything is great, or redirect user # to some other page, thus denying access to cms admin section. def authenticate authenticate_or_request_with_http_basic do |username, password| self.username == username && self.password == password end end end end
Version data entries
10 entries across 10 versions & 1 rubygems