Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F309745
Include email address in Conduit's user.query output when run by admin
No One
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Advanced/Developer...
View Handle
View Hovercard
Authored By
aklapper
Jun 13 2023, 13:32
2023-06-13 13:32:16 (UTC+0)
Size
1 KB
Referenced Files
None
Subscribers
None
Include email address in Conduit's user.query output when run by admin
View Options
diff --git a/src/applications/people/conduit/UserQueryConduitAPIMethod.php b/src/applications/people/conduit/UserQueryConduitAPIMethod.php
index df0ec65841..0a99ab437e 100644
--- a/src/applications/people/conduit/UserQueryConduitAPIMethod.php
+++ b/src/applications/people/conduit/UserQueryConduitAPIMethod.php
@@ -80,11 +80,22 @@ final class UserQueryConduitAPIMethod extends UserConduitAPIMethod {
$users = $query->execute();
$results = array();
+
+ $actor = $request->getUser();
+ $is_admin = $actor->getIsAdmin();
+
foreach ($users as $user) {
- $results[] = $this->buildUserInformationDictionary(
- $user,
- $with_email = false,
- $with_availability = true);
+ if ($is_admin) {
+ $results[] = $this->buildUserInformationDictionary(
+ $user,
+ $with_email = true,
+ $with_availability = true);
+ } else {
+ $results[] = $this->buildUserInformationDictionary(
+ $user,
+ $with_email = false,
+ $with_availability = true);
+ }
}
return $results;
}
File Metadata
Details
Attached
Mime Type
text/plain; charset=utf-8
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
209837
Default Alt Text
Include email address in Conduit's user.query output when run by admin (1 KB)
Attached To
Mode
P14 Include email address in Conduit's user.query output when run by admin
Attached
Detach File
Event Timeline
Log In to Comment