Code: Select all
local domain = "%Domain"
local user = c_GetUser("%Domain", "%Name")
local checked = false
if user ~= nil then
local temppass = "%Password"
local hashpass = ""
local arraypass = ""
if user.enable_two_factor == true and string.find(temppass, ":") then
arraypass = Split(temppass, ":")
temppass = arraypass[1]
end
if c_GetOptionInt(domain, DOPTION_ENABLE_PASS_SALTING) == 1 then
local salt_string = c_GetOptionStr(domain, DOPTION_SALTING_STRING)
temppass = temppass..salt_string
end
if c_GetOptionInt(domain, DOPTION_ENABLE_SHA256) == 1 then
hashpass = sha2(temppass)
else
hashpass = md5(temppass)
end
if user.password == hashpass then
checked = true
if user.enable_two_factor == true then
if c_TotpCode(user.two_factor_code) ~= arraypass[2] then
checked = false
end
end
end
end
if checked == true then
bSelfAuthenticated = true
else
bCancelEvent = true
endThe password for the login attempt should be "Password:OTPcode", like "xxyyzz:123456".
Wing FTP Server
English
Deutsch
简体中文