* libs/web: Switched from HTTP-Basic-Auth to Session-Auth
[project/luci.git] / modules / admin-core / luasrc / controller / admin / system.lua
index a7c6587..862a741 100644 (file)
@@ -1,22 +1,31 @@
-module("luci.controller.admin.system", package.seeall)
+--[[
+LuCI - Lua Configuration Interface
+
+Copyright 2008 Steven Barth <steven@midlink.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
 
-require("luci.sys")
-require("luci.http")
-require("luci.util")
-require("luci.fs")
-require("luci.model.ipkg")
-require("luci.model.uci")
+       http://www.apache.org/licenses/LICENSE-2.0
+
+$Id$
+]]--
+module("luci.controller.admin.system", package.seeall)
 
 function index()
-       entry({"admin", "system"}, template("admin_system/index"), "System", 30)
-       entry({"admin", "system", "packages"}, call("action_packages"), "Paketverwaltung", 10)
-       entry({"admin", "system", "packages", "ipkg"}, call("action_ipkg"), "IPKG-Konfiguration")
-       entry({"admin", "system", "passwd"}, call("action_passwd"), "Passwort ändern", 20)
-       entry({"admin", "system", "sshkeys"}, call("action_sshkeys"), "SSH-Schlüssel", 30)
-       entry({"admin", "system", "hostname"}, cbi("admin_system/hostname"), "Hostname", 40)
-       entry({"admin", "system", "fstab"}, cbi("admin_system/fstab"), "Einhängepunkte", 50)
-       entry({"admin", "system", "upgrade"}, call("action_upgrade"), "Firmwareupgrade", 60)
-       entry({"admin", "system", "reboot"}, call("action_reboot"), "Neu starten", 70)
+       luci.i18n.loadc("admin-core")
+       local i18n = luci.i18n.translate
+       
+       entry({"admin", "system"}, template("admin_system/index"), i18n("system", "System"), 30)
+       entry({"admin", "system", "packages"}, call("action_packages"), i18n("a_s_packages", "Paketverwaltung"), 10)
+       entry({"admin", "system", "packages", "ipkg"}, call("action_ipkg"), i18n("a_s_p_ipkg", "IPKG-Konfiguration"))
+       entry({"admin", "system", "passwd"}, call("action_passwd"), i18n("a_s_changepw", "Passwort ändern"), 20)
+       entry({"admin", "system", "sshkeys"}, call("action_sshkeys"), i18n("a_s_sshkeys", "SSH-Schlüssel"), 30)
+       entry({"admin", "system", "system"}, cbi("admin_system/system"), i18n("system", "System"), 40)
+       entry({"admin", "system", "fstab"}, cbi("admin_system/fstab"), i18n("a_s_fstab", "Einhängepunkte"), 50)
+       entry({"admin", "system", "upgrade"}, call("action_upgrade"), i18n("a_s_flash", "Firmwareupgrade"), 60)
+       entry({"admin", "system", "reboot"}, call("action_reboot"), i18n("reboot", "Neu starten"), 70)
 end
 
 function action_editor()
@@ -62,7 +71,7 @@ function action_ipkg()
 end
 
 function action_packages()
-       local ipkg = luci.model.ipkg
+       local ipkg = require("luci.model.ipkg")
        local void = nil
        local submit = luci.http.formvalue("submit")
        
@@ -187,6 +196,7 @@ function action_sshkeys()
 end
 
 function action_upgrade()
+       require("luci.model.uci")
        local ret  = nil
        local plat = luci.fs.mtime("/lib/upgrade/platform.sh")
        
@@ -196,7 +206,7 @@ function action_upgrade()
        if plat and image then
                local kpattern = nil
                if keepcfg then
-                       local files = luci.model.uci.sections("luci").flash_keep
+                       local files = luci.model.uci.get_all("luci", "flash_keep")
                        if files.luci and files.luci.flash_keep then
                                kpattern = ""
                                for k,v in pairs(files.luci.flash_keep) do