Gallery3:Modules:piwik module - need help for Logging REMOTE_USER with the Piwik module

blaufotograph

Joined: 2007-07-30
Posts: 53
Posted: Thu, 2012-05-24 18:56

Currently i'am looking to integrate the REMOTE_USER variable into the Piwik Module

http://codex.gallery2.org/Gallery3:Modules:piwik_module

Quote:
piwikTracker.setCustomVariable(1, 'user', '<? echo $_SERVER['REMOTE_USER']; ?>');

Could you help me please, how i could add the line from above with the REMOTE_USER variable?
Of course i find out, that the javascript code i located inside the "piwik_plugin/helpers/piwik_plugin_theme.php"

_____________________________________________
Thank, and regards

blaufotograph

Homepage: http://reisen.blaufotograph.de
My Gallery Version:
* Version: 3.0 with default wind theme, now updated to the latest git-version
* a further in s

 
jnash
jnash's picture

Joined: 2004-08-02
Posts: 814
Posted: Thu, 2012-05-24 19:15

From the looks of it, you'd need to add this in the helpers/piwik_plugin_theme.php file after the following:

[not tested as I don't use the module - but a start for you]

        try {
        var piwikTracker = Piwik.getTracker(pkBaseURL + "piwik.php", '.module::get_var("piwik_plugin", "site_id").');
        piwikTracker.setCustomVariable(1, 'user', '<?= $_SERVER['REMOTE_USER']; ?>');
        piwikTracker.trackPageView();
        piwikTracker.enableLinkTracking();
        } catch( err ) {}

Hope this works for you.