Commit 463ffa36 authored by M.Nowocyn's avatar M.Nowocyn

Add Piwik UserID support. If the user is logged in the UserID will be set for...

Add Piwik UserID support. If the user is logged in the UserID will be set for the Piwik session. It allows the Piwik Administrator a better overview of the User movement. Excluding the Adminpanel.
parent 0a3857d1
...@@ -13,9 +13,7 @@ ...@@ -13,9 +13,7 @@
namespace Iko\CMS; namespace Iko\CMS;
use Iko\{ use Iko\{Config, Core, Exception, Module, PDO, Session};
Config, Core, Exception, PDO, Session
};
/** /**
* Class Template * Class Template
...@@ -279,7 +277,7 @@ class Template implements iTemplate ...@@ -279,7 +277,7 @@ class Template implements iTemplate
$file_template = false; $file_template = false;
$file_entity = false; $file_entity = false;
for ($i = 0; $i < $zip->numFiles; $i++) { for ($i = 0; $i < $zip->numFiles; $i++) {
if (basename($zip->getNameIndex($i)) == 'Template.html') { if (basename($zip->getNameIndex($i)) == 'template.html') {
$file_template = true; $file_template = true;
} }
elseif (basename($zip->getNameIndex($i)) == 'entities.html') { elseif (basename($zip->getNameIndex($i)) == 'entities.html') {
...@@ -686,6 +684,11 @@ class Template implements iTemplate ...@@ -686,6 +684,11 @@ class Template implements iTemplate
$params = array ( $params = array (
'piwik_site_id' => $key, 'piwik_site_id' => $key,
'piwik_page' => $page); 'piwik_page' => $page);
if(Module::status("user")) {
if(Session::isLoggedIn()) {
$params['piwik_user_id'] = "_paq.push(['setUserId', '" . \Iko\User::getSession()->getID() . "']);";
}
}
} }
elseif ($system === 1) { elseif ($system === 1) {
$entity_name = 'analytics.google'; $entity_name = 'analytics.google';
......
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