Skip to content

Commit

Permalink
check that user is valid
Browse files Browse the repository at this point in the history
  • Loading branch information
ArtificialOwl committed May 23, 2018
1 parent de0bff9 commit 5d810c9
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions lib/Service/FilesService.php
Original file line number Diff line number Diff line change
Expand Up @@ -630,10 +630,15 @@ private function updateShareNames(FilesDocument $document, Node $file) {
$this->groupFoldersService->getShareUsers($document, $users);

$shareNames = [];
foreach ($users as $user) {
foreach ($users as $username) {
try {
$shareNames[MiscService::secureUsername($user)] =
$this->getPathFromViewerId($file->getId(), $user);
$user = $this->userManager->get($username);
if ($user->getLastLogin() === 0) {
continue;
}

$shareNames[MiscService::secureUsername($username)] =
$this->getPathFromViewerId($file->getId(), $username);
} catch (Exception $e) {
}
}
Expand Down

0 comments on commit 5d810c9

Please sign in to comment.