diff options
author | Andreas Brodmann <andreas.brodmann@gmail.com> | 2007-11-12 16:13:51 +0000 |
---|---|---|
committer | Andreas Brodmann <andreas.brodmann@gmail.com> | 2007-11-12 16:13:51 +0000 |
commit | 9f186b02cb10036f234a965bfca6080186217c50 (patch) | |
tree | db8f1988525d3906b73a98936aabca389f9ead10 /dhcp-controller.lua | |
parent | b5d32caafdb1e8e520145d202ca8e347e038251e (diff) | |
download | acf-dhcp-9f186b02cb10036f234a965bfca6080186217c50.tar.bz2 acf-dhcp-9f186b02cb10036f234a965bfca6080186217c50.tar.xz |
added global settings configuration to dhcp
git-svn-id: svn://svn.alpinelinux.org/acf/dhcp/trunk@298 ab2d0c66-481e-0410-8bed-d214d4d58bed
Diffstat (limited to 'dhcp-controller.lua')
-rw-r--r-- | dhcp-controller.lua | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/dhcp-controller.lua b/dhcp-controller.lua index 0542150..cca9a98 100644 --- a/dhcp-controller.lua +++ b/dhcp-controller.lua @@ -49,6 +49,31 @@ dep = function ( self ) return ( cfe ({ msg = msg }) ) end +settings = function ( self ) + + if not self.clientdata.cmd then + list_redir(self) + end + + local settings = {} + local option = { script = ENV["SCRIPT_NAME"], + prefix = self.conf.prefix, + controller = self.conf.controller, + action = self.conf.action, + extra = "" + } + + if self.clientdata.cmd == "update" then + tmp = self.clientdata + settings = self.model.create_new_settings( tmp.defleasetime, tmp.maxleasetime, tmp.domainname ) + errcode, settings = self.model.update_settings( settings ) + return ( cfe ({ option = option, value = settings, errcode = errcode })) + else + settings = self.model.read_settings() + return ( cfe ({ option = option, value = settings, errcode = { msg = "", fields={} }}) ) + end +end + editnet = function ( self ) if not self.clientdata.cmd then |