<%
require("luci.sys")
local load1, load5, load15 = luci.sys.loadavg()
local request = require("luci.dispatcher").context.path
local category = request[1]
local tree = luci.dispatcher.node()
local cattree = category and luci.dispatcher.node(category)
local node = luci.dispatcher.context.dispatched
local hostname = luci.sys.hostname()
local c = tree
for i,r in ipairs(request) do
if c.nodes and c.nodes[r] then
c = c.nodes[r]
c._menu_selected = true
end
end
require("luci.i18n").loadc("default")
require("luci.http").prepare_content("application/xhtml+xml")
-%>
<% if node and node.css then %>
<% end -%>
// -->
// -->
// --><%=striptags( hostname .. ( (node and node.title) and ' - ' .. node.title or '')) %> - LuCI
<%-
local function submenu(prefix, node)
if not node.nodes or node.hidden then
return false
end
local index = {}
local count = 0
for k, n in pairs(node.nodes) do
if n.title and n.target then
table.insert(index, {name=k, order=n.order or 100})
count = count + 1
end
end
table.sort(index, function(a, b) return a.order < b.order end)
if count > 0 then
%>
">
<%-
for j, v in pairs(index) do
if #v.name > 0 then
local nnode = node.nodes[v.name]
local href = controller .. prefix .. v.name .. "/"
href = (nnode.query) and href .. luci.http.build_querystring(nnode.query) or href
if nnode.nodes then
for k1, n1 in pairs(nnode.nodes) do
href = "#"
end
end
%>
<%
end
end
if cattree and cattree.nodes then
local index = {}
for k, node in pairs(cattree.nodes) do
table.insert(index, {name=k, order=node.order or 100})
end
table.sort(index, function(a, b) return a.order < b.order end)
for i, k in ipairs(index) do
node = cattree.nodes[k.name]
if node.title and node.target and not node.hidden then
local href = controller.."/"..category.."/"..k.name.."/"
href = (k.query) and href .. luci.http.build_querystring(k.query) or href
for k1, n1 in pairs(node.nodes) do
if n1.title and n1.target then
href = " #"
end
end
%>
<%
if tree.nodes[category] and tree.nodes[category].ucidata then
local ucic = 0
for i, j in pairs(require("luci.model.uci").cursor():changes()) do
for k, l in pairs(j) do
for m, n in pairs(l) do
ucic = ucic + 1;
end
end
end
-%>
<% require("luci.sys") local load1, load5, load15 = luci.sys.loadavg() local request = require("luci.dispatcher").context.path local category = request[1] local tree = luci.dispatcher.node() local cattree = category and luci.dispatcher.node(category) local node = luci.dispatcher.context.dispatched local hostname = luci.sys.hostname() local c = tree for i,r in ipairs(request) do if c.nodes and c.nodes[r] then c = c.nodes[r] c._menu_selected = true end end require("luci.i18n").loadc("default") require("luci.http").prepare_content("application/xhtml+xml") -%> <% if node and node.css then %> <% end -%> // --> // --> // --><%=striptags( hostname .. ( (node and node.title) and ' - ' .. node.title or '')) %> - LuCI
<%- local function submenu(prefix, node) if not node.nodes or node.hidden then return false end local index = {} local count = 0 for k, n in pairs(node.nodes) do if n.title and n.target then table.insert(index, {name=k, order=n.order or 100}) count = count + 1 end end table.sort(index, function(a, b) return a.order < b.order end) if count > 0 then %>
"> <%- for j, v in pairs(index) do if #v.name > 0 then local nnode = node.nodes[v.name] local href = controller .. prefix .. v.name .. "/" href = (nnode.query) and href .. luci.http.build_querystring(nnode.query) or href if nnode.nodes then for k1, n1 in pairs(nnode.nodes) do href = "#" end end %>
<% end end if cattree and cattree.nodes then local index = {} for k, node in pairs(cattree.nodes) do table.insert(index, {name=k, order=node.order or 100}) end table.sort(index, function(a, b) return a.order < b.order end) for i, k in ipairs(index) do node = cattree.nodes[k.name] if node.title and node.target and not node.hidden then local href = controller.."/"..category.."/"..k.name.."/" href = (k.query) and href .. luci.http.build_querystring(k.query) or href for k1, n1 in pairs(node.nodes) do if n1.title and n1.target then href = " #" end end %>
<% if tree.nodes[category] and tree.nodes[category].ucidata then local ucic = 0 for i, j in pairs(require("luci.model.uci").cursor():changes()) do for k, l in pairs(j) do for m, n in pairs(l) do ucic = ucic + 1; end end end -%>
f = SimpleForm("password", translate("a_s_changepw"), translate("a_s_changepw1")) --调用SimpleForm页面 当然还是I18N从中捣乱,看上去没那么直观,不理他
pw1=f:field(Value,"pw1",translate("password")) -- SimpleForm 里面加一个field 至于SimpleForm 和 fiemd是什么,一会去看SimpleForm页面去
pw1.rmempty=false -- 把SimpleForm的rmempty为不显示 后面就不做注释了 应该看得懂了
pw2 = f:field(Value, "pw2", translate("confirmation"))
pw2.rmempty = false
function pw2.validate(self, value, section)
return pw1:formvalue(section) == value and value
end
function f.handle(self, state, data)
if state == FORM_VALID then --这个就是业务处理了 你懂得 呵呵
local stat = luci.sys.user.setpasswd("admin", data.pw1) == 0 -- root --> admin
if stat then
f.message = translate("a_s_changepw_changed")
else
f.errmessage = translate("unknownerror")
end
data.pw1 = nil
data.pw2 = nil
end
return true
end
return f
versionlist = {}
function getline (s)
.........
end
function get_versionlist()
.........
end
versionlist = get_versionlist()
14 versionlist = {}
15
16 function getline (s)
.........
32 end
33
34 function get_versionlist()
.........
68 end
69
70 versionlist = get_versionlist()
例如,你想myuser使用mypassword从任何主机连接到mysql服务器的话。
GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'%'IDENTIFIED BY 'mypassword' WI
TH GRANT OPTION;
如果你想允许用户myuser从ip为192.168.1.6的主机连接到mysql服务器,并使用mypassword作
在 Service Pack 4 (SP 4), 是运行 Microsoft Windows Server 2003、 Microsoft Windows Storage Server 2003 或 Microsoft Windows 2000 服务器上您尝试安装 Microsoft SQL Server 2000 通过卷许可协议 (VLA) 媒体。 这样做, 收到以下错误信息CD KEY的 SQ
OS 7 has a new method that allows you to draw a view hierarchy into the current graphics context. This can be used to get an UIImage very fast.
I implemented a category method on UIView to get the vi
方法一:
在my.ini的[mysqld]字段加入:
skip-grant-tables
重启mysql服务,这时的mysql不需要密码即可登录数据库
然后进入mysql
mysql>use mysql;
mysql>更新 user set password=password('新密码') WHERE User='root';
mysq
背景
2014年11月12日,ASP.NET之父、微软云计算与企业级产品工程部执行副总裁Scott Guthrie,在Connect全球开发者在线会议上宣布,微软将开源全部.NET核心运行时,并将.NET 扩展为可在 Linux 和 Mac OS 平台上运行。.NET核心运行时将基于MIT开源许可协议发布,其中将包括执行.NET代码所需的一切项目——CLR、JIT编译器、垃圾收集器(GC)和核心