diff options
Diffstat (limited to 'openldap-model.lua')
-rw-r--r-- | openldap-model.lua | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/openldap-model.lua b/openldap-model.lua index 5c525a4..38b70bd 100644 --- a/openldap-model.lua +++ b/openldap-model.lua @@ -26,7 +26,7 @@ function mymodule.update_filecontent(self, filedetails) return modelfunctions.setfiledetails(self, filedetails, {configfile}) end -function mymodule.get_ldapsearch(self, ldapdata) +function mymodule.get_ldapsearch(self) local cnf = mymodule.parse_config(configfile) local result = {} @@ -34,11 +34,13 @@ function mymodule.get_ldapsearch(self, ldapdata) local handle = io.popen(cmd) local file = handle:read("*a") - result.dn = cfe({type="longtext", label="DNs"}) result.suffix = cfe({label="Suffix"}) result.suffix.value = cnf.suffix or "" result.suffix.readonly = true - + result.suffix.seq = 1 + result.dn = cfe({type="longtext", label="DNs"}) + result.dn.seq = 2 + for line in string.gmatch(file, "[^\n]+") do if string.match(line, "^dn") then result.dn.value = result.dn.value .."\n"..string.match(line, "dn: (.*)") |