1
0
قرینه از https://github.com/matomo-org/matomo.git synced 2025-08-22 06:57:53 +00:00
Files
matomo/plugins/Overlay/templates/index_noframe.twig
Tim-Hinnerk Heuer 397badec45 add token_auth to overlay requests where necessary (#17851)
* add token_auth to overlay requests where necessary #17640

* ensure all links on overlay page work as expected both, with token_auth and when logged in #17640

* DRY force_api_session=1 and token_auth parameters in broadcast.js and correct in other code for convenience #17640

* polish logic for overlay with token_auth and change minimal logic in client side while validating token_auth in View::shouldPropagateTokenAuthInAjaxRequests() #17640

* use 'string' as string parameter #17640

* simplify token_auth check #17640

* revert git submodule to 4.x-dev version #17640

* return $tokenAuth string (truthy) only, simplify condition, ensure & is prepended to token_auth url param #17640

* revert submodule change

* Update core/View.php

Co-authored-by: Stefan Giehl <stefan@matomo.org>

Co-authored-by: sgiehl <stefan@matomo.org>
2021-08-13 10:21:57 +02:00

27 خطوط
930 B
Twig

{% extends 'dashboard.twig' %}
{% block content %}
<h1>{{ 'Overlay_Overlay'|translate }}</h1>
<div id="overlayNoFrame">
<script type="text/javascript">
var newLocation = 'index.php?module=Overlay&action=startOverlaySession&idSite={{ idSite }}&period={{ period }}&date={{ date }}&segment={{ segment }}';
if (piwik.shouldPropagateTokenAuth) {
if (!piwik.broadcast.isWidgetizeRequestWithoutSession()) {
newLocation += '&force_api_session=1';
}
newLocation += '&token_auth=' + piwik.token_auth;
}
var locationParts = window.location.href.split('#');
if (locationParts.length > 1) {
var url = broadcast.getParamValue('l', locationParts[1]);
url = Overlay_Helper.decodeFrameUrl(url);
newLocation += '#' + url;
}
window.location.href = newLocation;
</script>
</div>
{% endblock %}