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
|
||||
if authUser == nil then
|
||||
logger:debug("Denied unauthenticated access to "..ngx.var.uri.." (corresponding perm: "..permission["id"]..")")
|
||||
has_access = false
|
||||
has_access = false
|
||||
else
|
||||
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
|
||||
if element_is_in_table(authUser, permission["users"]) then
|
||||
logger:debug("User "..authUser.." can access "..ngx.var.host..ngx.var.uri..uri_args_string())
|
||||
has_access = true
|
||||
else
|
||||
logger:debug("User "..authUser.." cannot access "..ngx.var.uri)
|
||||
has_access = false
|
||||
end
|
||||
-- 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
|
||||
logger:debug("User "..authUser.." can access "..ngx.var.host..ngx.var.uri..uri_args_string())
|
||||
has_access = true
|
||||
else
|
||||
logger:debug("User "..authUser.." cannot access "..ngx.var.uri)
|
||||
has_access = false
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -318,17 +318,17 @@ else
|
|||
logger:debug("Domain " .. ngx.var.host .. " is not configured for SSOWat, falling back to default")
|
||||
portal_domain = conf["domain_portal_urls"]["default"]
|
||||
if portal_domain ~= nil then
|
||||
if string.starts(portal_domain, '/') then
|
||||
portal_domain = ngx.var.host .. portal_domain
|
||||
end
|
||||
return ngx.redirect("https://" .. portal_domain)
|
||||
end
|
||||
if string.starts(portal_domain, '/') then
|
||||
portal_domain = ngx.var.host .. portal_domain
|
||||
end
|
||||
return ngx.redirect("https://" .. portal_domain)
|
||||
end
|
||||
end
|
||||
if portal_domain == nil then
|
||||
ngx.header['Content-Type'] = "text/html"
|
||||
ngx.status = 400
|
||||
ngx.say("Unmanaged domain")
|
||||
return ngx.exit(200)
|
||||
ngx.header['Content-Type'] = "text/html"
|
||||
ngx.status = 400
|
||||
ngx.say("Unmanaged domain")
|
||||
return ngx.exit(200)
|
||||
end
|
||||
|
||||
portal_url = "https://" .. portal_domain
|
||||
|
|
Loading…
Reference in a new issue