diff options
| author | Alan Messias Cordeiro <alancordeiro@gmail.com> | 2013-12-30 18:37:12 +0000 | 
|---|---|---|
| committer | Alan Messias Cordeiro <alancordeiro@gmail.com> | 2013-12-30 18:37:12 +0000 | 
| commit | f28825cad9f20924b2234a0098338fa2444ff9a7 (patch) | |
| tree | 3ffac483efd1e06b6cfefe8c05ca27435019e39b | |
| parent | 2d12c7f0a21f1310017fb208698e893127c41d35 (diff) | |
| download | acf-openldap-master.tar.bz2 acf-openldap-master.tar.xz | |
| -rw-r--r-- | openldap-controller.lua | 2 | ||||
| -rw-r--r-- | openldap-model.lua | 8 | 
2 files changed, 6 insertions, 4 deletions
| diff --git a/openldap-controller.lua b/openldap-controller.lua index 3e63f70..00b9f2e 100644 --- a/openldap-controller.lua +++ b/openldap-controller.lua @@ -17,7 +17,7 @@ mymodule.expert = function(self)  end  mymodule.search = function(self) -        return self.handle_form(self, self.model.get_ldapsearch,  self.model.get_ldapsearch, "Search", "Search Again") +	return self.model.get_ldapsearch(self)  end  return mymodule 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: (.*)") | 
