1 module("ffluci.controller.admin.system", package.seeall)
12 {action = "passwd", descr = "Passwort"},
16 function action_editor()
17 local file = ffluci.http.formvalue("file")
18 local data = ffluci.http.formvalue("data")
24 stat, err = pcall(ffluci.fs.writefile, file, data)
28 err = ffluci.util.split(err, " ")
30 msg = table.concat(err, " ")
33 local stat, cnt = pcall(ffluci.fs.readfile, fname)
35 cnt = ffluci.util.pcdata(cnt)
39 ffluci.template.render("admin_system/editor", {fn=file, cnt=cnt, msg=msg})
42 function action_passwd()
43 local p1 = ffluci.http.formvalue("pwd1")
44 local p2 = ffluci.http.formvalue("pwd2")
49 msg = ffluci.sys.user.setpasswd("root", p1, p2)
52 ffluci.template.render("admin_system/passwd", {msg=msg})