From b8047f126acdeed5a982cb351d43068ecb657346 Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Mon, 7 Apr 2014 16:58:26 +0200 Subject: [PATCH] Sort user groups by name in UserOptionListForm --- .../files/lib/acp/form/UserOptionListForm.class.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/wcfsetup/install/files/lib/acp/form/UserOptionListForm.class.php b/wcfsetup/install/files/lib/acp/form/UserOptionListForm.class.php index 195fbd4b79..d304f6347a 100644 --- a/wcfsetup/install/files/lib/acp/form/UserOptionListForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/UserOptionListForm.class.php @@ -30,7 +30,13 @@ abstract class UserOptionListForm extends AbstractOptionListForm { * @return array */ protected function getAvailableGroups() { - return UserGroup::getAccessibleGroups(array(), array(UserGroup::GUESTS, UserGroup::EVERYONE, UserGroup::USERS)); + $userGroups = UserGroup::getAccessibleGroups(array(), array(UserGroup::GUESTS, UserGroup::EVERYONE, UserGroup::USERS)); + + uasort($userGroups, function(UserGroup $groupA, UserGroup $groupB) { + return strcmp($groupA->getName(), $groupB->getName()); + }); + + return $userGroups; } /** -- 2.20.1