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.
Sounds good, feel free to submit a pull request!
yes as you can see here
@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;
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.
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<a class='mention' href='https://github.com/example'>@example</a>.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>
To keep it consistent let's name it
date_last_seen and make it a date time field like