Permalink
Browse files

* guess default port.

git-svn-id: http://ruby-activeldap.googlecode.com/svn/trunk@829 fd4f1387-ac19-0410-9179-05984c98faae
  • Loading branch information...
1 parent ca7f35b commit 93d60597bf640197546091c318925c737e00e613 koutou committed Feb 9, 2009
Showing with 6 additions and 2 deletions.
  1. +6 −2 benchmark/bench-al.rb
View
@@ -21,12 +21,16 @@
config = ActiveLdap::Base.configuration
LDAP_HOST = config[:host]
-LDAP_PORT = config[:port]
+LDAP_METHOD = config[:method]
+if LDAP_METHOD == :ssl
+ LDAP_PORT = config[:port] || URI::LDAPS::DEFAULT_PORT
+else
+ LDAP_PORT = config[:port] || URI::LDAP::DEFAULT_PORT
+end
LDAP_BASE = config[:base]
LDAP_PREFIX = options.prefix
LDAP_USER = config[:bind_dn]
LDAP_PASSWORD = config[:password]
-LDAP_METHOD = config[:method]
class ALUser < ActiveLdap::Base
ldap_mapping :dn_attribute => 'uid', :prefix => LDAP_PREFIX,

0 comments on commit 93d6059

Please sign in to comment.