fix: Return timestamps in unix format rather than milliseconds

Co-authored-by: Joas Schilling <213943+nickvergessen@users.noreply.github.com>
Signed-off-by: Côme Chilliet <91878298+come-nc@users.noreply.github.com>
pull/49377/head
Côme Chilliet 1 year ago committed by Côme Chilliet
parent 1d0962ab33
commit a8a2ca42a4
No known key found for this signature in database
GPG Key ID: A3E2F658B28C760A
  1. 3
      apps/provisioning_api/lib/Controller/AUserDataOCSController.php
  2. 3
      apps/provisioning_api/lib/ResponseDefinitions.php
  3. 9
      apps/provisioning_api/tests/Controller/UsersControllerTest.php

@ -116,7 +116,8 @@ abstract class AUserDataOCSController extends OCSController {
// Find the data
$data['id'] = $targetUserObject->getUID();
$data['firstLogin'] = $targetUserObject->getFirstLogin() * 1000;
$data['firstLoginTimestamp'] = $targetUserObject->getFirstLogin();
$data['lastLoginTimestamp'] = $targetUserObject->getLastLogin();
$data['lastLogin'] = $targetUserObject->getLastLogin() * 1000;
$data['backend'] = $targetUserObject->getBackendClassName();
$data['subadmin'] = $this->getUserSubAdminGroupsData($targetUserObject->getUID());

@ -46,7 +46,8 @@ namespace OCA\Provisioning_API;
* headlineScope?: Provisioning_APIUserDetailsScope,
* id: string,
* language: string,
* firstLogin: int,
* firstLoginTimestamp: int,
* lastLoginTimestamp: int,
* lastLogin: int,
* locale: string,
* manager: string,

@ -1173,7 +1173,8 @@ class UsersControllerTest extends TestCase {
'id' => 'UID',
'enabled' => true,
'storageLocation' => '/var/www/newtcloud/data/UID',
'firstLogin' => 1511191471000,
'firstLoginTimestamp' => 1511191471,
'lastLoginTimestamp' => 1521191471,
'lastLogin' => 1521191471000,
'backend' => 'Database',
'subadmin' => ['group3'],
@ -1317,7 +1318,8 @@ class UsersControllerTest extends TestCase {
$expected = [
'id' => 'UID',
'enabled' => true,
'firstLogin' => 1511191471000,
'firstLoginTimestamp' => 1511191471,
'lastLoginTimestamp' => 1521191471,
'lastLogin' => 1521191471000,
'backend' => 'Database',
'subadmin' => [],
@ -1499,7 +1501,8 @@ class UsersControllerTest extends TestCase {
$expected = [
'id' => 'UID',
'firstLogin' => 1511191471000,
'firstLoginTimestamp' => 1511191471,
'lastLoginTimestamp' => 1521191471,
'lastLogin' => 1521191471000,
'backend' => 'Database',
'subadmin' => [],

Loading…
Cancel
Save