lib/ldap/server/operation.rb in ruby-ldapserver-0.3.1 vs lib/ldap/server/operation.rb in ruby-ldapserver-0.4.0
- old
+ new
@@ -36,21 +36,19 @@
])
@schema = @connection.opt[:schema]
@server = @connection.opt[:server]
end
- # Send a log message
-
- def log(*args)
- @connection.log(*args)
- end
-
# Send an exception report to the log
- def log_exception(e)
- @connection.log "#{e}: #{e.backtrace.join("\n\tfrom ")}"
+ def debug msg
+ @connection.debug msg
end
+
+ def log_exception
+ @connection.log_exception msg
+ end
##################################################
### Utility methods to send protocol responses ###
##################################################
@@ -296,11 +294,11 @@
attr = seq.value[1].value[0].value
if @schema
attr = @schema.find_attrtype(attr).to_s
end
vals = seq.value[1].value[1].value.collect { |v| v.value }
- case seq.value[0].value
+ case seq.value[0].value.to_i
when 0
modinfo[attr] = [:add] + vals
when 1
modinfo[attr] = [:delete] + vals
when 2
@@ -434,10 +432,11 @@
# Call send_SearchResultEntry for each result found. Raise an exception
# if there is a problem. timeLimit, sizeLimit and typesOnly are taken
# care of, but you need to perform all authorisation checks yourself,
# using @connection.binddn
- def search(basedn, scope, deref, filter, attrs)
+ def search(basedn, scope, deref, filter)
+ debug "search(#{basedn}, #{scope}, #{deref}, #{filter})"
raise LDAP::ResultError::UnwillingToPerform, "search not implemented"
end
# Handle a modify request; override this
#