Skip to content

Commit

Permalink
Merge pull request #958 from nextcloud/fix/898/provision-api-unique-u…
Browse files Browse the repository at this point in the history
…id-getuserfolder

Use correct userId when getting user folder in provisioning endpoint
  • Loading branch information
julien-nc authored Oct 9, 2024
2 parents cdf2b0d + d48f95a commit 8e0ac5d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/Controller/ApiController.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public function __construct(
* @param string|null $quota
* @return DataResponse
*/
public function createUser(int $providerId, string $userId, ?string $displayName = null,
public function createUser(int $providerId, string $userId, ?string $displayName = null,
?string $email = null, ?string $quota = null): DataResponse {
$backendUser = $this->userMapper->getOrCreate($providerId, $userId);
$user = $this->userManager->get($backendUser->getUserId());
Expand All @@ -87,10 +87,10 @@ public function createUser(int $providerId, string $userId, ?string $displayNam
$user->setQuota($quota);
}

$userFolder = $this->root->getUserFolder($userId);
$userFolder = $this->root->getUserFolder($user->getUID());
try {
// copy skeleton
\OC_Util::copySkeleton($userId, $userFolder);
\OC_Util::copySkeleton($user->getUID(), $userFolder);
} catch (NotPermittedException $ex) {
// read only uses
}
Expand Down

0 comments on commit 8e0ac5d

Please sign in to comment.