Merge pull request #39 from aspgems/master
Changed back return values in API methods to match what documentation says
This commit is contained in:
commit
8acd4acc5b
1 changed files with 14 additions and 12 deletions
|
@ -523,15 +523,17 @@ class Net::LDAP
|
||||||
# response codes instead of a simple numeric code.
|
# response codes instead of a simple numeric code.
|
||||||
#++
|
#++
|
||||||
def get_operation_result
|
def get_operation_result
|
||||||
|
result = @result
|
||||||
|
result = result.result if result.is_a?(Net::LDAP::PDU)
|
||||||
os = OpenStruct.new
|
os = OpenStruct.new
|
||||||
if @result.is_a?(Hash)
|
if result.is_a?(Hash)
|
||||||
# We might get a hash of LDAP response codes instead of a simple
|
# We might get a hash of LDAP response codes instead of a simple
|
||||||
# numeric code.
|
# numeric code.
|
||||||
os.code = (@result[:resultCode] || "").to_i
|
os.code = (result[:resultCode] || "").to_i
|
||||||
os.error_message = @result[:errorMessage]
|
os.error_message = result[:errorMessage]
|
||||||
os.matched_dn = @result[:matchedDN]
|
os.matched_dn = result[:matchedDN]
|
||||||
elsif @result
|
elsif result
|
||||||
os.code = @result
|
os.code = result
|
||||||
else
|
else
|
||||||
os.code = 0
|
os.code = 0
|
||||||
end
|
end
|
||||||
|
@ -653,7 +655,7 @@ class Net::LDAP
|
||||||
if return_result_set
|
if return_result_set
|
||||||
(!@result.nil? && @result.result_code == 0) ? result_set : nil
|
(!@result.nil? && @result.result_code == 0) ? result_set : nil
|
||||||
else
|
else
|
||||||
@result
|
@result.success?
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -727,7 +729,7 @@ class Net::LDAP
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@result
|
@result.success?
|
||||||
end
|
end
|
||||||
|
|
||||||
# #bind_as is for testing authentication credentials.
|
# #bind_as is for testing authentication credentials.
|
||||||
|
@ -829,7 +831,7 @@ class Net::LDAP
|
||||||
conn.close if conn
|
conn.close if conn
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@result
|
@result.success?
|
||||||
end
|
end
|
||||||
|
|
||||||
# Modifies the attribute values of a particular entry on the LDAP
|
# Modifies the attribute values of a particular entry on the LDAP
|
||||||
|
@ -928,7 +930,7 @@ class Net::LDAP
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@result
|
@result.success?
|
||||||
end
|
end
|
||||||
|
|
||||||
# Add a value to an attribute. Takes the full DN of the entry to modify,
|
# Add a value to an attribute. Takes the full DN of the entry to modify,
|
||||||
|
@ -999,7 +1001,7 @@ class Net::LDAP
|
||||||
conn.close if conn
|
conn.close if conn
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@result
|
@result.success?
|
||||||
end
|
end
|
||||||
alias_method :modify_rdn, :rename
|
alias_method :modify_rdn, :rename
|
||||||
|
|
||||||
|
@ -1027,7 +1029,7 @@ class Net::LDAP
|
||||||
conn.close
|
conn.close
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@result
|
@result.success?
|
||||||
end
|
end
|
||||||
|
|
||||||
# Delete an entry from the LDAP directory along with all subordinate entries.
|
# Delete an entry from the LDAP directory along with all subordinate entries.
|
||||||
|
|
Loading…
Reference in a new issue