Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to set user id in plugin event hook #7322

Closed
shahar3012 opened this issue Mar 1, 2015 · 5 comments
Closed

How to set user id in plugin event hook #7322

shahar3012 opened this issue Mar 1, 2015 · 5 comments
Assignees
Labels
answered For when a question was asked and we referred to forum or answered it.
Milestone

Comments

@shahar3012
Copy link

Hi,
I'm writing a plugin that uses Kerberos authentication which gives me the user I want to set as the user id.
I can't figure it out how to set the user id from within a plugin.

I think I should do something like this:
$visitorInfo['uid'] = $_SERVER['REMOTE_USER'];

Note: Piwik Web server does the authentication on every request.

@tsteur
Copy link
Member

tsteur commented Mar 1, 2015

Do you mind asking this question in our Platform forum http://forum.piwik.org/list.php?9 ? We usually don't answer support questions here. That'd be great!

@tsteur tsteur closed this as completed Mar 1, 2015
@tsteur tsteur added the answered For when a question was asked and we referred to forum or answered it. label Mar 1, 2015
@tsteur tsteur added this to the Piwik 2.11.2 milestone Mar 1, 2015
@tsteur tsteur self-assigned this Mar 1, 2015
@shahar3012
Copy link
Author

Will you add a new setting for this?
The administrator may have a new setting that can be check in order to activate the core function that sets the user id with the remote user in $_SERVER array on every visitor request to piwik http tracker.

@tsteur
Copy link
Member

tsteur commented Mar 3, 2015

I don't think we will add a new setting. It should be already doable with a plugin. You're writing a plugin for Piwik right? Please ask in forum there are two ways to solve this I think. One of it is using our events Tracker.newVisitorInformation (link) and Tracker.existingVisitInformation (link)

@shahar3012
Copy link
Author

Unfortunately, I couldn't get it working with the ldapvisitorinfo plugin. I used these events and sets the uid. I checked the database for any sign of uid successfully sets and I found no sign for that. Maybe it doesn't get saved and therefore the ldapvisitorinfo plugin can't fetch the data.

@tsteur
Copy link
Member

tsteur commented Mar 4, 2015

If it doesn't work there are probably other solutions (creating a VisitDimension, it is not documented yet) but it is most likely supposed to work with events as well. Can you to ask in Forum please? If we identify there is a bug/missing feature we will create an issue here with a concrete example etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
answered For when a question was asked and we referred to forum or answered it.
Projects
None yet
Development

No branches or pull requests

2 participants