index.lua 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. --[[
  2. LuCI - Lua Configuration Interface
  3. Copyright 2008 Steven Barth <steven@midlink.org>
  4. Copyright 2008 Jo-Philipp Wich <xm@leipzig.freifunk.net>
  5. Licensed under the Apache License, Version 2.0 (the "License");
  6. you may not use this file except in compliance with the License.
  7. You may obtain a copy of the License at
  8. http://www.apache.org/licenses/LICENSE-2.0
  9. $Id$
  10. ]]--
  11. module("luci.controller.admin.index", package.seeall)
  12. function index()
  13. local uci_state = luci.model.uci.cursor_state()
  14. -- Disable gluon-luci-admin when setup mode is not enabled
  15. if uci_state:get_first('gluon-setup-mode', 'setup_mode', 'running', '0') ~= '1' then
  16. return
  17. end
  18. local root = node()
  19. if not root.lock then
  20. root.target = alias("admin")
  21. root.index = true
  22. end
  23. local page = entry({"admin"}, alias("admin", "index"), _("Expert Mode"), 10)
  24. page.sysauth = "root"
  25. page.sysauth_authenticator = function() return "root" end
  26. page.index = true
  27. entry({"admin", "index"}, cbi("admin/info"), _("Information"), 1).ignoreindex = true
  28. entry({"admin", "remote"}, cbi("admin/remote"), _("Remote access"), 10)
  29. end