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 (C) 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)
-
+ (Boolean) allow_password_changes?
Does this auth source backend allow password changes?.
-
+ (Object) authenticate(login, password)
Try to authenticate a user not yet registered against available sources.
Instance Method Summary (collapse)
- - (Object) account_password
- - (Object) account_password=(arg)
- - (Boolean) allow_password_changes?
- - (Object) auth_method_name
- - (Object) authenticate(login, password)
- - (Object) test_connection
Methods included from Redmine::Ciphering
cipher_key, decrypt_text, encrypt_text, included
Class Method Details
+ (Boolean) allow_password_changes?
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 |
+ (Object) authenticate(login, password)
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
- (Object) account_password
37 38 39 |
# File 'app/models/auth_source.rb', line 37 def account_password read_ciphered_attribute(:account_password) end |
- (Object) account_password=(arg)
41 42 43 |
# File 'app/models/auth_source.rb', line 41 def account_password=(arg) write_ciphered_attribute(:account_password, arg) end |
- (Boolean) allow_password_changes?
45 46 47 |
# File 'app/models/auth_source.rb', line 45 def allow_password_changes? self.class.allow_password_changes? end |
- (Object) auth_method_name
33 34 35 |
# File 'app/models/auth_source.rb', line 33 def auth_method_name "Abstract" end |
- (Object) authenticate(login, password)
27 28 |
# File 'app/models/auth_source.rb', line 27 def authenticate(login, password) end |
- (Object) test_connection
30 31 |
# File 'app/models/auth_source.rb', line 30 def test_connection end |