Class: AuthSource
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- AuthSource
- Includes:
- Redmine::Ciphering
- Defined in:
- app/models/auth_source.rb
Overview
redMine - project management software Copyright © 2006 Jean-Philippe Lang
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
Direct Known Subclasses
Class Method Summary collapse
-
.allow_password_changes? ⇒ Boolean
Does this auth source backend allow password changes?.
-
.authenticate(login, password) ⇒ Object
Try to authenticate a user not yet registered against available sources.
Instance Method Summary collapse
- #account_password ⇒ Object
- #account_password=(arg) ⇒ Object
- #allow_password_changes? ⇒ Boolean
- #auth_method_name ⇒ Object
- #authenticate(login, password) ⇒ Object
- #test_connection ⇒ Object
Methods included from Redmine::Ciphering
cipher_key, decrypt_text, encrypt_text, included
Class Method Details
.allow_password_changes? ⇒ Boolean
Does this auth source backend allow password changes?
50 51 52 |
# File 'app/models/auth_source.rb', line 50 def self.allow_password_changes? false end |
.authenticate(login, password) ⇒ Object
Try to authenticate a user not yet registered against available sources
55 56 57 58 59 60 61 62 63 64 65 66 67 |
# File 'app/models/auth_source.rb', line 55 def self.authenticate(login, password) AuthSource.find(:all, :conditions => ["onthefly_register=?", true]).each do |source| begin logger.debug "Authenticating '#{login}' against '#{source.name}'" if logger && logger.debug? attrs = source.authenticate(login, password) rescue => e logger.error "Error during authentication: #{e.}" attrs = nil end return attrs if attrs end return nil end |
Instance Method Details
#account_password ⇒ Object
37 38 39 |
# File 'app/models/auth_source.rb', line 37 def account_password read_ciphered_attribute(:account_password) end |
#account_password=(arg) ⇒ Object
41 42 43 |
# File 'app/models/auth_source.rb', line 41 def account_password=(arg) write_ciphered_attribute(:account_password, arg) end |
#allow_password_changes? ⇒ Boolean
45 46 47 |
# File 'app/models/auth_source.rb', line 45 def allow_password_changes? self.class.allow_password_changes? end |
#auth_method_name ⇒ Object
33 34 35 |
# File 'app/models/auth_source.rb', line 33 def auth_method_name "Abstract" end |
#authenticate(login, password) ⇒ Object
27 28 |
# File 'app/models/auth_source.rb', line 27 def authenticate(login, password) end |
#test_connection ⇒ Object
30 31 |
# File 'app/models/auth_source.rb', line 30 def test_connection end |