mirror of
https://github.com/YunoHost/SSOwat.git
synced 2024-09-03 20:06:27 +02:00
Misc cosmetics / debug tweaks
This commit is contained in:
parent
dcbf66d4e4
commit
41ed91bbcb
2 changed files with 7 additions and 5 deletions
|
@ -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
|
||||||
|
|
|
@ -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"], "/")
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue