Gitlab CSE Unil

Commit e59902cb authored by Julien Furrer's avatar Julien Furrer
Browse files

Added SLO configuration for enabling

parent 29417542
......@@ -58,11 +58,14 @@ function($){
rateLimitWait: 300
},
//// Uncomment to enable Shibboleth SLO
//aai : {
// sp_logout: "https://jabba.unil.ch/Shibboleth.sso/Logout",
// idp_logout: "https://aai.unil.ch/idp/logout.jsp"
//},
//// AAI Single Logout
aai : {
slo: false,
urls: {
sp_logout: "https://jabba.unil.ch/Shibboleth.sso/Logout",
idp_logout: "https://aai.unil.ch/idp/logout.jsp"
}
},
// ====================================================================
......
......@@ -228,12 +228,12 @@ function($, _, Signal, paper, config, view, io, tools, attributes, Users, export
});
// AAI SLO
if (config.aai && config.user && config.user.shibboleth) {
if (config.aai && config.aai.slo && config.user && config.user.shibboleth) {
$("#adim-logout-but").click(function (event) {
event.preventDefault();
var logout_url = $(this).attr("href");
$("<iframe>", {src: config.aai.sp_logout}).appendTo("body").hide();
$("<iframe>", {src: config.aai.idp_logout}).appendTo("body").hide();
$("<iframe>", {src: config.aai.urls.sp_logout}).appendTo("body").hide();
$("<iframe>", {src: config.aai.urls.idp_logout}).appendTo("body").hide();
setTimeout(function () {
window.document.location.href = logout_url;
}, 500);
......
This diff is collapsed.
This diff is collapsed.
......@@ -80,6 +80,8 @@ window.ADIM_CONFIG = {
show_users_results: {{ display_shared_annotations|yesno:"true,false" }}
},
aai: {slo: {{ AAI_CFG.SLO|yesno:"true,false" }} },
thumbnailSize: parseInt("{{ THUMB_SIZE.0 }}", 10),
uploadMaxFileSize: parseInt('{{ UPLOAD_MAX_FILESIZE }}',10) * Math.pow(2, 20)
};
......
......@@ -40,6 +40,8 @@ window.ADIM_CONFIG = {
initial_tool: 'select'
},
aai: {slo: {{ AAI_CFG.SLO|yesno:"true,false" }} },
uploadMaxFileSize: parseInt("{{ UPLOAD_MAX_FILESIZE }}") * Math.pow(2, 20)
};
</script>
......
......@@ -11,7 +11,8 @@ def default(request):
'UPLOAD_MAX_FILESIZE': settings.ADIM_UPLOAD_MAX_FILESIZE,
'THUMB_SIZE': settings.ADIM_THUMB_SIZE,
'JS_MIN': '' if settings.ADIM_DEBUG_JS and not settings.ADIM_PROD else '.min',
'PROD': settings.ADIM_PROD
'PROD': settings.ADIM_PROD,
'AAI_CFG': getattr(settings, 'AAI', {'SLO': False})
})
# try:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment