mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-26 16:52:41 +01:00
Add "verified" or "unverified" to role output in user.query
Summary: See discussion in rP2f138d0501887fd0aca0f8536176f092880f662c. Test Plan: Ran `user.query` on verified and unverified users. Reviewers: csilvers, vrana Reviewed By: csilvers CC: aran Differential Revision: https://secure.phabricator.com/D2768
This commit is contained in:
parent
14648d6d7a
commit
31fcd78c76
2 changed files with 7 additions and 2 deletions
|
@ -36,6 +36,13 @@ abstract class ConduitAPI_user_Method extends ConduitAPIMethod {
|
||||||
$roles[] = 'admin';
|
$roles[] = 'admin';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$primary = $user->loadPrimaryEmail();
|
||||||
|
if ($primary && $primary->getIsVerified()) {
|
||||||
|
$roles[] = 'verified';
|
||||||
|
} else {
|
||||||
|
$roles[] = 'unverified';
|
||||||
|
}
|
||||||
|
|
||||||
$return = array(
|
$return = array(
|
||||||
'phid' => $user->getPHID(),
|
'phid' => $user->getPHID(),
|
||||||
'userName' => $user->getUserName(),
|
'userName' => $user->getUserName(),
|
||||||
|
|
|
@ -64,8 +64,6 @@ final class ConduitAPI_user_query_Method
|
||||||
$query->withUsernames($usernames);
|
$query->withUsernames($usernames);
|
||||||
}
|
}
|
||||||
if ($emails) {
|
if ($emails) {
|
||||||
// TODO -- validate emails and maybe
|
|
||||||
// throw new ConduitException('ERR-INVALID-PARAMETER');
|
|
||||||
$query->withEmails($emails);
|
$query->withEmails($emails);
|
||||||
}
|
}
|
||||||
if ($realnames) {
|
if ($realnames) {
|
||||||
|
|
Loading…
Reference in a new issue