Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15450609
D18935.id45408.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
4 KB
Referenced Files
None
Subscribers
None
D18935.id45408.diff
View Options
diff --git a/src/applications/base/PhabricatorApplication.php b/src/applications/base/PhabricatorApplication.php
--- a/src/applications/base/PhabricatorApplication.php
+++ b/src/applications/base/PhabricatorApplication.php
@@ -623,7 +623,7 @@
}
protected function getQueryRoutePattern($base = null) {
- return $base.'(?:query/(?P<queryKey>[^/]+)/(?:(?P<queryAction>[^/]+)/))?';
+ return $base.'(?:query/(?P<queryKey>[^/]+)/(?:(?P<queryAction>[^/]+)/)?)?';
}
protected function getProfileMenuRouting($controller) {
diff --git a/src/applications/people/application/PhabricatorPeopleApplication.php b/src/applications/people/application/PhabricatorPeopleApplication.php
--- a/src/applications/people/application/PhabricatorPeopleApplication.php
+++ b/src/applications/people/application/PhabricatorPeopleApplication.php
@@ -41,7 +41,7 @@
public function getRoutes() {
return array(
'/people/' => array(
- '(query/(?P<key>[^/]+)/)?' => 'PhabricatorPeopleListController',
+ $this->getQueryRoutePattern() => 'PhabricatorPeopleListController',
'logs/(?:query/(?P<queryKey>[^/]+)/)?'
=> 'PhabricatorPeopleLogsController',
'invite/' => array(
@@ -76,7 +76,7 @@
'PhabricatorPeopleProfilePictureController',
'manage/(?P<id>[1-9]\d*)/' =>
'PhabricatorPeopleProfileManageController',
- ),
+ ),
'/p/(?P<username>[\w._-]+)/' => array(
'' => 'PhabricatorPeopleProfileViewController',
'item/' => $this->getProfileMenuRouting(
diff --git a/src/applications/people/controller/PhabricatorPeopleListController.php b/src/applications/people/controller/PhabricatorPeopleListController.php
--- a/src/applications/people/controller/PhabricatorPeopleListController.php
+++ b/src/applications/people/controller/PhabricatorPeopleListController.php
@@ -16,7 +16,7 @@
PeopleBrowseUserDirectoryCapability::CAPABILITY);
$controller = id(new PhabricatorApplicationSearchController())
- ->setQueryKey($request->getURIData('key'))
+ ->setQueryKey($request->getURIData('queryKey'))
->setSearchEngine(new PhabricatorPeopleSearchEngine())
->setNavigation($this->buildSideNavView());
diff --git a/src/applications/people/query/PhabricatorPeopleSearchEngine.php b/src/applications/people/query/PhabricatorPeopleSearchEngine.php
--- a/src/applications/people/query/PhabricatorPeopleSearchEngine.php
+++ b/src/applications/people/query/PhabricatorPeopleSearchEngine.php
@@ -320,4 +320,41 @@
return $result;
}
+ protected function newExportFields() {
+ return array(
+ id(new PhabricatorIDExportField())
+ ->setKey('id')
+ ->setLabel(pht('ID')),
+ id(new PhabricatorPHIDExportField())
+ ->setKey('phid')
+ ->setLabel(pht('PHID')),
+ id(new PhabricatorStringExportField())
+ ->setKey('username')
+ ->setLabel(pht('Username')),
+ id(new PhabricatorStringExportField())
+ ->setKey('realName')
+ ->setLabel(pht('Real Name')),
+ id(new PhabricatorEpochExportField())
+ ->setKey('created')
+ ->setLabel(pht('Date Created')),
+ );
+ }
+
+ public function newExport(array $users) {
+ $viewer = $this->requireViewer();
+
+ $export = array();
+ foreach ($users as $user) {
+ $export[] = array(
+ 'id' => $user->getID(),
+ 'phid' => $user->getPHID(),
+ 'username' => $user->getUsername(),
+ 'realName' => $user->getRealName(),
+ 'created' => $user->getDateCreated(),
+ );
+ }
+
+ return $export;
+ }
+
}
diff --git a/src/applications/search/controller/PhabricatorApplicationSearchController.php b/src/applications/search/controller/PhabricatorApplicationSearchController.php
--- a/src/applications/search/controller/PhabricatorApplicationSearchController.php
+++ b/src/applications/search/controller/PhabricatorApplicationSearchController.php
@@ -396,9 +396,12 @@
->setViewer($viewer)
->withQueryKeys(array($query_key))
->executeOne();
- if (!$saved_query) {
- return new Aphront404Response();
- }
+ } else {
+ $saved_query = null;
+ }
+
+ if (!$saved_query) {
+ return new Aphront404Response();
}
$cancel_uri = $engine->getQueryResultsPageURI($query_key);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Mar 29, 4:39 PM (3 w, 4 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7707825
Default Alt Text
D18935.id45408.diff (4 KB)
Attached To
Mode
D18935: Support basic export of user accounts
Attached
Detach File
Event Timeline
Log In to Comment