Commit f2cf6b2b authored by Xavier Guimard's avatar Xavier Guimard

CSP (#1138)

parent 3db58b34
* login history
* Create "csp" in doc
* Test for Zero
* updateStatus( Main, SOAP server )
......
......@@ -2,7 +2,7 @@ values = {}
$(document).ready ->
$("script[type='application/init']").each ->
try
tmp = JSON.parse $(this).text
tmp = JSON.parse $(this).text()
for k of tmp
values[k] = tmp[k]
catch e
......
......@@ -22,11 +22,12 @@ getValues = () ->
values = {}
$("script[type='application/init']").each ->
try
tmp = JSON.parse $(this).text
tmp = JSON.parse $(this).text()
for k of tmp
values[k] = tmp[k]
catch e
console.log 'Parsing error', e
console.log 'JSON', $(this).text()
values
# Set default values
......
......@@ -8,7 +8,7 @@
$("script[type='application/init']").each(function() {
var e, error, k, results, tmp;
try {
tmp = JSON.parse($(this).text);
tmp = JSON.parse($(this).text());
results = [];
for (k in tmp) {
results.push(values[k] = tmp[k]);
......
(function(){var a;a={};$(document).ready(function(){$("script[type='application/init']").each(function(){var g,c,b,f,d;try{d=JSON.parse($(this).text);f=[];for(b in d){f.push(a[b]=d[b])}return f}catch(c){g=c;return console.log("Parsing error",g)}});return window.addEventListener("message",receiveMessage,false)});receiveMessage(function(h){var i,f,c,g,b,d;f=h.data;i=decodeURIComponent(f.split(" ")[0]);g=decodeURIComponent(f.split(" ")[1]);c=decodeURIComponent(g.split(".")[1]);b=hash.toString(CryptoJS.enc.Base64)+"."+c;if(g===b){d="unchanged"}else{d="changed"}return h.source.postMessage(d,h.origin)})}).call(this);
\ No newline at end of file
(function(){var a;a={};$(document).ready(function(){$("script[type='application/init']").each(function(){var g,c,b,f,d;try{d=JSON.parse($(this).text());f=[];for(b in d){f.push(a[b]=d[b])}return f}catch(c){g=c;return console.log("Parsing error",g)}});return window.addEventListener("message",receiveMessage,false)});receiveMessage(function(h){var i,f,c,g,b,d;f=h.data;i=decodeURIComponent(f.split(" ")[0]);g=decodeURIComponent(f.split(" ")[1]);c=decodeURIComponent(g.split(".")[1]);b=hash.toString(CryptoJS.enc.Base64)+"."+c;if(g===b){d="unchanged"}else{d="changed"}return h.source.postMessage(d,h.origin)})}).call(this);
\ No newline at end of file
......@@ -36,7 +36,7 @@ LemonLDAP::NG Portal jQuery scripts
$("script[type='application/init']").each(function() {
var e, error, k, results, tmp;
try {
tmp = JSON.parse($(this).text);
tmp = JSON.parse($(this).text());
results = [];
for (k in tmp) {
results.push(values[k] = tmp[k]);
......@@ -44,7 +44,8 @@ LemonLDAP::NG Portal jQuery scripts
return results;
} catch (error) {
e = error;
return console.log('Parsing error', e);
console.log('Parsing error', e);
return console.log('JSON', $(this).text());
}
});
return values;
......@@ -105,7 +106,8 @@ LemonLDAP::NG Portal jQuery scripts
if (data.auth) {
return setTimeout(ping, datas['pingInterval']);
} else {
return location.reload(true);
console.log(data);
//return location.reload(true);
}
}
});
......
(function(){var e,i,d,a,j,h,f,b,k,c,g=[].indexOf||function(o){for(var n=0,m=this.length;n<m;n++){if(n in this&&this[n]===o){return n}}return -1};c={};k=function(l){return $.getJSON(window.staticPrefix+"languages/"+l+".json",function(m){c=m;$("[trspan]").each(function(){return $(this).text(b($(this).attr("trspan")))});return $("[trmsg]").each(function(){return $(this).text(b("PE"+($(this).attr("trmsg"))))})})};b=function(l){if(c[l]){return c[l]}else{return l}};d=function(){var l;l={};$("script[type='application/init']").each(function(){var q,n,m,p,o;try{o=JSON.parse($(this).text);p=[];for(m in o){p.push(l[m]=o[m])}return p}catch(n){q=n;return console.log("Parsing error",q)}});return l};f="#appslist";i=function(){return $.ajax({type:"POST",url:e.scriptname,data:{storeAppsListOrder:$(f).sortable("toArray").join()},dataType:"json"})};h=function(){var n,m,q,y,l,u,p,r,o,t,w,s,x;t=$(f);if(!((t!=null)&&e.appslistorder)){return null}n=e.appslistorder.split(",");u=t.sortable("toArray");w=[];for(q=0,r=u.length;q<r;q++){x=u[q];w[x]=x}for(p=0,o=n.length;p<o;p++){l=n[p];if(g.call(w,l)>=0){y=w[l];m=$(f+".ui-sortable").children("#"+y);s=$(f+".ui-sortable").children("#"+l);m.remove();$(f+".ui-sortable").filter(":first").append(s)}}return 1};a=function(l){return $("#lmhidden_"+l).length};j=function(){return $.ajax({type:"POST",url:e.scriptname,data:{ping:1},dataType:"json",success:function(l){if(l.auth){return setTimeout(j,e.pingInterval)}else{return location.reload(true)}}})};window.ping=j;e={};$(document).ready(function(){var x,w,z,v,A,y,C,t,s,B,r,q,u,o,m,n,l,p;e=d();window.datas=e;if(e.antiframe&&top!==self){top.location.href=location.href}$("#appslist").sortable({axis:"y",cursor:"move",opacity:0.5,revert:true,items:"> div.category",update:function(){return i()}});h();$("div.message").fadeIn("slow");$("input[name=timezone]").val(-(new Date().getTimezoneOffset()/60));o=$("#menu").tabs({active:0});u=$('#menu a[href="#'+e.displaytab+'"]').parent().index();if(u<0){u=0}o.tabs("option","active",u);z=$("#authMenu").tabs({active:0});if(e.choicetab){z.tabs("option","active",$('#authMenu a[href="#'+e.choicetab+'"]').parent().index())}if(e.login){$("input[type=password]:first").focus()}else{$("input[type!=hidden]:first").focus()}if(e.newwindow){$("#appslist a").attr("target","_blank")}if($("p.removeOther").length){x=$("form.login").attr("action");m=$("form.login").attr("method");v="";if(x.indexOf("?")!==-1){x.substring(0,x.indexOf("?"))+"?"}else{v=x+"?"}$("form.login input[type=hidden]").each(function(D){return v+="&"+$(this).attr("name")+"="+$(this).val()});q=$("p.removeOther a").attr("href")+"&method="+m+"&url="+btoa(v);$("p.removeOther a").attr("href",q)}if(navigator){t=[];s=[];l=[navigator.language];if(navigator.languages){l=navigator.languages}for(A=0,B=l.length;A<B;A++){n=l[A];p=window.availableLanguages;for(y=0,r=p.length;y<r;y++){w=p[y];if(w===n){t.push(w)}else{if(w.substring(0,1)===n.substring(0,1)){s.push(w)}}}}C=t[0]?t[0]:s[0]?s[0]:"en"}else{C="en"}if(e.pingInterval&&e.pingInterval>0){window.setTimeout(j,e.pingInterval)}return k(C)})}).call(this);
\ No newline at end of file
(function(){var e,i,d,a,j,h,f,b,k,c,g=[].indexOf||function(o){for(var n=0,m=this.length;n<m;n++){if(n in this&&this[n]===o){return n}}return -1};c={};k=function(l){return $.getJSON(window.staticPrefix+"languages/"+l+".json",function(m){c=m;$("[trspan]").each(function(){return $(this).text(b($(this).attr("trspan")))});return $("[trmsg]").each(function(){return $(this).text(b("PE"+($(this).attr("trmsg"))))})})};b=function(l){if(c[l]){return c[l]}else{return l}};d=function(){var l;l={};$("script[type='application/init']").each(function(){var q,n,m,p,o;try{o=JSON.parse($(this).text());p=[];for(m in o){p.push(l[m]=o[m])}return p}catch(n){q=n;console.log("Parsing error",q);return console.log("JSON",$(this).text())}});return l};f="#appslist";i=function(){return $.ajax({type:"POST",url:e.scriptname,data:{storeAppsListOrder:$(f).sortable("toArray").join()},dataType:"json"})};h=function(){var n,m,q,y,l,u,p,r,o,t,w,s,x;t=$(f);if(!((t!=null)&&e.appslistorder)){return null}n=e.appslistorder.split(",");u=t.sortable("toArray");w=[];for(q=0,r=u.length;q<r;q++){x=u[q];w[x]=x}for(p=0,o=n.length;p<o;p++){l=n[p];if(g.call(w,l)>=0){y=w[l];m=$(f+".ui-sortable").children("#"+y);s=$(f+".ui-sortable").children("#"+l);m.remove();$(f+".ui-sortable").filter(":first").append(s)}}return 1};a=function(l){return $("#lmhidden_"+l).length};j=function(){return $.ajax({type:"POST",url:e.scriptname,data:{ping:1},dataType:"json",success:function(l){if(l.auth){return setTimeout(j,e.pingInterval)}else{return location.reload(true)}}})};window.ping=j;e={};$(document).ready(function(){var x,w,z,v,A,y,C,t,s,B,r,q,u,o,m,n,l,p;e=d();window.datas=e;if(e.antiframe&&top!==self){top.location.href=location.href}$("#appslist").sortable({axis:"y",cursor:"move",opacity:0.5,revert:true,items:"> div.category",update:function(){return i()}});h();$("div.message").fadeIn("slow");$("input[name=timezone]").val(-(new Date().getTimezoneOffset()/60));o=$("#menu").tabs({active:0});u=$('#menu a[href="#'+e.displaytab+'"]').parent().index();if(u<0){u=0}o.tabs("option","active",u);z=$("#authMenu").tabs({active:0});if(e.choicetab){z.tabs("option","active",$('#authMenu a[href="#'+e.choicetab+'"]').parent().index())}if(e.login){$("input[type=password]:first").focus()}else{$("input[type!=hidden]:first").focus()}if(e.newwindow){$("#appslist a").attr("target","_blank")}if($("p.removeOther").length){x=$("form.login").attr("action");m=$("form.login").attr("method");v="";if(x.indexOf("?")!==-1){x.substring(0,x.indexOf("?"))+"?"}else{v=x+"?"}$("form.login input[type=hidden]").each(function(D){return v+="&"+$(this).attr("name")+"="+$(this).val()});q=$("p.removeOther a").attr("href")+"&method="+m+"&url="+btoa(v);$("p.removeOther a").attr("href",q)}if(navigator){t=[];s=[];l=[navigator.language];if(navigator.languages){l=navigator.languages}for(A=0,B=l.length;A<B;A++){n=l[A];p=window.availableLanguages;for(y=0,r=p.length;y<r;y++){w=p[y];if(w===n){t.push(w)}else{if(w.substring(0,1)===n.substring(0,1)){s.push(w)}}}}C=t[0]?t[0]:s[0]?s[0]:"en"}else{C="en"}if(e.pingInterval&&e.pingInterval>0){window.setTimeout(j,e.pingInterval)}return k(C)})}).call(this);
\ No newline at end of file
......@@ -51,12 +51,12 @@
"displaytab":"<TMPL_VAR NAME="DISPLAY_TAB">",
"choicetab":"<TMPL_VAR NAME="CHOICE_VALUE">",
"login":"<TMPL_VAR NAME="LOGIN">",
"newwindow":"<TMPL_VAR NAME="NEWWINDOW">",
"antiframe":"<TMPL_VAR NAME="ANTIFRAME">",
"newwindow":<TMPL_VAR NAME="NEWWINDOW" DEFAULT="0">,
"antiframe":<TMPL_VAR NAME="ANTIFRAME" DEFAULT="1">,
"appslistorder":"<TMPL_VAR NAME="APPSLIST_ORDER">",
"scriptname":"<TMPL_VAR NAME="SCRIPT_NAME">",
"activeTimer":"<TMPL_VAR NAME="ACTIVE_TIMER">",
"pingInterval":<TMPL_VAR NAME="PING">
"activeTimer":<TMPL_VAR NAME="ACTIVE_TIMER" DEFAULT="0">,
"pingInterval":<TMPL_VAR NAME="PING" DEFAULT="0">
}
</script>
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