Class: Hector::ExpressionEngineIdentityAdapter
- Inherits:
-
Object
- Object
- Hector::ExpressionEngineIdentityAdapter
- Defined in:
- lib/hector/ee_identity_adapter.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#database ⇒ Object
readonly
Returns the value of attribute database.
-
#filename ⇒ Object
readonly
Returns the value of attribute filename.
Instance Method Summary collapse
- #authenticate(username, password) {|normalize(identity(normalize(username))) == normalize(password)| ... } ⇒ Object
- #forget(username) ⇒ Object
-
#initialize(filename = nil) ⇒ ExpressionEngineIdentityAdapter
constructor
A new instance of ExpressionEngineIdentityAdapter.
- #remember(username, password) ⇒ Object
Constructor Details
#initialize(filename = nil) ⇒ ExpressionEngineIdentityAdapter
Returns a new instance of ExpressionEngineIdentityAdapter.
17 18 19 20 21 |
# File 'lib/hector/ee_identity_adapter.rb', line 17 def initialize(filename = nil) @filename = filename || Hector.root.join("config/expression_engine.yml") load_config load_database end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
15 16 17 |
# File 'lib/hector/ee_identity_adapter.rb', line 15 def config @config end |
#database ⇒ Object (readonly)
Returns the value of attribute database.
15 16 17 |
# File 'lib/hector/ee_identity_adapter.rb', line 15 def database @database end |
#filename ⇒ Object (readonly)
Returns the value of attribute filename.
15 16 17 |
# File 'lib/hector/ee_identity_adapter.rb', line 15 def filename @filename end |
Instance Method Details
#authenticate(username, password) {|normalize(identity(normalize(username))) == normalize(password)| ... } ⇒ Object
23 24 25 26 |
# File 'lib/hector/ee_identity_adapter.rb', line 23 def authenticate(username, password) load_config yield normalize(identity(normalize(username))) == normalize(password) end |
#forget(username) ⇒ Object
33 34 35 36 |
# File 'lib/hector/ee_identity_adapter.rb', line 33 def forget(username) Hector.logger.warn "Hector cannot manage ExpressionEngine members" false end |
#remember(username, password) ⇒ Object
28 29 30 31 |
# File 'lib/hector/ee_identity_adapter.rb', line 28 def remember(username, password) Hector.logger.warn "Hector cannot manage ExpressionEngine members" false end |