summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Palfrader <peter@palfrader.org>2006-11-28 13:16:24 +0000
committerweasel <weasel@bc3d92e2-beff-0310-a7cd-cc87d7ac0ede>2006-11-28 13:16:24 +0000
commit17949318621ad28f9a2181a1e6aa16223d2beb4f (patch)
tree87bc61fc7ff52dc939c57a71ab952a61863bbffb
parent4670adaf20d9f964f6b23d74c975a0404c54ebeb (diff)
Allow anon access to ldap, II
git-svn-id: svn+ssh://asteria.noreply.org/svn/weaselutils/trunk@247 bc3d92e2-beff-0310-a7cd-cc87d7ac0ede
-rw-r--r--site-ruby/myldap.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/site-ruby/myldap.rb b/site-ruby/myldap.rb
index b536e01..d2cddef 100644
--- a/site-ruby/myldap.rb
+++ b/site-ruby/myldap.rb
@@ -9,11 +9,12 @@ class MyLDAP
@conn = LDAP::Conn.new(config['ldapserver'], config['ldapport'])
@basedn = config['basedn']
if use
+ unless config['credentials'][use]
+ throw "No credentials for #{use} found."
+ end
unless config['credentials'][use]['anon']
@binddn = config['credentials'][use]['binddn']
@bindpw = config['credentials'][use]['bindpw']
- else
- throw "No credentials for #{use} found."
end
elsif File.exists? File.expand_path('~/.noreply.ldap')
myconfig = YAML::load( File.open( File.expand_path('~/.noreply.ldap') ) )