Skip to content

Commit

Permalink
fix: logging done at the beginning and end of getUsersDetails, getUse…
Browse files Browse the repository at this point in the history
…rData and fillStorageInfo
  • Loading branch information
yemkareems committed Aug 31, 2024
1 parent ee20889 commit 91f0692
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
30 changes: 30 additions & 0 deletions apps/provisioning_api/lib/Controller/AUserData.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,13 @@ public function __construct(string $appName,
* @throws OCSNotFoundException
*/
protected function getUserData(string $userId, bool $includeScopes = false): ?array {
\OC::$server->get(\Psr\Log\LoggerInterface::class)->error(
'Start of getUserData for {user}',
[
'user' => $userId,
'ticket' => '66440',
]
);
$currentLoggedInUser = $this->userSession->getUser();
assert($currentLoggedInUser !== null, 'No user logged in');

Expand Down Expand Up @@ -222,6 +229,13 @@ protected function getUserData(string $userId, bool $includeScopes = false): ?ar
'setDisplayName' => $backend instanceof ISetDisplayNameBackend || $backend->implementsActions(Backend::SET_DISPLAYNAME),
'setPassword' => $backend instanceof ISetPasswordBackend || $backend->implementsActions(Backend::SET_PASSWORD),
];
\OC::$server->get(\Psr\Log\LoggerInterface::class)->error(
'End of getUserData for {user}',
[
'user' => $userId,
'ticket' => '66440',
]
);

return $data;
}
Expand Down Expand Up @@ -256,6 +270,14 @@ protected function getUserSubAdminGroupsData(string $userId): array {
* @throws OCSException
*/
protected function fillStorageInfo(string $userId): array {
\OC::$server->get(\Psr\Log\LoggerInterface::class)->error(
'Start of fillStorageInfo for {user}',
[
'user' => $userId,
'ticket' => '66440',
]
);

try {
\OC_Util::tearDownFS();
\OC_Util::setupFS($userId);
Expand Down Expand Up @@ -294,6 +316,14 @@ protected function fillStorageInfo(string $userId): array {
\OC_Util::tearDownFS();
return [];
}
\OC::$server->get(\Psr\Log\LoggerInterface::class)->error(
'End of fillStorageInfo for {user}',
[
'user' => $userId,
'ticket' => '66440',
]
);

return $data;
}
}
14 changes: 14 additions & 0 deletions apps/provisioning_api/lib/Controller/UsersController.php
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,13 @@ public function getUsersDetails(string $search = '', int $limit = null, int $off
$usersDetails = [];
foreach ($users as $userId) {
$userId = (string) $userId;
\OC::$server->get(\Psr\Log\LoggerInterface::class)->error(
'Start of getUsersDetails for {user}',
[
'user' => $userId,
'ticket' => '66440',
]
);
try {
$userData = $this->getUserData($userId);
} catch (OCSNotFoundException $e) {
Expand All @@ -231,6 +238,13 @@ public function getUsersDetails(string $search = '', int $limit = null, int $off
// only showing its id
$usersDetails[$userId] = ['id' => $userId];
}
\OC::$server->get(\Psr\Log\LoggerInterface::class)->error(
'End of getUsersDetails for {user}',
[
'user' => $userId,
'ticket' => '66440',
]
);
}

return new DataResponse([
Expand Down

0 comments on commit 91f0692

Please sign in to comment.