mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-11-16 21:43:33 +08:00
✨ Sync 2026-08-13 22:19:05
This commit is contained in:
1 parent
b3d043e5e5
commit
839d09ae31
110 files changed
+87700
-7
No files matched your search
@@ -19,6 +19,19 @@ s.dynamic = false
|
||||
o = s:option(Value, "username", translate("Username"))
|
||||
o.datatype = "and(uciname,maxlength(24))"
|
||||
o.rmempty = false
|
||||
function o.validate(self, value, section)
|
||||
local exists = false
|
||||
m.uci:foreach("passwall_server", "user", function(s)
|
||||
if s[".name"] ~= section and s.username == value then
|
||||
exists = true
|
||||
return false
|
||||
end
|
||||
end)
|
||||
if exists then
|
||||
return nil, translate("This username already exists.")
|
||||
end
|
||||
return value
|
||||
end
|
||||
|
||||
o = s:option(Value, "password", translate("Password"))
|
||||
o.rmempty = false
|
||||
|
||||
Reference in new issue
Block a user