Verified Commit 2bb9723d authored by Jan Wennrich's avatar Jan Wennrich 🏡
Browse files

Merge branch 'dev' into master

parents 3fdba79e 53cf912c
......@@ -114,6 +114,8 @@ define('package/quiqqer/matomo/bin/Panel', [
id = config['matomo.settings.id'],
token = config['matomo.settings.token'];
var useTokenForStatisticsDisplay = config['matomo.settings.useTokenForStatisticsDisplay'];
this.getContent()
.getElements('.quiqqer-matomo-panel-nosettings,iframe')
.destroy();
......@@ -148,25 +150,37 @@ define('package/quiqqer/matomo/bin/Panel', [
opened = 0;
}
if (!usersMatomoLogin && !usersMatomoPassword) {
if (!useTokenForStatisticsDisplay && !usersMatomoLogin && !usersMatomoPassword) {
QUI.getMessageHandler().then(function (MH) {
MH.addInformation(QUILocale.get(lg, 'panel.notice.userdata.missing'));
});
}
if (usersMatomoPassword && usersMatomoLogin && opened + 7200 < now) {
if (useTokenForStatisticsDisplay && !token) {
QUI.getMessageHandler().then(function (MH) {
MH.addInformation(QUILocale.get(lg, 'panel.notice.token.missing'));
});
}
if (!useTokenForStatisticsDisplay && usersMatomoPassword && usersMatomoLogin && opened + 7200 < now) {
frameParams.module = 'Login';
frameParams.action = 'logme';
frameParams.login = usersMatomoLogin;
frameParams.password = pass;
}
if (useTokenForStatisticsDisplay && token) {
frameParams.module = 'LoginTokenAuth';
frameParams.action = 'logme';
frameParams.token_auth = token;
}
// session storage
QUI.Storage.set('matomo-opened', now);
url = url.replace('https://', '').replace('http://', '');
var src = '//' + url + '/index.php?' + Object.toQueryString(frameParams);
var src = 'https://' + url + '/index.php?' + Object.toQueryString(frameParams);
new Element('iframe', {
src : src,
......
......@@ -25,6 +25,15 @@
<en><![CDATA[Access Token (optional)]]></en>
</locale>
<locale name="matomo.settings.useTokenForStatisticsDisplay">
<de><![CDATA[Access Token auch zum Anzeigen der Matomo-Statistiken in der Administration verwenden]]></de>
<en><![CDATA[Use Access Token also for displaying Matomo statistics in administration]]></en>
</locale>
<locale name="matomo.settings.useTokenForStatisticsDisplay.description">
<de><![CDATA[<br>Hinweis: In der Matomo-Instanz muss das <a href="https://plugins.matomo.org/LoginTokenAuth" target="_blank" rel="noopener">LoginTokenAuth Plugin</a> aktiviert sein. Zudem darf das Token NICHT von einem Super-User der Matomo Instanz stammen.<br>Soll der Token-Login nicht verwendet werden, können stattdessen Matomo Zugangsdaten in den QUIQQER Benutzerprofil hinterlegt werden.]]></de>
<en><![CDATA[<br>Note: In the Matomo instance, the <a href="https://plugins.matomo.org/LoginTokenAuth" target="_blank" rel="noopener">LoginTokenAuth plugin</a> must be enabled. In addition, the token must NOT come from a super-user of the Matomo instance.<br>If the token login is not to be used, Matomo credentials can be stored in the QUIQQER user profile instead.]]></en>
</locale>
<locale name="matomo.settings.siteIds">
<de><![CDATA[Sprachspezifische Seiten IDs]]></de>
<en><![CDATA[Language Specific Site IDs]]></en>
......@@ -37,8 +46,12 @@
<en><![CDATA[Matomo wasn't configured for this project yet.<br/>This can be done in the project's settings.]]></en>
</locale>
<locale name="panel.notice.userdata.missing">
<de><![CDATA[Um automatisch angemeldet zu werden, fügen Sie Ihre Matomo-Nutzerdaten zu Ihren Nutzereinstellungen hinzu.]]></de>
<en><![CDATA[To login automatically add your Matomo-userdata to your user settings.]]></en>
<de><![CDATA[Um automatisch angemeldet zu werden, fügen Sie Ihre Matomo-Nutzerdaten zu Ihren Nutzereinstellungen hinzu oder aktivieren Sie den Token-Login in den Projekteinstellungen.]]></de>
<en><![CDATA[To login automatically add your Matomo-userdata to your user settings or activate the token login in the project settings.]]></en>
</locale>
<locale name="panel.notice.token.missing">
<de><![CDATA[Um automatisch angemeldet zu werden, müssen Sie in den Projekteinstellungen einen Matomo-Token hinterlegen oder den Token-Login deaktivieren.]]></de>
<en><![CDATA[To be logged in automatically, you need to store a Matomo token in the project settings or deactivate the token login.]]></en>
</locale>
<locale name="panel.matomo.title">
<de><![CDATA[Matomo Statistiken]]></de>
......@@ -84,8 +97,8 @@
</locale>
<locale name="matomo.settings.token.description">
<de><![CDATA[Wird zur Authentifizierung in API Anfragen verwendet. Mehr dazu <a href="https://matomo.org/faq/general/faq_114/" rel="nofollow">hier</a>.]]></de>
<en><![CDATA[Used for authentication in API requests. More about this <a href="https://matomo.org/faq/general/faq_114/" rel="nofollow">here</a>.]]></en>
<de><![CDATA[Wird zur Authentifizierung in API Anfragen verwendet. Mehr dazu <a href="https://matomo.org/faq/general/faq_114/" target="_blank" rel="noopener">hier</a>.]]></de>
<en><![CDATA[Used for authentication in API requests. More about this <a href="https://matomo.org/faq/general/faq_114/" target="_blank" rel="noopener">here</a>.]]></en>
</locale>
<locale name="user.profile.title">
......@@ -96,6 +109,10 @@
<de><![CDATA[Matomo Passwort]]></de>
<en><![CDATA[Matomo password]]></en>
</locale>
<locale name="user.profile.pass.description">
<de><![CDATA[Um den Matomo-Login via Benutzername & Passwort zu nutzen müssen neue Matomo-Instanzen mit Version 4.4.0 oder neuer wie folgt konfiguriert werden: <pre>[General]<br>login_allow_logme = 1</pre> Mehr dazu <a href="https://matomo.org/faq/how-to/faq_30/" target="_blank" rel="noopener">hier</a>.]]></de>
<en><![CDATA[To use Matomo login via username & password new Matomo instances with version 4.4.0 or newer must be configured as follows: <pre>[General]<br>login_allow_logme = 1</pre> More <a href="https://matomo.org/faq/how-to/faq_30/" target="_blank" rel="noopener">here</a>.]]></en>
</locale>
<locale name="user.profile.login">
<de><![CDATA[Matomo Benutzername]]></de>
<en><![CDATA[Matomo username]]></en>
......
......@@ -14,6 +14,10 @@
<conf name="token">
<type><![CDATA[string]]></type>
</conf>
<conf name="useTokenForStatisticsDisplay">
<type><![CDATA[bool]]></type>
<defaultvalue>0</defaultvalue>
</conf>
<conf name="langdata">
<type><![CDATA[string]]></type>
</conf>
......@@ -92,6 +96,15 @@
/>
</description>
</input>
<input conf="matomo.settings.useTokenForStatisticsDisplay" type="checkbox">
<text>
<locale group="quiqqer/matomo" var="matomo.settings.useTokenForStatisticsDisplay"/>
</text>
<description>
<locale group="quiqqer/matomo" var="matomo.settings.useTokenForStatisticsDisplay.description"/>
</description>
</input>
</settings>
<settings>
......
......@@ -22,6 +22,9 @@
</span>
<input name="quiqqer.matomo.pass" class="field-container-field"/>
</label>
<div class="field-container-item-desc">
{locale group="quiqqer/matomo" var="user.profile.pass.description"}
</div>
</td>
</tr>
</table>
\ No newline at end of file
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