Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 742dd453 authored by Akhil's avatar Akhil 🙂
Browse files

Fixed autocomplete user leak core patch for nc20

parent c5ada19f
Loading
Loading
Loading
Loading
Loading
+9 −10
Original line number Diff line number Diff line
@@ -24,15 +24,15 @@ diff --git lib/private/Collaboration/Collaborators/UserPlugin.php lib/private/Co
 			) {
 				if (strtolower($uid) === $lowerSearch) {
diff --git lib/private/Collaboration/Collaborators/MailPlugin.php lib/private/Collaboration/Collaborators/MailPlugin-new.php
--- lib/private/Collaboration/Collaborators/MailPlugin.php	2021-02-16 14:55:37.281914086 +0100
+++ lib/private/Collaboration/Collaborators/MailPlugin-new.php	2021-02-19 16:22:07.662189199 +0100
--- lib/private/Collaboration/Collaborators/MailPlugin.php	2021-06-22 14:53:24.451402977 +0530
+++ lib/private/Collaboration/Collaborators/MailPlugin-new.php	2021-06-22 14:56:31.201379020 +0530
@@ -36,6 +36,7 @@
 use OCP\IConfig;
 use OCP\IGroupManager;
 use OCP\IUser;
+use OCP\IUserManager;
 use OCP\IUserSession;
 use OCP\Share;
 use OCP\Share\IShare;
 
@@ -56,12 +57,13 @@
 	/** @var IUserSession */
@@ -49,7 +49,7 @@ diff --git lib/private/Collaboration/Collaborators/MailPlugin.php lib/private/Co
 
 		$this->shareeEnumeration = $this->config->getAppValue('core', 'shareapi_allow_share_dialog_user_enumeration', 'yes') === 'yes';
 		$this->shareWithGroupOnly = $this->config->getAppValue('core', 'shareapi_only_share_with_group_members', 'no') === 'yes';
@@ -185,43 +187,79 @@
@@ -185,43 +187,78 @@
 						if ($exactEmailMatch) {
 							$searchResult->markExactIdMatch($emailType);
 						}
@@ -59,11 +59,10 @@ diff --git lib/private/Collaboration/Collaborators/MailPlugin.php lib/private/Co
-							'name' => $contact['FN'],
-							'type' => $emailAddressType ?? '',
-							'value' => [
-								'shareType' => Share::SHARE_TYPE_EMAIL,
-								'shareType' => IShare::TYPE_EMAIL,
-								'shareWith' => $emailAddress,
-							],
-						];
+						
+						$isUserinInstance = $this->userManager->get($emailAddress);
+						if ($isUserinInstance === null) {
+							// /e/ user is not in ecloud
@@ -99,7 +98,7 @@ diff --git lib/private/Collaboration/Collaborators/MailPlugin.php lib/private/Co
-							'name' => $contact['FN'],
-							'type' => $emailAddressType ?? '',
-							'value' => [
-								'shareType' => Share::SHARE_TYPE_EMAIL,
-								'shareType' => IShare::TYPE_EMAIL,
-								'shareWith' => $emailAddress,
-							],
-						];