Mercurial > prosody-modules
comparison mod_auth_ldap/mod_auth_ldap.lua @ 3327:3af2da030397
mod_auth_ldap: Add compat with the previously mistaken documentation (thanks pep.)
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sun, 23 Sep 2018 14:20:06 +0200 |
parents | 5c3f3f5a4377 |
children | 7344513ee160 |
comparison
equal
deleted
inserted
replaced
3326:5e0193a27c53 | 3327:3af2da030397 |
---|---|
15 local ldap_tls = module:get_option_boolean("ldap_tls"); | 15 local ldap_tls = module:get_option_boolean("ldap_tls"); |
16 local ldap_scope = module:get_option_string("ldap_scope", "subtree"); | 16 local ldap_scope = module:get_option_string("ldap_scope", "subtree"); |
17 local ldap_filter = module:get_option_string("ldap_filter", "(uid=$user)"):gsub("%%s", "$user", 1); | 17 local ldap_filter = module:get_option_string("ldap_filter", "(uid=$user)"):gsub("%%s", "$user", 1); |
18 local ldap_base = assert(module:get_option_string("ldap_base"), "ldap_base is a required option for ldap"); | 18 local ldap_base = assert(module:get_option_string("ldap_base"), "ldap_base is a required option for ldap"); |
19 local ldap_mode = module:get_option_string("ldap_mode", "bind"); | 19 local ldap_mode = module:get_option_string("ldap_mode", "bind"); |
20 local ldap_admins = module:get_option_string("ldap_admin_filter"); | 20 local ldap_admins = module:get_option_string("ldap_admin_filter", |
21 module:get_option_string("ldap_admins")); -- COMPAT with mistake in documentation | |
21 local host = ldap_filter_escape(module:get_option_string("realm", module.host)); | 22 local host = ldap_filter_escape(module:get_option_string("realm", module.host)); |
22 | 23 |
23 -- Initiate connection | 24 -- Initiate connection |
24 local ld = nil; | 25 local ld = nil; |
25 module.unload = function() if ld then pcall(ld, ld.close); end end | 26 module.unload = function() if ld then pcall(ld, ld.close); end end |