summaryrefslogtreecommitdiffstats
path: root/lib/private/user/manager.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/user/manager.php')
-rw-r--r--lib/private/user/manager.php14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/private/user/manager.php b/lib/private/user/manager.php
index 4371be134aa..37a3e5ba134 100644
--- a/lib/private/user/manager.php
+++ b/lib/private/user/manager.php
@@ -33,6 +33,7 @@
namespace OC\User;
use OC\Hooks\PublicEmitter;
+use OCP\IUser;
use OCP\IUserBackend;
use OCP\IUserManager;
use OCP\IConfig;
@@ -354,4 +355,17 @@ class Manager extends PublicEmitter implements IUserManager {
} while (count($users) >= $limit);
}
}
+
+ /**
+ * @param string $email
+ * @return IUser[]
+ * @since 9.1.0
+ */
+ public function getByEmail($email) {
+ $userIds = $this->config->getUsersForUserValue('settings', 'email', $email);
+
+ return array_map(function($uid) {
+ return $this->get($uid);
+ }, $userIds);
+ }
}