diff options
author | Ferdinand Thiessen <opensource@fthiessen.de> | 2024-08-21 21:58:10 +0200 |
---|---|---|
committer | Ferdinand Thiessen <opensource@fthiessen.de> | 2024-08-22 19:16:55 +0200 |
commit | dd58e5290f0790157df6077471327ebd9affb03f (patch) | |
tree | ca91ae6d1c9bd9ad554fc0ce3bea3dbf8b80051c /apps/files_sharing | |
parent | 127cacdd19e43dd56d5c8dc5ae174228bdfe0021 (diff) | |
download | nextcloud-server-dd58e5290f0790157df6077471327ebd9affb03f.tar.gz nextcloud-server-dd58e5290f0790157df6077471327ebd9affb03f.zip |
feat: Use new password context in sharing API
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Diffstat (limited to 'apps/files_sharing')
-rw-r--r-- | apps/files_sharing/lib/Controller/ShareController.php | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/apps/files_sharing/lib/Controller/ShareController.php b/apps/files_sharing/lib/Controller/ShareController.php index 642065c9983..25af4862ca4 100644 --- a/apps/files_sharing/lib/Controller/ShareController.php +++ b/apps/files_sharing/lib/Controller/ShareController.php @@ -33,13 +33,14 @@ use OCP\IRequest; use OCP\ISession; use OCP\IURLGenerator; use OCP\IUserManager; +use OCP\Security\Events\GenerateSecurePasswordEvent; use OCP\Security\ISecureRandom; +use OCP\Security\PasswordContext; use OCP\Share; use OCP\Share\Exceptions\ShareNotFound; use OCP\Share\IManager as ShareManager; use OCP\Share\IPublicShareTemplateFactory; use OCP\Share\IShare; -use OCP\Template; /** * @package OCA\Files_Sharing\Controllers @@ -156,7 +157,7 @@ class ShareController extends AuthPublicShareController { * Generates a password for the share, respecting any password policy defined */ protected function generatePassword(): void { - $event = new \OCP\Security\Events\GenerateSecurePasswordEvent(); + $event = new GenerateSecurePasswordEvent(PasswordContext::SHARING); $this->eventDispatcher->dispatchTyped($event); $password = $event->getPassword() ?? $this->secureRandom->generate(20); |