summaryrefslogtreecommitdiffstats
path: root/settings/controller
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@owncloud.com>2015-06-11 17:57:00 +0200
committerJoas Schilling <nickvergessen@owncloud.com>2015-06-16 11:10:00 +0200
commit171f86ca2e71918809930e823062d93c03833921 (patch)
treef605b2fa0d94a78c44d9781c595331f1e8a34b52 /settings/controller
parentfee62ac61c1cecb37e283fc6f9faf0251389226f (diff)
downloadnextcloud-server-171f86ca2e71918809930e823062d93c03833921.tar.gz
nextcloud-server-171f86ca2e71918809930e823062d93c03833921.zip
Only sort by group name when LDAP is involved
Diffstat (limited to 'settings/controller')
-rw-r--r--settings/controller/groupscontroller.php10
1 files changed, 6 insertions, 4 deletions
diff --git a/settings/controller/groupscontroller.php b/settings/controller/groupscontroller.php
index c3c0ea5ff20..6cb0cd3e008 100644
--- a/settings/controller/groupscontroller.php
+++ b/settings/controller/groupscontroller.php
@@ -23,7 +23,8 @@
namespace OC\Settings\Controller;
use OC\AppFramework\Http;
-use \OCP\AppFramework\Controller;
+use OC\Group\MetaData;
+use OCP\AppFramework\Controller;
use OCP\AppFramework\Http\DataResponse;
use OCP\IGroupManager;
use OCP\IL10N;
@@ -69,14 +70,15 @@ class GroupsController extends Controller {
*
* @param string $pattern
* @param bool $filterGroups
+ * @param int $sortGroups
* @return DataResponse
*/
- public function index($pattern = '', $filterGroups = false) {
+ public function index($pattern = '', $filterGroups = false, $sortGroups = MetaData::SORT_USERCOUNT) {
$groupPattern = $filterGroups ? $pattern : '';
- $groupsInfo = new \OC\Group\MetaData($this->userSession->getUser()->getUID(),
+ $groupsInfo = new MetaData($this->userSession->getUser()->getUID(),
$this->isAdmin, $this->groupManager);
- $groupsInfo->setSorting($groupsInfo::SORT_GROUPNAME);
+ $groupsInfo->setSorting($sortGroups);
list($adminGroups, $groups) = $groupsInfo->get($groupPattern, $pattern);
return new DataResponse(