From 55063df424b6ea8ab6979215a831aa5562c9771a Mon Sep 17 00:00:00 2001 From: ljf Date: Fri, 22 Mar 2019 16:36:51 +0100 Subject: [PATCH] [fix] Keep user info in json format --- access.lua | 1 + helpers.lua | 4 ++-- portal/assets/js/ynh_userinfo.json | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 portal/assets/js/ynh_userinfo.json diff --git a/access.lua b/access.lua index 4943640..5d3ad42 100644 --- a/access.lua +++ b/access.lua @@ -334,6 +334,7 @@ end if hlp.is_logged_in() then -- serve ynhpanel files + serveAsset("/ynh_userinfo.json", "js/ynh_userinfo.js") serveAsset("/ynh_portal.js", "js/ynh_portal.js") serveAsset("/ynh_overlay.css", "css/ynh_overlay.css") -- serve theme's files diff --git a/helpers.lua b/helpers.lua index a232a9a..3d219a8 100644 --- a/helpers.lua +++ b/helpers.lua @@ -538,13 +538,13 @@ function get_data_for(view) elseif view == "portal.html" or view == "edit.html" or view == "password.html" - or view == "ynhpanel.json" then + or view == "ynh_userinfo.json" then -- Invalidate cache before loading these views. -- Needed if the LDAP db is changed outside ssowat (from the cli for example). -- Not doing it for ynhpanel.json only for performance reasons, -- so the panel could show wrong first name, last name or main email address - if view ~= "ynhpanel.json" then + if view ~= "ynh_userinfo.json" then delete_user_info_cache(user) end diff --git a/portal/assets/js/ynh_userinfo.json b/portal/assets/js/ynh_userinfo.json new file mode 100644 index 0000000..0967ef4 --- /dev/null +++ b/portal/assets/js/ynh_userinfo.json @@ -0,0 +1 @@ +{}