Skip to content

Commit

Permalink
Use postMessage to alert window.topon framed login (#1206)
Browse files Browse the repository at this point in the history
Use `postMessage` to alert `window.top`on framed login
  • Loading branch information
plessbd authored Jan 16, 2020
2 parents 0710b9b + 065f423 commit b28197e
Showing 1 changed file with 24 additions and 3 deletions.
27 changes: 24 additions & 3 deletions html/gui/general/login.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,18 @@
</style>
<script type="text/javascript">
function loadPortal() {
setTimeout(function(){
parent.location.href = '/index.php' + document.location.hash;
}, 1500);
try{
var href = window.top.location.href;
setTimeout(function(){
parent.location.href = '/index.php' + document.location.hash;
}, 1500);
}
catch(exception){
window.top.postMessage({
application:'xdmod',
action: 'loginComplete'
},'*');
}
}

function contactAdmin() {
Expand All @@ -73,6 +82,18 @@ function contactAdmin() {
<br>
<a href="javascript:contactAdmin()">Contact a system administrator.</a>
</p>
<script>
try {
var href = window.top.location.href;
}
catch(exception){
window.top.postMessage({
application:'xdmod',
action: 'error',
info: <?php echo json_encode($message); ?>
},'*');
}
</script>
</body>
</html>
<?php
Expand Down

0 comments on commit b28197e

Please sign in to comment.