# HG changeset patch # User Kim Alvefur # Date 1396438320 -7200 # Node ID f4de4a35778dd44ca319129bfcc226026235b628 # Parent 90bde50b3915fa5ab86623078582383157397b2b mod_auth_ldap: Default to 'bind' mode if rootdn is left empty diff -r 90bde50b3915 -r f4de4a35778d mod_auth_ldap/mod_auth_ldap.lua --- a/mod_auth_ldap/mod_auth_ldap.lua Wed Apr 02 13:30:53 2014 +0200 +++ b/mod_auth_ldap/mod_auth_ldap.lua Wed Apr 02 13:32:00 2014 +0200 @@ -12,7 +12,7 @@ local ldap_scope = module:get_option_string("ldap_scope", "onelevel"); local ldap_filter = module:get_option_string("ldap_filter", "(uid=$user)"):gsub("%%s", "$user", 1); local ldap_base = assert(module:get_option_string("ldap_base"), "ldap_base is a required option for ldap"); -local ldap_mode = module:get_option_string("ldap_mode", "getpasswd"); +local ldap_mode = module:get_option_string("ldap_mode", ldap_rootdn == "" and "bind" or "getpasswd"); local host = ldap_filter_escape(module:get_option_string("realm", module.host)); -- Initiate connection