Class: AuthSource

Inherits:
ActiveRecord::Base show all
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

AuthSourceLdap

Class Method Summary

Instance Method Summary

Methods inherited from ActiveRecord::Base

quoted_table_name

Class Method Details

+ (Object) authenticate(login, password)

Try to authenticate a user not yet registered against available sources



36
37
38
39
40
41
42
43
44
45
46
47
48
# File 'app/models/auth_source.rb', line 36

def self.authenticate(, 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(, password)
    rescue => e
      logger.error "Error during authentication: #{e.message}"
      attrs = nil
    end
    return attrs if attrs
  end
  return nil
end

Instance Method Details

- (Object) auth_method_name



31
32
33
# File 'app/models/auth_source.rb', line 31

def auth_method_name
  "Abstract"
end

- (Object) authenticate(login, password)



25
26
# File 'app/models/auth_source.rb', line 25

def authenticate(, password)
end

- (Object) test_connection



28
29
# File 'app/models/auth_source.rb', line 28

def test_connection
end