---[[
-LuCI - Lua Configuration Interface
-
-Copyright 2008 Steven Barth <steven@midlink.org>
-Copyright 2011 Jo-Philipp Wich <xm@subsignal.org>
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-$Id$
-]]--
+-- Copyright 2008 Steven Barth <steven@midlink.org>
+-- Copyright 2011 Jo-Philipp Wich <jow@openwrt.org>
+-- Licensed to the public under the Apache License 2.0.
local fs = require "nixio.fs"
return { "_pass" }
end
-function m.on_commit(map)
+function m.parse(map)
local v1 = pw1:formvalue("_pass")
local v2 = pw2:formvalue("_pass")
m.message = translate("Given password confirmation did not match, password not changed!")
end
end
+
+ Map.parse(map)
end
keys = s2:option(TextValue, "_data", "")
keys.wrap = "off"
keys.rows = 3
-keys.rmempty = false
function keys.cfgvalue()
return fs.readfile("/etc/dropbear/authorized_keys") or ""
end
function keys.write(self, section, value)
- if value then
- fs.writefile("/etc/dropbear/authorized_keys", value:gsub("\r\n", "\n"))
- end
+ return fs.writefile("/etc/dropbear/authorized_keys", value:gsub("\r\n", "\n"))
+end
+
+function keys.remove(self, section, value)
+ return fs.writefile("/etc/dropbear/authorized_keys", "")
end
end