mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 07:29:32 +00:00
Always redirect somewhere on captive success, instead of displaying an empty page
This commit is contained in:
parent
181f8a8178
commit
2a37337a9c
2 changed files with 11 additions and 3 deletions
|
|
@ -20,15 +20,21 @@ local redirection_url = ntop.getPref("ntopng.prefs.redirection_url")
|
|||
if isEmptyString(redirection_url) then
|
||||
-- Redirect to the original URL
|
||||
redirection_url = _GET["referer"]
|
||||
end
|
||||
|
||||
if not isEmptyString(redirection_url) and not starts(redirection_url, "http") then
|
||||
redirection_url = "http://" .. redirection_url
|
||||
end
|
||||
if isEmptyString(redirection_url) then
|
||||
-- Last resort, using www.ntop.org
|
||||
redirection_url = "www.ntop.org"
|
||||
end
|
||||
|
||||
if not isEmptyString(redirection_url) then
|
||||
if not starts(redirection_url, "http") then
|
||||
redirection_url = "http://" .. redirection_url
|
||||
end
|
||||
|
||||
print('<meta http-equiv="refresh" Content="0; url='..redirection_url..'"/>')
|
||||
end
|
||||
|
||||
print [[
|
||||
</head>
|
||||
<body>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue