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[^/]+)/(?:(?P[^/]+)/))?'; + return $base.'(?:query/(?P[^/]+)/(?:(?P[^/]+)/)?)?'; } 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[^/]+)/)?' => 'PhabricatorPeopleListController', + $this->getQueryRoutePattern() => 'PhabricatorPeopleListController', 'logs/(?:query/(?P[^/]+)/)?' => 'PhabricatorPeopleLogsController', 'invite/' => array( @@ -76,7 +76,7 @@ 'PhabricatorPeopleProfilePictureController', 'manage/(?P[1-9]\d*)/' => 'PhabricatorPeopleProfileManageController', - ), + ), '/p/(?P[\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);