Commit ff0c8029 authored by Xavier Guimard's avatar Xavier Guimard

Change oidc content key for removal (#1431)

parent 31d3b1e7
......@@ -111,18 +111,20 @@ sub defaultValues {
'locationRules' => {
'default' => 'deny'
},
'logoutServices' => {},
'macros' => {},
'mailCharset' => 'utf-8',
'mailFrom' => 'noreply@example.com',
'mailSessionKey' => 'mail',
'mailTimeout' => 0,
'mailUrl' => 'http://auth.example.com/resetpwd',
'managerDn' => '',
'managerPassword' => '',
'max2FDevices' => 10,
'max2FDevicesNameLength' => 20,
'multiValuesSeparator' => '; ',
'logoutServices' => {},
'macros' => {},
'mailCharset' => 'utf-8',
'mailFrom' => 'noreply@example.com',
'mailSessionKey' => 'mail',
'mailTimeout' => 0,
'mailUrl' => 'http://auth.example.com/resetpwd',
'managerDn' => '',
'managerPassword' => '',
'max2FDevices' => 10,
'max2FDevicesNameLength' => 20,
'multiValuesSeparator' => '; ',
'mySessionAuthorizedRWKeys' =>
[ '_appsListOrder', '_oidcConnectedRP', '_oidc_consent_*' ],
'notificationStorage' => 'File',
'notificationStorageOptions' => {
'dirName' => '/var/lib/lemonldap-ng/notifications'
......
......@@ -123,8 +123,12 @@ sub BUILD {
if ( $self->{info} ) {
foreach ( keys %{ $self->{info} } ) {
$data->{$_} = $self->{info}->{$_}
if ( defined $self->{info}->{$_} );
if ( defined $self->{info}->{$_} ) {
$data->{$_} = $self->{info}->{$_};
}
else {
delete $data->{$_};
}
}
delete $self->{info};
}
......
......@@ -5,6 +5,11 @@ our $VERSION = '2.0.0';
sub types {
return {
'array' => {
'test' => sub {
1;
}
},
'authParamsText' => {
'test' => sub {
1;
......@@ -1592,6 +1597,11 @@ qr/^(?:\*\.)?(?:(?:(?:(?:[a-zA-Z0-9][-a-zA-Z0-9]*)?[a-zA-Z0-9])[.])*(?:[a-zA-Z][
'default' => '; ',
'type' => 'authParamsText'
},
'mySessionAuthorizedRWKeys' => {
'default' =>
[ '_appsListOrder', '_oidcConnectedRP', '_oidc_consent_*' ],
'type' => 'array'
},
'nginxCustomHandlers' => {
'keyTest' => qr/^\w+$/,
'msgFail' => '__badPerlPackageName__',
......
......@@ -208,6 +208,9 @@ sub types {
samlService => {
test => sub { 1 }
},
array => {
test => sub { 1 }
},
};
}
......@@ -220,7 +223,13 @@ sub attributes {
documentation =>
'Timeout to check new configuration in local cache',
default => 600,
flags => 'hp',
flags => 'hp',
},
mySessionAuthorizedRWKeys => {
type => 'array',
documentation => 'Alterable session keys by user itself',
default =>
[ '_appsListOrder', '_oidcConnectedRP', '_oidc_consent_*' ],
},
configStorage => {
type => 'text',
......
......@@ -17,7 +17,7 @@ sub init {
my ($self) = @_;
$self->conf->{remoteCookieName} ||= $self->conf->{cookieName};
$self->conf->{proxySessionService} ||=
$self->conf->{proxyAuthService} . '/mysession';
$self->conf->{proxyAuthService} . '/session/my';
$self->conf->{proxySessionService} =~ s#/*$##;
$self->ua( Lemonldap::NG::Common::UserAgent->new( $self->conf ) );
$self->ua->default_header( Accept => 'application/json' );
......
......@@ -10,9 +10,9 @@
# * DELETE /sessions/<type>/<session-id> : delete a session
#
# - Sessions for connected users (if restSessionServer is on):
# * GET /mysession/<type> : get session datas
# * GET /mysession/<type>/key : get session key
# * DELETE /mysession : ask for logout
# * GET /session/my/<type> : get session datas
# * GET /session/my/<type>/key : get session key
# * DELETE /session/my : ask for logout
#
# - Authentication
# * POST /sessions/<type>/<session-id>?auth : authenticate with a fixed
......@@ -34,7 +34,9 @@
# * GET /mysession/?authorizationfor=<base64-encoded-url>: ask if url is
# authorizated
# * PUT /mysession/<type> : update some
# persistent datas
# persistent data
# (restricted)
# * DELETE /mysession/<type>/key : delete key in data
# (restricted)
#
# There is no conflict with SOAP server, they can be used together
......@@ -148,11 +150,11 @@ sub init {
sessions => { ':sessionType' => 'delSession' },
['DELETE']
);
$self->addAuthRoute(
mysession => { ':sessionType' => 'getMyKey' },
session => { my => { ':sessionType' => 'getMyKey' } },
[ 'GET', 'POST' ]
);
$self->addAuthRoute( mysession => 'delMySession', ['DELETE'] );
}
# Methods always available
......@@ -160,6 +162,10 @@ sub init {
mysession => { '*' => 'mysession' },
[ 'GET', 'POST' ]
);
$self->addAuthRoute(
mysession => { ':key' => 'delKeyInMySession', '*' => 'delMySession' },
['DELETE']
);
$self->addAuthRoute(
mysession => { ':sessionType' => 'updateMySession' },
['PUT']
......@@ -357,8 +363,17 @@ sub updateMySession {
if ( my $token = $req->param('token') ) {
if ( $self->ott->getToken($token) ) {
if ( $req->param('sessionType') eq 'persistent' ) {
foreach my $key (qw(_appsListOrder _oidcConnectedRP)) {
my $v = $req->param($key);
foreach my $key ( $self->conf->{mySessionAuthorizedRWKeys} ) {
my $v;
if ( $key =~ /\*/ ) {
$key =~ s/\*/\.\*/g;
if ( my ($k) = grep( /$key/, $req->params ) ) {
$v = $req->param($k);
}
}
else {
$v = $req->param($key);
}
if ( defined $v ) {
$res++;
push @$mKeys, $key;
......@@ -382,4 +397,43 @@ sub updateMySession {
{ result => 1, count => $res, modifiedKeys => $mKeys } );
}
sub delKeyInMySession {
my ( $self, $req ) = @_;
my $res = 0;
my $mKeys = [];
my $dkey = $req->param('key');
if ( my $token = $req->param('token') ) {
if ( $self->ott->getToken($token) ) {
if ( $req->param('sessionType') eq 'persistent' ) {
foreach my $key ( $self->conf->{mySessionAuthorizedRWKeys} ) {
if ( $key =~ /\*/ ) {
$key =~ s/\*/\.\*/g;
if ( $dkey =~ /$key/ ) {
$res++;
}
}
elsif ( $dkey eq $key ) {
$res++;
}
}
if ($res) {
$self->p->updatePersistentSession( $req,
{ $dkey => undef } );
}
}
}
else {
$self->logger->error('Update session request with invalid token');
}
}
else {
$self->logger->error('Update session request without token');
}
unless ($res) {
return $self->p->sendError( $req, 'Modification refused', 403 );
}
return $self->p->sendJSONresponse( $req,
{ result => 1, count => $res, modifiedKeys => $dkey } );
}
1;
......@@ -60,15 +60,27 @@ setOrder = ->
# Function used to remove an OIDC consent
removeOidcConsent = (partner) ->
r = new RegExp "\b#{partner}\b,?", 'g'
datas['oidcConsents'] = datas['oidcConsents'].replace(r,'').replace(/,$/,'')
setKey '_oidcConnectedRP', datas['oidcConsents']
#r = new RegExp "\b#{partner}\b,?", 'g'
#datas['oidcConsents'] = datas['oidcConsents'].replace(r,'').replace(/,$/,'')
#setKey '_oidcConnectedRP', datas['oidcConsents']
# # Success
# , () ->
# $("[partner='#{partner}']").hide()
# # Error
# , (j,s,e) ->
# alert "#{s} #{e}"
e = (j,s,e) ->
alert "#{s} #{e}"
delKey "_oidc_consent_time_#{partner}"
# Success
, () ->
$("[partner='#{partner}']").hide()
# Error
, (j,s,e) ->
alert "#{s} #{e}"
delKey "_oidc_consent_scope_#{partner}"
# Success
, () ->
$("[partner='#{partner}']").hide()
# Error
, e
, e
# Function used by setOrder() and removeOidcConsent() to push new values
# For security reason, modification is rejected unless a valid token is given
......@@ -92,6 +104,21 @@ setKey = (key,val,success,error) ->
success: success
error: error
delKey = (key,success,error) ->
$.ajax
type: "GET"
url: datas['scriptname'] + '/mysession/?gettoken'
dataType: 'json'
error: error
# On success, value is set
success: (data) ->
$.ajax
type: "DELETE"
url: "#{datas['scriptname']}/mysession/persistent/#{key}?token=#{data.token}"
dataType: 'json'
success: success
error: error
# function that restores the list order from session
restoreOrder = ->
list = $(setSelector)
......
......@@ -5,7 +5,7 @@ LemonLDAP::NG Portal jQuery scripts
*/
(function() {
var datas, getCookie, getValues, isHiddenFormValueSet, ping, removeOidcConsent, restoreOrder, setCookie, setKey, setOrder, setSelector, translate, translatePage, translationFields,
var datas, delKey, getCookie, getValues, isHiddenFormValueSet, ping, removeOidcConsent, restoreOrder, setCookie, setKey, setOrder, setSelector, translate, translatePage, translationFields,
indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
translationFields = {};
......@@ -75,14 +75,15 @@ LemonLDAP::NG Portal jQuery scripts
};
removeOidcConsent = function(partner) {
var r;
r = new RegExp("\b" + partner + "\b,?", 'g');
datas['oidcConsents'] = datas['oidcConsents'].replace(r, '').replace(/,$/, '');
return setKey('_oidcConnectedRP', datas['oidcConsents'], function() {
return $("[partner='" + partner + "']").hide();
}, function(j, s, e) {
var e;
e = function(j, s, e) {
return alert(s + " " + e);
});
};
return delKey("_oidc_consent_time_" + partner, function() {
return delKey("_oidc_consent_scope_" + partner, function() {
return $("[partner='" + partner + "']").hide();
}, e);
}, e);
};
setKey = function(key, val, success, error) {
......@@ -109,6 +110,24 @@ LemonLDAP::NG Portal jQuery scripts
});
};
delKey = function(key, success, error) {
return $.ajax({
type: "GET",
url: datas['scriptname'] + '/mysession/?gettoken',
dataType: 'json',
error: error,
success: function(data) {
return $.ajax({
type: "DELETE",
url: datas['scriptname'] + "/mysession/persistent/" + key + "?token=" + data.token,
dataType: 'json',
success: success,
error: error
});
}
});
};
restoreOrder = function() {
var IDs, child, i, item, itemID, items, l, len, len1, list, rebuild, savedOrd, v;
list = $(setSelector);
......
(function(){var datas,getCookie,getValues,isHiddenFormValueSet,ping,removeOidcConsent,restoreOrder,setCookie,setKey,setOrder,setSelector,translate,translatePage,translationFields,indexOf=[].indexOf||function(item){for(var i=0,l=this.length;i<l;i++){if(i in this&&this[i]===item)return i}return-1};translationFields={};translatePage=function(lang){return $.getJSON(window.staticPrefix+"languages/"+lang+".json",function(data){translationFields=data;$("[trspan]").each(function(){var args,i,len,txt,v;args=$(this).attr("trspan").split(",");txt=translate(args.shift());for(i=0,len=args.length;i<len;i++){v=args[i];txt=txt.replace(/%[sd]/,v)}return $(this).text(txt)});$("[trmsg]").each(function(){return $(this).text(translate("PE"+$(this).attr("trmsg")))});$("[trplaceholder]").each(function(){return $(this).attr("placeholder",translate($(this).attr("trplaceholder")))});return $("[localtime]").each(function(){var d;d=new Date($(this).attr("localtime")*1e3);return $(this).text(d.toLocaleString())})})};translate=function(str){if(translationFields[str]){return translationFields[str]}else{return str}};window.translate=translate;getValues=function(){var values;values={};$("script[type='application/init']").each(function(){var e,k,results,tmp;try{tmp=JSON.parse($(this).text());results=[];for(k in tmp){results.push(values[k]=tmp[k])}return results}catch(error1){e=error1;console.log("Parsing error",e);return console.log("JSON",$(this).text())}});return values};setSelector="#appslist";setOrder=function(){return setKey("_appsListOrder",$(setSelector).sortable("toArray").join())};removeOidcConsent=function(partner){var r;r=new RegExp("\b"+partner+"\b,?","g");datas["oidcConsents"]=datas["oidcConsents"].replace(r,"").replace(/,$/,"");return setKey("_oidcConnectedRP",datas["oidcConsents"],function(){return $("[partner='"+partner+"']").hide()},function(j,s,e){return alert(s+" "+e)})};setKey=function(key,val,success,error){return $.ajax({type:"GET",url:datas["scriptname"]+"/mysession/?gettoken",dataType:"json",error:error,success:function(data){var d;d={token:data.token};d[key]=val;return $.ajax({type:"PUT",url:datas["scriptname"]+"/mysession/persistent",dataType:"json",data:d,success:success,error:error})}})};restoreOrder=function(){var IDs,child,i,item,itemID,items,l,len,len1,list,rebuild,savedOrd,v;list=$(setSelector);if(!(list!=null&&datas["appslistorder"])){return null}IDs=datas["appslistorder"].split(",");items=list.sortable("toArray");rebuild=[];for(i=0,len=items.length;i<len;i++){v=items[i];rebuild[v]=v}for(l=0,len1=IDs.length;l<len1;l++){itemID=IDs[l];if(rebuild[itemID]){item=rebuild[itemID];child=$(setSelector+".ui-sortable").children("#"+item);savedOrd=$(setSelector+".ui-sortable").children("#"+itemID);child.remove();$(setSelector+".ui-sortable").filter(":first").append(savedOrd)}}return 1};isHiddenFormValueSet=function(option){return $("#lmhidden_"+option).length};ping=function(){return $.ajax({type:"POST",url:datas["scriptname"],data:{ping:1},dataType:"json",success:function(data){if(data.result!=null&&data.result===1){return setTimeout(ping,datas["pingInterval"])}else{return location.reload(true)}},error:function(j,t,e){return location.reload(true)}})};window.ping=ping;getCookie=function(cname){var c,ca,i,len,name,re;name=cname+"=";ca=decodeURIComponent(document.cookie).split(";");re=new RegExp("^ *"+cname+"=");for(i=0,len=ca.length;i<len;i++){c=ca[i];if(c.match(re)){c=c.replace(re,"");return c}}return""};setCookie=function(name,value,exdays){var d;d=new Date;d.setTime(d.getTime()+exdays*864e5);return document.cookie=name+"="+value+"; expires="+d.toUTCString()+"; path=/"};datas={};$(document).ready(function(){var action,al,authMenuTabs,back_url,i,l,lang,langdiv,langs,langs2,len,len1,len2,link,m,menuIndex,menuTabs,method,nl,nlangs,ref,ref1;datas=getValues();window.datas=datas;if(datas["antiframe"]&&top!==self){top.location.href=location.href}$("#appslist").sortable({axis:"y",cursor:"move",opacity:.5,revert:true,items:"> div.category",update:function(){return setOrder()}});restoreOrder();$("div.message").fadeIn("slow");$("input[name=timezone]").val(-((new Date).getTimezoneOffset()/60));menuTabs=$("#menu").tabs({active:0});menuIndex=$('#menu a[href="#'+datas["displaytab"]+'"]').parent().index();if(menuIndex<0){menuIndex=0}menuTabs.tabs("option","active",menuIndex);authMenuTabs=$("#authMenu").tabs({active:0});if(datas["choicetab"]){authMenuTabs.tabs("option","active",$('#authMenu a[href="#'+datas["choicetab"]+'"]').parent().index())}if(datas["login"]){$("input[type=password]:first").focus()}else{$("input[type!=hidden]:first").focus()}if(datas["newwindow"]){$("#appslist a").attr("target","_blank")}if($("p.removeOther").length){action=$("form.login").attr("action");method=$("form.login").attr("method");back_url="";if(action.indexOf("?")!==-1){action.substring(0,action.indexOf("?"))+"?"}else{back_url=action+"?"}$("form.login input[type=hidden]").each(function(index){return back_url+="&"+$(this).attr("name")+"="+$(this).val()});link=$("p.removeOther a").attr("href")+"&method="+method+"&url="+btoa(back_url);$("p.removeOther a").attr("href",link)}lang=getCookie("llnglanguage");if(!lang){if(navigator){langs=[];langs2=[];nlangs=[navigator.language];if(navigator.languages){nlangs=navigator.languages}ref=window.availableLanguages;for(i=0,len=ref.length;i<len;i++){al=ref[i];langdiv+='<img class="langicon" src="'+window.staticPrefix+"common/"+al+'.png" title="'+al+'" alt="['+al+']"> ';for(l=0,len1=nlangs.length;l<len1;l++){nl=nlangs[l];if(al===nl){langs.push(al)}else if(al.substring(0,1)===nl.substring(0,1)){langs2.push(al)}}}lang=langs[0]?langs[0]:langs2[0]?langs2[0]:window.availableLanguages[0]}else{lang=window.availableLanguages[0]}}else if(indexOf.call(window.availableLanguages,lang)<0){lang=window.availableLanguages[0]}setCookie("llnglanguage",lang);translatePage(lang);langdiv="";ref1=window.availableLanguages;for(m=0,len2=ref1.length;m<len2;m++){al=ref1[m];langdiv+='<img class="langicon" src="'+window.staticPrefix+"common/"+al+'.png" title="'+al+'" alt="['+al+']"> '}$("#languages").html(langdiv);$(".langicon").on("click",function(){lang=$(this).attr("title");setCookie("llnglanguage",lang);return translatePage(lang)});if(datas["pingInterval"]&&datas["pingInterval"]>0){window.setTimeout(ping,datas["pingInterval"])}$(".localeDate").each(function(){var s;s=new Date($(this).attr("val")*1e3);return $(this).text(s.toLocaleString())});return $(".oidcConsent").on("click",function(){return removeOidcConsent($(this).attr("partner"))})})}).call(this);
(function(){var datas,delKey,getCookie,getValues,isHiddenFormValueSet,ping,removeOidcConsent,restoreOrder,setCookie,setKey,setOrder,setSelector,translate,translatePage,translationFields,indexOf=[].indexOf||function(item){for(var i=0,l=this.length;i<l;i++){if(i in this&&this[i]===item)return i}return-1};translationFields={};translatePage=function(lang){return $.getJSON(window.staticPrefix+"languages/"+lang+".json",function(data){translationFields=data;$("[trspan]").each(function(){var args,i,len,txt,v;args=$(this).attr("trspan").split(",");txt=translate(args.shift());for(i=0,len=args.length;i<len;i++){v=args[i];txt=txt.replace(/%[sd]/,v)}return $(this).text(txt)});$("[trmsg]").each(function(){return $(this).text(translate("PE"+$(this).attr("trmsg")))});$("[trplaceholder]").each(function(){return $(this).attr("placeholder",translate($(this).attr("trplaceholder")))});return $("[localtime]").each(function(){var d;d=new Date($(this).attr("localtime")*1e3);return $(this).text(d.toLocaleString())})})};translate=function(str){if(translationFields[str]){return translationFields[str]}else{return str}};window.translate=translate;getValues=function(){var values;values={};$("script[type='application/init']").each(function(){var e,k,results,tmp;try{tmp=JSON.parse($(this).text());results=[];for(k in tmp){results.push(values[k]=tmp[k])}return results}catch(error1){e=error1;console.log("Parsing error",e);return console.log("JSON",$(this).text())}});return values};setSelector="#appslist";setOrder=function(){return setKey("_appsListOrder",$(setSelector).sortable("toArray").join())};removeOidcConsent=function(partner){var e;e=function(j,s,e){return alert(s+" "+e)};return delKey("_oidc_consent_time_"+partner,function(){return delKey("_oidc_consent_scope_"+partner,function(){return $("[partner='"+partner+"']").hide()},e)},e)};setKey=function(key,val,success,error){return $.ajax({type:"GET",url:datas["scriptname"]+"/mysession/?gettoken",dataType:"json",error:error,success:function(data){var d;d={token:data.token};d[key]=val;return $.ajax({type:"PUT",url:datas["scriptname"]+"/mysession/persistent",dataType:"json",data:d,success:success,error:error})}})};delKey=function(key,success,error){return $.ajax({type:"GET",url:datas["scriptname"]+"/mysession/?gettoken",dataType:"json",error:error,success:function(data){return $.ajax({type:"DELETE",url:datas["scriptname"]+"/mysession/persistent/"+key+"?token="+data.token,dataType:"json",success:success,error:error})}})};restoreOrder=function(){var IDs,child,i,item,itemID,items,l,len,len1,list,rebuild,savedOrd,v;list=$(setSelector);if(!(list!=null&&datas["appslistorder"])){return null}IDs=datas["appslistorder"].split(",");items=list.sortable("toArray");rebuild=[];for(i=0,len=items.length;i<len;i++){v=items[i];rebuild[v]=v}for(l=0,len1=IDs.length;l<len1;l++){itemID=IDs[l];if(rebuild[itemID]){item=rebuild[itemID];child=$(setSelector+".ui-sortable").children("#"+item);savedOrd=$(setSelector+".ui-sortable").children("#"+itemID);child.remove();$(setSelector+".ui-sortable").filter(":first").append(savedOrd)}}return 1};isHiddenFormValueSet=function(option){return $("#lmhidden_"+option).length};ping=function(){return $.ajax({type:"POST",url:datas["scriptname"],data:{ping:1},dataType:"json",success:function(data){if(data.result!=null&&data.result===1){return setTimeout(ping,datas["pingInterval"])}else{return location.reload(true)}},error:function(j,t,e){return location.reload(true)}})};window.ping=ping;getCookie=function(cname){var c,ca,i,len,name,re;name=cname+"=";ca=decodeURIComponent(document.cookie).split(";");re=new RegExp("^ *"+cname+"=");for(i=0,len=ca.length;i<len;i++){c=ca[i];if(c.match(re)){c=c.replace(re,"");return c}}return""};setCookie=function(name,value,exdays){var d;d=new Date;d.setTime(d.getTime()+exdays*864e5);return document.cookie=name+"="+value+"; expires="+d.toUTCString()+"; path=/"};datas={};$(document).ready(function(){var action,al,authMenuTabs,back_url,i,l,lang,langdiv,langs,langs2,len,len1,len2,link,m,menuIndex,menuTabs,method,nl,nlangs,ref,ref1;datas=getValues();window.datas=datas;if(datas["antiframe"]&&top!==self){top.location.href=location.href}$("#appslist").sortable({axis:"y",cursor:"move",opacity:.5,revert:true,items:"> div.category",update:function(){return setOrder()}});restoreOrder();$("div.message").fadeIn("slow");$("input[name=timezone]").val(-((new Date).getTimezoneOffset()/60));menuTabs=$("#menu").tabs({active:0});menuIndex=$('#menu a[href="#'+datas["displaytab"]+'"]').parent().index();if(menuIndex<0){menuIndex=0}menuTabs.tabs("option","active",menuIndex);authMenuTabs=$("#authMenu").tabs({active:0});if(datas["choicetab"]){authMenuTabs.tabs("option","active",$('#authMenu a[href="#'+datas["choicetab"]+'"]').parent().index())}if(datas["login"]){$("input[type=password]:first").focus()}else{$("input[type!=hidden]:first").focus()}if(datas["newwindow"]){$("#appslist a").attr("target","_blank")}if($("p.removeOther").length){action=$("form.login").attr("action");method=$("form.login").attr("method");back_url="";if(action.indexOf("?")!==-1){action.substring(0,action.indexOf("?"))+"?"}else{back_url=action+"?"}$("form.login input[type=hidden]").each(function(index){return back_url+="&"+$(this).attr("name")+"="+$(this).val()});link=$("p.removeOther a").attr("href")+"&method="+method+"&url="+btoa(back_url);$("p.removeOther a").attr("href",link)}lang=getCookie("llnglanguage");if(!lang){if(navigator){langs=[];langs2=[];nlangs=[navigator.language];if(navigator.languages){nlangs=navigator.languages}ref=window.availableLanguages;for(i=0,len=ref.length;i<len;i++){al=ref[i];langdiv+='<img class="langicon" src="'+window.staticPrefix+"common/"+al+'.png" title="'+al+'" alt="['+al+']"> ';for(l=0,len1=nlangs.length;l<len1;l++){nl=nlangs[l];if(al===nl){langs.push(al)}else if(al.substring(0,1)===nl.substring(0,1)){langs2.push(al)}}}lang=langs[0]?langs[0]:langs2[0]?langs2[0]:window.availableLanguages[0]}else{lang=window.availableLanguages[0]}}else if(indexOf.call(window.availableLanguages,lang)<0){lang=window.availableLanguages[0]}setCookie("llnglanguage",lang);translatePage(lang);langdiv="";ref1=window.availableLanguages;for(m=0,len2=ref1.length;m<len2;m++){al=ref1[m];langdiv+='<img class="langicon" src="'+window.staticPrefix+"common/"+al+'.png" title="'+al+'" alt="['+al+']"> '}$("#languages").html(langdiv);$(".langicon").on("click",function(){lang=$(this).attr("title");setCookie("llnglanguage",lang);return translatePage(lang)});if(datas["pingInterval"]&&datas["pingInterval"]>0){window.setTimeout(ping,datas["pingInterval"])}$(".localeDate").each(function(){var s;s=new Date($(this).attr("val")*1e3);return $(this).text(s.toLocaleString())});return $(".oidcConsent").on("click",function(){return removeOidcConsent($(this).attr("partner"))})})}).call(this);
Markdown is supported
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