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

Add field lastSeen in the API for the UsersManager #10550

Closed
mwarmoeskerken opened this issue Sep 23, 2016 · 7 comments · Fixed by #18053
Closed

Add field lastSeen in the API for the UsersManager #10550

mwarmoeskerken opened this issue Sep 23, 2016 · 7 comments · Fixed by #18053
Assignees
Labels
Help wanted Beginner friendly issues or issues where we'd highly appreciate community's help and involvement.

Comments

@mwarmoeskerken
Copy link

In order to better manage user-accounts for Piwik it would be great if the lastSeen variable was added as a new column that is returned with the API method UsersManager.getUsers. We currently use these API-calls to export the list of users and manage access to Piwik via an external tool.

@mattab
Copy link
Member

mattab commented Sep 26, 2016

Sounds good, feel free to submit a pull request!

@mattab mattab added the Help wanted Beginner friendly issues or issues where we'd highly appreciate community's help and involvement. label Nov 11, 2016
@mattab mattab added this to the 3.0.0 milestone Nov 11, 2016
@Morerice
Copy link
Contributor

@mwarmoeskerken Is this still open?

@mattab
Copy link
Member

mattab commented Sep 21, 2017

yes as you can see here
yes as you can see here

@Morerice
Copy link
Contributor

@mattab Just to confirm. Does the $userName argument in LastSeenTimeLogger::getLastSeenTimeForUser refer to the user login?

/** * Returns the time a user was last seen orfalse` if the user has never logged in. */

public static function getLastSeenTimeForUser($userName)
{
    $optionName = self::OPTION_PREFIX . $userName;
    return Option::get($optionName);
}`

@mattab
Copy link
Member

mattab commented Sep 22, 2017

Hi @Morerice if you will create a pull request you need to make sure you understand this and test it. Yes, it is the user login.

@Morerice
Copy link
Contributor

Morerice commented Sep 23, 2017

Thanks @mattab. That is exactly the reason why I asked the question. I would assume that the requested last_seen parameter is to be returned as a UNIX timestamp. All UserManager tests are still correct and here is the xml received when I requested the updated getUsers function:

<result>
	<row>
		<login>anonymous</login>
		<password />
		<alias>anonymous</alias>
		<email>anonymous@example.org</email>
		<superuser_access>0</superuser_access>
		<date_registered>2017-09-21 07:04:42</date_registered>
	</row>
	<row>
		<login>super_piwik</login>
		<password>XXXXXXXXX</password>
		<alias>super_piwik</alias>
		<email>XXXXXXXXXX</email>
		<superuser_access>1</superuser_access>
		<date_registered>2017-09-21 07:06:22</date_registered>
		<last_seen>1506156455</last_seen>
	</row>
</result>

@mattab
Copy link
Member

mattab commented Sep 24, 2017

Hi @Morerice
To keep it consistent let's name it date_last_seen and make it a date time field like date_registered

@peterhashair peterhashair self-assigned this Sep 23, 2021
@peterhashair peterhashair linked a pull request Sep 23, 2021 that will close this issue
11 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Help wanted Beginner friendly issues or issues where we'd highly appreciate community's help and involvement.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants