@mwarmoeskerken opened this Issue on September 23rd 2016

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 commented on September 26th 2016 Member

Sounds good, feel free to submit a pull request!

@Morerice commented on September 21st 2017 Contributor

@mwarmoeskerken Is this still open?

@mattab commented on September 21st 2017 Member

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

@Morerice commented on September 22nd 2017 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 or false if the user has never logged in. */

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

@mattab commented on September 22nd 2017 Member

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 commented on September 23rd 2017 Contributor

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:

        <password />
        <email>anonymous<a class='mention' href='https://github.com/example'>@example</a>.org</email>
        <date_registered>2017-09-21 07:04:42</date_registered>
        <date_registered>2017-09-21 07:06:22</date_registered>
@mattab commented on September 24th 2017 Member

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

This Issue was closed on September 27th 2021
Powered by GitHub Issue Mirror