From 731ab39b8ef05a4e84b72fb4243d59c9f6dd48cb Mon Sep 17 00:00:00 2001 From: Thomas Lenz Date: Tue, 23 Jan 2018 14:23:39 +0100 Subject: update mostly all GUI forms to split JavaScript and CSS from html code to support "Content Security-Policy" http headers --- .../conf/moa-id/SLTemplates/template_handyBKU.html | 9 ++---- .../conf/moa-id/SLTemplates/template_localBKU.html | 9 ++---- .../conf/moa-id/SLTemplates/template_thirdBKU.html | 9 ++---- .../deploy/conf/moa-id/htmlTemplates/autocommit.js | 5 ++++ .../deploy/conf/moa-id/htmlTemplates/basic.css | 4 +++ .../conf/moa-id/htmlTemplates/bkudetected.js | 3 ++ .../conf/moa-id/htmlTemplates/bkudetection.js | 6 ++++ .../moa-id/htmlTemplates/javascript_tempalte.js | 20 ++++++++++--- .../conf/moa-id/htmlTemplates/loginFormFull.html | 11 ++++--- .../htmlTemplates/pvp_postbinding_template.html | 18 +++-------- .../deploy/conf/moa-id/htmlTemplates/redirect.js | 5 ++++ .../conf/moa-id/htmlTemplates/redirectForm.html | 6 ++-- .../data/deploy/conf/moa-id/htmlTemplates/slo.js | 20 +++++++++++++ .../conf/moa-id/htmlTemplates/slo_template.html | 35 +++++----------------- 14 files changed, 84 insertions(+), 76 deletions(-) create mode 100644 id/server/data/deploy/conf/moa-id/htmlTemplates/autocommit.js create mode 100644 id/server/data/deploy/conf/moa-id/htmlTemplates/basic.css create mode 100644 id/server/data/deploy/conf/moa-id/htmlTemplates/bkudetected.js create mode 100644 id/server/data/deploy/conf/moa-id/htmlTemplates/bkudetection.js create mode 100644 id/server/data/deploy/conf/moa-id/htmlTemplates/redirect.js create mode 100644 id/server/data/deploy/conf/moa-id/htmlTemplates/slo.js (limited to 'id/server/data/deploy') diff --git a/id/server/data/deploy/conf/moa-id/SLTemplates/template_handyBKU.html b/id/server/data/deploy/conf/moa-id/SLTemplates/template_handyBKU.html index 5a335f9a1..e62921efa 100644 --- a/id/server/data/deploy/conf/moa-id/SLTemplates/template_handyBKU.html +++ b/id/server/data/deploy/conf/moa-id/SLTemplates/template_handyBKU.html @@ -3,14 +3,9 @@ - + - +
Falls Sie nicht automatisch weitergeleitet werden klicken Sie bitte hier: diff --git a/id/server/data/deploy/conf/moa-id/SLTemplates/template_localBKU.html b/id/server/data/deploy/conf/moa-id/SLTemplates/template_localBKU.html index 329fe6f8d..80d33ff85 100644 --- a/id/server/data/deploy/conf/moa-id/SLTemplates/template_localBKU.html +++ b/id/server/data/deploy/conf/moa-id/SLTemplates/template_localBKU.html @@ -3,14 +3,9 @@ - + - + Falls Sie nicht automatisch weitergeleitet werden klicken Sie bitte hier: diff --git a/id/server/data/deploy/conf/moa-id/SLTemplates/template_thirdBKU.html b/id/server/data/deploy/conf/moa-id/SLTemplates/template_thirdBKU.html index 52abf83fb..928c9f17b 100644 --- a/id/server/data/deploy/conf/moa-id/SLTemplates/template_thirdBKU.html +++ b/id/server/data/deploy/conf/moa-id/SLTemplates/template_thirdBKU.html @@ -3,14 +3,9 @@ - + - + Falls Sie nicht automatisch weitergeleitet werden klicken Sie bitte hier: diff --git a/id/server/data/deploy/conf/moa-id/htmlTemplates/autocommit.js b/id/server/data/deploy/conf/moa-id/htmlTemplates/autocommit.js new file mode 100644 index 000000000..d21a5651d --- /dev/null +++ b/id/server/data/deploy/conf/moa-id/htmlTemplates/autocommit.js @@ -0,0 +1,5 @@ +function autoCommmit() { + document.forms[0].submit(); +} + +document.addEventListener('DOMContentLoaded', autoCommmit); \ No newline at end of file diff --git a/id/server/data/deploy/conf/moa-id/htmlTemplates/basic.css b/id/server/data/deploy/conf/moa-id/htmlTemplates/basic.css new file mode 100644 index 000000000..4bec163a9 --- /dev/null +++ b/id/server/data/deploy/conf/moa-id/htmlTemplates/basic.css @@ -0,0 +1,4 @@ +@charset "utf-8"; + .bgTrans { + background-color:transparent + } \ No newline at end of file diff --git a/id/server/data/deploy/conf/moa-id/htmlTemplates/bkudetected.js b/id/server/data/deploy/conf/moa-id/htmlTemplates/bkudetected.js new file mode 100644 index 000000000..7e4d2b12f --- /dev/null +++ b/id/server/data/deploy/conf/moa-id/htmlTemplates/bkudetected.js @@ -0,0 +1,3 @@ +document.addEventListener('DOMContentLoaded', function () { + parent.setBKUAvailable(true); +}); \ No newline at end of file diff --git a/id/server/data/deploy/conf/moa-id/htmlTemplates/bkudetection.js b/id/server/data/deploy/conf/moa-id/htmlTemplates/bkudetection.js new file mode 100644 index 000000000..b991beb60 --- /dev/null +++ b/id/server/data/deploy/conf/moa-id/htmlTemplates/bkudetection.js @@ -0,0 +1,6 @@ +function autoCommmit() { + parent.setBKUAvailable(false); + document.forms[0].submit(); +} + +document.addEventListener('DOMContentLoaded', autoCommmit); \ No newline at end of file diff --git a/id/server/data/deploy/conf/moa-id/htmlTemplates/javascript_tempalte.js b/id/server/data/deploy/conf/moa-id/htmlTemplates/javascript_tempalte.js index 0c1f6a561..cc4714006 100644 --- a/id/server/data/deploy/conf/moa-id/htmlTemplates/javascript_tempalte.js +++ b/id/server/data/deploy/conf/moa-id/htmlTemplates/javascript_tempalte.js @@ -126,13 +126,12 @@ function isIE() { } } } - function onChangeChecks() { + function onChangeChecks() { if (self.innerWidth < 650) { document.getElementById("moaidform").setAttribute("target","_parent"); } else { document.getElementById("moaidform").removeAttribute("target"); } - } function checkIfBrowserSupportsJava(){ @@ -234,8 +233,21 @@ function isIE() { console.log("Local BKU NOT available") } } catch(e) {console.log("Local BKU detection is not possible! Msg: "+e);} - - } + + } + function setUseMandateFlag(e) { + /*document.getElementById("mandateCheckBox").setAttribute("aria-checked", document.getElementById("mandateCheckBox").checked);*/ + e.setAttribute("aria-checked", e.checked); + } + + document.addEventListener('resize', onChangeChecks); + document.addEventListener('DOMContentLoaded', function () { + document.querySelector('#mandateCheckBox').addEventListener('click', setUseMandateFlag); + document.querySelector('#moaidform>input[type=submit]').addEventListener('click', setMandateSelection); + document.querySelector('#bkuhandy>input[type=button]').addEventListener('click', bkuHandyClicked); + document.querySelector('#stork button[type=button]').addEventListener('click', storkClicked); + onChangeChecks(); + }); /* function setSSOSelection() { document.getElementById("useSSO").value = "false"; diff --git a/id/server/data/deploy/conf/moa-id/htmlTemplates/loginFormFull.html b/id/server/data/deploy/conf/moa-id/htmlTemplates/loginFormFull.html index 1f365c104..5a4ca66b7 100644 --- a/id/server/data/deploy/conf/moa-id/htmlTemplates/loginFormFull.html +++ b/id/server/data/deploy/conf/moa-id/htmlTemplates/loginFormFull.html @@ -13,7 +13,7 @@ Anmeldung mittels Bürgerkarte oder Handy-Signatur - +

Anmeldung an: $OAName

@@ -26,8 +26,7 @@
+ id="mandateCheckBox" class="verticalcenter" role="checkbox" $MANDATECHECKED> - -
#if($RelayState) #end diff --git a/id/server/data/deploy/conf/moa-id/htmlTemplates/redirect.js b/id/server/data/deploy/conf/moa-id/htmlTemplates/redirect.js new file mode 100644 index 000000000..1bba3d5e0 --- /dev/null +++ b/id/server/data/deploy/conf/moa-id/htmlTemplates/redirect.js @@ -0,0 +1,5 @@ +function autoCommmit() { + document.getElementById('link').click(); +} + +document.addEventListener('DOMContentLoaded', autoCommmit); \ No newline at end of file diff --git a/id/server/data/deploy/conf/moa-id/htmlTemplates/redirectForm.html b/id/server/data/deploy/conf/moa-id/htmlTemplates/redirectForm.html index 7b064e22a..a27a7ba10 100644 --- a/id/server/data/deploy/conf/moa-id/htmlTemplates/redirectForm.html +++ b/id/server/data/deploy/conf/moa-id/htmlTemplates/redirectForm.html @@ -1,12 +1,10 @@ - + - - +
diff --git a/id/server/data/deploy/conf/moa-id/htmlTemplates/slo.js b/id/server/data/deploy/conf/moa-id/htmlTemplates/slo.js new file mode 100644 index 000000000..c85837c8a --- /dev/null +++ b/id/server/data/deploy/conf/moa-id/htmlTemplates/slo.js @@ -0,0 +1,20 @@ +function sloTimeOut() { + document.getElementById("timeoutURL").click(); +} +function RestartAfterDelay() { + var eDate = null; + var MilliSekZeit = 0; + var SysDatumJetzt = new Date(); + var SysDatumJetztMilli = SysDatumJetzt.getTime(); + + do { + eDate = new Date(); + MilliSekZeit = eDate.getTime(); + } while ((MilliSekZeit-SysDatumJetztMilli) < $timeout); + + sloTimeOut(); +} + +document.addEventListener('DOMContentLoaded', function () { + setTimeout(sloTimeOut, 30000); +}); \ No newline at end of file diff --git a/id/server/data/deploy/conf/moa-id/htmlTemplates/slo_template.html b/id/server/data/deploy/conf/moa-id/htmlTemplates/slo_template.html index 4d9277152..4f86f9f14 100644 --- a/id/server/data/deploy/conf/moa-id/htmlTemplates/slo_template.html +++ b/id/server/data/deploy/conf/moa-id/htmlTemplates/slo_template.html @@ -6,37 +6,12 @@ #if($timeoutURL) - + #end Single LogOut Vorgang ... - -#if($timeoutURL) - -#else - -#end +
#end @@ -90,5 +70,6 @@ #foreach( $el in $redirectURLs ) #end + \ No newline at end of file -- cgit v1.2.3