diff --git a/app/models/authentication_provider.rb b/app/models/authentication_provider.rb index 3607fa75aaa..10b293562ea 100644 --- a/app/models/authentication_provider.rb +++ b/app/models/authentication_provider.rb @@ -20,6 +20,7 @@ require 'net-ldap' require 'net_ldap_extensions' +NetLdapExtensions.apply class AuthenticationProvider < ActiveRecord::Base include Workflow diff --git a/lib/net_ldap_extensions.rb b/lib/net_ldap_extensions.rb index db577f07df6..72dcdd306d6 100644 --- a/lib/net_ldap_extensions.rb +++ b/lib/net_ldap_extensions.rb @@ -17,56 +17,60 @@ # You should have received a copy of the GNU Affero General Public License along # with this program. If not, see . -Net::LDAP::ResultStrings.merge!({ - 0 => "Success Hi", - 1 => "Operation Error", - 2 => "Protocol Error", - 3 => "Time Limit Exceeded", - 4 => "Size Limit Exceeded", - 5 => "Compare False", - 6 => "Compare True", - 7 => "Auth Method Not Supported", - 8 => "Strong Auth Required", - 9 => "Ldap Partial Results", - 10 => "Referral (ldap V3)", - 11 => "Admin Limit Exceeded (ldap V3)", - 12 => "Unavailable Critical Extension (ldap V3)", - 13 => "Confidentiality Required (ldap V3)", - 14 => "Sasl Bind In Progress", - 16 => "No Such Attribute", - 17 => "Undefined Attribute Type", - 18 => "Inappropriate Matching", - 19 => "Constraint Violation", - 20 => "Attribute Or Value Exists", - 21 => "Invalid Attribute Syntax", - 32 => "No Such Object", - 33 => "Alias Problem", - 34 => "Invalid Dn Syntax", - 35 => "Is Leaf", - 36 => "Alias Dereferencing Problem", - 48 => "Inappropriate Authentication", - 49 => "Invalid Credentials", - 50 => "Insufficient Access Rights", - 51 => "Busy", - 52 => "Unavailable", - 53 => "Unwilling To Perform", - 54 => "Loop Defect", - 64 => "Naming Violation", - 65 => "Object Class Violation", - 66 => "Not Allowed On Nonleaf", - 67 => "Not Allowed On Rdn", - 68 => "Entry Already Exists", - 69 => "Object Class Mods Prohibited", - 71 => "Affects Multiple Dsas (ldap V3)", - 80 => "Other", - 81 => "Server Down", - 85 => "Ldap Timeout", - 89 => "Param Error", - 91 => "Connect Error", - 92 => "Ldap Not Supported", - 93 => "Control Not Found", - 94 => "No Results Returned", - 95 => "More Results To Return", - 96 => "Client Loop", - 97 => "Referral Limit Exceeded", - }) +module NetLdapExtensions + def self.apply + Net::LDAP::ResultStrings.merge!({ + 0 => "Success Hi", + 1 => "Operation Error", + 2 => "Protocol Error", + 3 => "Time Limit Exceeded", + 4 => "Size Limit Exceeded", + 5 => "Compare False", + 6 => "Compare True", + 7 => "Auth Method Not Supported", + 8 => "Strong Auth Required", + 9 => "Ldap Partial Results", + 10 => "Referral (ldap V3)", + 11 => "Admin Limit Exceeded (ldap V3)", + 12 => "Unavailable Critical Extension (ldap V3)", + 13 => "Confidentiality Required (ldap V3)", + 14 => "Sasl Bind In Progress", + 16 => "No Such Attribute", + 17 => "Undefined Attribute Type", + 18 => "Inappropriate Matching", + 19 => "Constraint Violation", + 20 => "Attribute Or Value Exists", + 21 => "Invalid Attribute Syntax", + 32 => "No Such Object", + 33 => "Alias Problem", + 34 => "Invalid Dn Syntax", + 35 => "Is Leaf", + 36 => "Alias Dereferencing Problem", + 48 => "Inappropriate Authentication", + 49 => "Invalid Credentials", + 50 => "Insufficient Access Rights", + 51 => "Busy", + 52 => "Unavailable", + 53 => "Unwilling To Perform", + 54 => "Loop Defect", + 64 => "Naming Violation", + 65 => "Object Class Violation", + 66 => "Not Allowed On Nonleaf", + 67 => "Not Allowed On Rdn", + 68 => "Entry Already Exists", + 69 => "Object Class Mods Prohibited", + 71 => "Affects Multiple Dsas (ldap V3)", + 80 => "Other", + 81 => "Server Down", + 85 => "Ldap Timeout", + 89 => "Param Error", + 91 => "Connect Error", + 92 => "Ldap Not Supported", + 93 => "Control Not Found", + 94 => "No Results Returned", + 95 => "More Results To Return", + 96 => "Client Loop", + 97 => "Referral Limit Exceeded", + }) + end +end