Skip to content
This repository has been archived by the owner on Dec 28, 2020. It is now read-only.

Commit

Permalink
luci-app-vsftpd: fix user list.
Browse files Browse the repository at this point in the history
  • Loading branch information
jjm2473 committed Jun 16, 2019
1 parent 4dff923 commit 9e54a4f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion root/usr/lib/lua/luci/model/cbi/aria2.lua
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ o = s:taboption("task", Value, "max_concurrent_downloads", translate("Max concur
o.placeholder = "5"

o = s:taboption("task", Value, "max_connection_per_server", translate("Max connection per server"), "1-16")
o.datetype = "range(1, 16)"
o.datatype = "range(1, 16)"
o.placeholder = "1"

o = s:taboption("task", Value, "min_split_size", translate("Min split size"), "1M-1024M")
Expand Down
9 changes: 8 additions & 1 deletion root/usr/lib/lua/luci/model/cbi/vsftpd.lua
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ anon_max_rate.rmempty=true
anon_max_rate:depends("anonymous_enable",1)
chown_username=s:taboption("anonymous",ListValue,"chown_username",translate("Chown User"))
chown_username:depends("anonymous_enable",1)
local list_user
for _, list_user in luci.util.vspairs(luci.util.split(luci.sys.exec("cat /etc/passwd | cut -f 1 -d:"))) do
chown_username:value(list_user)
end
Expand All @@ -174,8 +175,14 @@ local_userlist_type=s:taboption("userlist",ListValue,"userlist_type",translate("
local_userlist_type:value("allow","allow")
local_userlist_type:value("deny","deny")
list=s:taboption("userlist",DynamicList,"userlist",translate("User"))
list.datatype = "string"
for _, list_user in luci.util.vspairs(luci.util.split(luci.sys.exec("cat /etc/passwd | cut -f 1 -d:"))) do
list:value(list_user)
repeat
if list_user == "" then
break
end
list:value(list_user)
until true
end

tmpl=s:taboption("template",Value,"_tmpl","",translate("Here,you can edit the template of config file"))
Expand Down

0 comments on commit 9e54a4f

Please sign in to comment.