mirror of
https://github.com/YunoHost/SSOwat.git
synced 2024-09-03 20:06:27 +02:00
ew, /tabz/
This commit is contained in:
parent
d6d775f0dc
commit
6263195756
1 changed files with 18 additions and 18 deletions
36
access.lua
36
access.lua
|
@ -221,18 +221,18 @@ else
|
||||||
-- Unauthenticated user, deny access
|
-- Unauthenticated user, deny access
|
||||||
if authUser == nil then
|
if authUser == nil then
|
||||||
logger:debug("Denied unauthenticated access to "..ngx.var.uri.." (corresponding perm: "..permission["id"]..")")
|
logger:debug("Denied unauthenticated access to "..ngx.var.uri.." (corresponding perm: "..permission["id"]..")")
|
||||||
has_access = false
|
has_access = false
|
||||||
else
|
else
|
||||||
logger:debug("User "..authUser.." tries to access "..ngx.var.uri.." (corresponding perm: "..permission["id"]..")")
|
logger:debug("User "..authUser.." tries to access "..ngx.var.uri.." (corresponding perm: "..permission["id"]..")")
|
||||||
|
|
||||||
-- The user has permission to access the content if s.he is in the list of allowed users
|
-- The user has permission to access the content if s.he is in the list of allowed users
|
||||||
if element_is_in_table(authUser, permission["users"]) then
|
if element_is_in_table(authUser, permission["users"]) then
|
||||||
logger:debug("User "..authUser.." can access "..ngx.var.host..ngx.var.uri..uri_args_string())
|
logger:debug("User "..authUser.." can access "..ngx.var.host..ngx.var.uri..uri_args_string())
|
||||||
has_access = true
|
has_access = true
|
||||||
else
|
else
|
||||||
logger:debug("User "..authUser.." cannot access "..ngx.var.uri)
|
logger:debug("User "..authUser.." cannot access "..ngx.var.uri)
|
||||||
has_access = false
|
has_access = false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -318,17 +318,17 @@ else
|
||||||
logger:debug("Domain " .. ngx.var.host .. " is not configured for SSOWat, falling back to default")
|
logger:debug("Domain " .. ngx.var.host .. " is not configured for SSOWat, falling back to default")
|
||||||
portal_domain = conf["domain_portal_urls"]["default"]
|
portal_domain = conf["domain_portal_urls"]["default"]
|
||||||
if portal_domain ~= nil then
|
if portal_domain ~= nil then
|
||||||
if string.starts(portal_domain, '/') then
|
if string.starts(portal_domain, '/') then
|
||||||
portal_domain = ngx.var.host .. portal_domain
|
portal_domain = ngx.var.host .. portal_domain
|
||||||
end
|
end
|
||||||
return ngx.redirect("https://" .. portal_domain)
|
return ngx.redirect("https://" .. portal_domain)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if portal_domain == nil then
|
if portal_domain == nil then
|
||||||
ngx.header['Content-Type'] = "text/html"
|
ngx.header['Content-Type'] = "text/html"
|
||||||
ngx.status = 400
|
ngx.status = 400
|
||||||
ngx.say("Unmanaged domain")
|
ngx.say("Unmanaged domain")
|
||||||
return ngx.exit(200)
|
return ngx.exit(200)
|
||||||
end
|
end
|
||||||
|
|
||||||
portal_url = "https://" .. portal_domain
|
portal_url = "https://" .. portal_domain
|
||||||
|
|
Loading…
Reference in a new issue