Misc cosmetics / debug tweaks

This commit is contained in:
Alexandre Aubin 2020-09-20 18:00:49 +02:00
parent dcbf66d4e4
commit 41ed91bbcb
2 changed files with 7 additions and 5 deletions

View file

@ -226,11 +226,12 @@ end
-- --
-- 3. Redirected URLs -- 3. REDIRECTED URLS
-- --
-- If the URL matches one of the `redirected_urls` in the configuration file, -- If the URL matches one of the `redirected_urls` in the configuration file,
-- just redirect to the target URL/URI -- just redirect to the target URL/URI
-- --
function detect_redirection(redirect_url) function detect_redirection(redirect_url)
if hlp.string.starts(redirect_url, "http://") if hlp.string.starts(redirect_url, "http://")
or hlp.string.starts(redirect_url, "https://") then or hlp.string.starts(redirect_url, "https://") then

View file

@ -232,7 +232,7 @@ function refresh_logged_in()
local authHash = ngx.var.cookie_SSOwAuthHash local authHash = ngx.var.cookie_SSOwAuthHash
authUser = nil authUser = nil
if expireTime and expireTime ~= "" if expireTime and expireTime ~= ""
and authHash and authHash ~= "" and authHash and authHash ~= ""
and user and user ~= "" and user and user ~= ""
@ -302,17 +302,18 @@ function has_access(permission, user)
user = user or authUser user = user or authUser
if permission == nil then if permission == nil then
logger.debug("No permission matching request for "..ngx.var.uri)
return false return false
end end
-- Public access -- Public access
if user == nil or permission["public"] then if user == nil or permission["public"] then
user = user or "A visitor" user = user or "A visitor"
logger.debug(user.." tries to access "..ngx.var.uri) logger.debug(user.." tries to access "..ngx.var.uri.." (corresponding perm: "..permission["id"]..")")
return permission["public"] return permission["public"]
end end
logger.debug("User "..user.." tries to access "..ngx.var.uri) logger.debug("User "..user.." tries to access "..ngx.var.uri.." (corresponding perm: "..permission["id"]..")")
-- All user in this permission -- All user in this permission
allowed_users = permission["users"] allowed_users = permission["users"]
@ -508,7 +509,7 @@ end
-- It is used to render the SSOwat portal *only*. -- It is used to render the SSOwat portal *only*.
function serve(uri, cache) function serve(uri, cache)
logger.debug("Serving portal uri "..uri.." (if the corresponding file exists)") logger.debug("Serving portal uri "..uri)
rel_path = string.gsub(uri, conf["portal_path"], "/") rel_path = string.gsub(uri, conf["portal_path"], "/")