df2d981e4c01b9e90d42983d0778f16075184c53
[project/luci.git] / src / ffluci / controller / admin / system.lua
1 module("ffluci.controller.admin.system", package.seeall)
2
3 require("ffluci.util")
4 require("ffluci.http")
5
6 menu = {
7 descr = "System",
8 order = 20,
9 entries = {
10 {action = "passwd", descr = "Passwort"},
11 }
12 }
13
14 function action_passwd()
15 local p1 = ffluci.http.formvalue("pwd1")
16 local p2 = ffluci.http.formvalue("pwd2")
17 local msg = nil
18 local cm
19
20 if p1 or p2 then
21 cm = "(echo '"..p1.."';sleep 1;echo '"..p2.."') | passwd root 2>&1"
22 msg = ffluci.util.exec(cm)
23 end
24
25 ffluci.template.render("admin_system/passwd", {msg=msg})
26 end