Cache fix

This commit is contained in:
Kload 2013-10-21 22:53:42 +02:00
parent d611d15ce2
commit 098923c980

View file

@ -130,6 +130,11 @@ end
function set_headers (user) function set_headers (user)
user = user or ngx.var.cookie_SSOwAuthUser user = user or ngx.var.cookie_SSOwAuthUser
if not cache[user] then
flash("info", "Please log in to access to this content")
local back_url = ngx.var.scheme .. "://" .. ngx.var.http_host .. ngx.var.uri
return redirect(portal_url.."?r="..ngx.encode_base64(back_url))
end
if not cache[user]["mail"] then if not cache[user]["mail"] then
ldap = lualdap.open_simple("localhost") ldap = lualdap.open_simple("localhost")
for dn, attribs in ldap:search { for dn, attribs in ldap:search {