")
end
-- if login button
if (ButtonType and ButtonType == "login") then
local inputTable = web.cgiToLuaTable(cgi)
-- authenticate and login
local status,statusMsg,loginConf = login.login (inputTable)
if (status == 0) then
util.appendDebugOut("VALID LOGIN!
")
util.appendDebugOut("NORMAL LOGIN!
")
web.goToPage(NextPage, true, true)
elseif (status == 1) then
util.appendDebugOut("REPEAT LOGIN!
")
statusMessage = statusMsg
loginInfo = loginConf
errorFlag = "OK"
web.goToPage(FORCED_LOGIN_PAGE, false, true)
elseif (status == 2) then
util.appendDebugOut("SSL LOGIN!
")
web.goToPage(SSL_PORTAL_PAGE, false, true)
elseif (status == 3) then
util.appendDebugOut("REPEAT LOGIN!
")
statusMessage = statusMsg
errorFlag = "OK"
cgilua.redirect ("https://" .. SAPI.Request.servervariable("SERVER_ADDR") .. "/scgi-bin/platform.cgi?page=" .. Page .. "&portal=" .. portalName .. "&stuMsg=" .. statusMsg)
else
util.appendDebugOut("INVALID LOGIN. TRY AGAIN!
")
statusMessage = db.getAttribute("stringsMap", "stringId", statusMsg, LANGUAGE) or statusMsg
-- go back to login page
cgilua.redirect ("https://" .. SAPI.Request.servervariable("SERVER_ADDR") .. "/scgi-bin/platform.cgi?page=" .. Page .. "&portal=" .. portalName .. "&stuMsg=" .. statusMessage)
end
else
?>