Mercurial > prosody-modules
diff mod_auth_ldap/mod_auth_ldap.lua @ 1162:8e3420d48508
mod_auth_ldap: Switch to type-specific get_option variants
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Thu, 15 Aug 2013 15:22:51 +0200 |
parents | 490cb9161c81 |
children | 52bee1247014 |
line wrap: on
line diff
--- a/mod_auth_ldap/mod_auth_ldap.lua Wed Aug 14 02:38:50 2013 +0100 +++ b/mod_auth_ldap/mod_auth_ldap.lua Thu Aug 15 15:22:51 2013 +0200 @@ -2,11 +2,11 @@ local new_sasl = require "util.sasl".new; local log = require "util.logger".init("auth_ldap"); -local ldap_server = module:get_option("ldap_server") or "localhost"; -local ldap_rootdn = module:get_option("ldap_rootdn") or ""; -local ldap_password = module:get_option("ldap_password") or ""; -local ldap_tls = module:get_option("ldap_tls"); -local ldap_base = assert(module:get_option("ldap_base"), "ldap_base is a required option for ldap"); +local ldap_server = module:get_option_string("ldap_server", "localhost"); +local ldap_rootdn = module:get_option_string("ldap_rootdn", ""); +local ldap_password = module:get_option_string("ldap_password", ""); +local ldap_tls = module:get_option_boolean("ldap_tls"); +local ldap_base = assert(module:get_option_string("ldap_base"), "ldap_base is a required option for ldap"); local lualdap = require "lualdap"; local ld = assert(lualdap.open_simple(ldap_server, ldap_rootdn, ldap_password, ldap_tls));