Comparison

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
parent 902:490cb9161c81
child 1163:52bee1247014
comparison
equal deleted inserted replaced
1161:b9e4d935867c 1162:8e3420d48508
1 1
2 local new_sasl = require "util.sasl".new; 2 local new_sasl = require "util.sasl".new;
3 local log = require "util.logger".init("auth_ldap"); 3 local log = require "util.logger".init("auth_ldap");
4 4
5 local ldap_server = module:get_option("ldap_server") or "localhost"; 5 local ldap_server = module:get_option_string("ldap_server", "localhost");
6 local ldap_rootdn = module:get_option("ldap_rootdn") or ""; 6 local ldap_rootdn = module:get_option_string("ldap_rootdn", "");
7 local ldap_password = module:get_option("ldap_password") or ""; 7 local ldap_password = module:get_option_string("ldap_password", "");
8 local ldap_tls = module:get_option("ldap_tls"); 8 local ldap_tls = module:get_option_boolean("ldap_tls");
9 local ldap_base = assert(module:get_option("ldap_base"), "ldap_base is a required option for ldap"); 9 local ldap_base = assert(module:get_option_string("ldap_base"), "ldap_base is a required option for ldap");
10 10
11 local lualdap = require "lualdap"; 11 local lualdap = require "lualdap";
12 local ld = assert(lualdap.open_simple(ldap_server, ldap_rootdn, ldap_password, ldap_tls)); 12 local ld = assert(lualdap.open_simple(ldap_server, ldap_rootdn, ldap_password, ldap_tls));
13 module.unload = function() ld:close(); end 13 module.unload = function() ld:close(); end
14 14