Page MenuHomePhorge

No OneTemporary

diff --git a/src/applications/conduit/method/user/base/ConduitAPI_user_Method.php b/src/applications/conduit/method/user/base/ConduitAPI_user_Method.php
index 3c32e7ee5f..c2f4ec0e81 100644
--- a/src/applications/conduit/method/user/base/ConduitAPI_user_Method.php
+++ b/src/applications/conduit/method/user/base/ConduitAPI_user_Method.php
@@ -1,44 +1,56 @@
<?php
/*
* Copyright 2012 Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @group conduit
*/
abstract class ConduitAPI_user_Method extends ConduitAPIMethod {
protected function buildUserInformationDictionary(
PhabricatorUser $user,
PhabricatorUserStatus $current_status = null) {
+ $roles = array();
+ if ($user->getIsDisabled()) {
+ $roles[] = 'disabled';
+ }
+ if ($user->getIsSystemAgent()) {
+ $roles[] = 'agent';
+ }
+ if ($user->getIsAdmin()) {
+ $roles[] = 'admin';
+ }
+
$return = array(
'phid' => $user->getPHID(),
'userName' => $user->getUserName(),
'realName' => $user->getRealName(),
'image' => $user->loadProfileImageURI(),
'uri' => PhabricatorEnv::getURI('/p/'.$user->getUsername().'/'),
+ 'roles' => $roles,
);
if ($current_status) {
$return['currentStatus'] = $current_status->getTextStatus();
$return['currentStatusUntil'] = $current_status->getDateTo();
}
return $return;
}
}
diff --git a/src/applications/conduit/method/user/info/ConduitAPI_user_info_Method.php b/src/applications/conduit/method/user/info/ConduitAPI_user_info_Method.php
index 8f2c444ff4..323183867f 100644
--- a/src/applications/conduit/method/user/info/ConduitAPI_user_info_Method.php
+++ b/src/applications/conduit/method/user/info/ConduitAPI_user_info_Method.php
@@ -1,58 +1,66 @@
<?php
/*
- * Copyright 2011 Facebook, Inc.
+ * Copyright 2012 Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @group conduit
*/
final class ConduitAPI_user_info_Method
extends ConduitAPI_user_Method {
+ public function getMethodStatus() {
+ return self::METHOD_STATUS_DEPRECATED;
+ }
+
+ public function getMethodStatusDescription() {
+ return "Replaced by 'user.query'.";
+ }
+
public function getMethodDescription() {
return "Retrieve information about a user by PHID.";
}
public function defineParamTypes() {
return array(
'phid' => 'required phid',
);
}
public function defineReturnType() {
return 'nonempty dict<string, wild>';
}
public function defineErrorTypes() {
return array(
'ERR-BAD-USER' => 'No such user exists.',
);
}
protected function execute(ConduitAPIRequest $request) {
$user = id(new PhabricatorUser())->loadOneWhere(
'phid = %s',
$request->getValue('phid'));
if (!$user) {
throw new ConduitException('ERR-BAD-USER');
}
return $this->buildUserInformationDictionary($user);
}
}

File Metadata

Mime Type
text/x-diff
Expires
Sun, Jan 19, 20:09 (1 w, 5 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1128320
Default Alt Text
(3 KB)

Event Timeline