summaryrefslogtreecommitdiff
path: root/site-ruby/myldap.rb
diff options
context:
space:
mode:
Diffstat (limited to 'site-ruby/myldap.rb')
-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') ) )