diff --git a/lam/lib/baseModule.inc b/lam/lib/baseModule.inc
index 21d67bce..c7edaa0f 100644
--- a/lam/lib/baseModule.inc
+++ b/lam/lib/baseModule.inc
@@ -1573,6 +1573,7 @@ abstract class baseModule {
/**
* Adds an area with two multi-select fields with buttons to move items from right to left and vice-versa.
+ * The options of the selects must be presorted.
*
Names:
*
* - First select: $namePrefix_1
@@ -1601,6 +1602,7 @@ abstract class baseModule {
$firstSelect->setHasDescriptiveElements(true);
$firstSelect->setMultiSelect(true);
$firstSelect->setRightToLeftTextDirection($rightToLeftText);
+ $firstSelect->setSortElements(false);
$firstRow->add($firstSelect, 12);
if ($showFilter) {
$firstFilterGroup = new htmlGroup();
@@ -1627,6 +1629,7 @@ abstract class baseModule {
$secondSelect->setHasDescriptiveElements(true);
$secondSelect->setMultiSelect(true);
$secondSelect->setRightToLeftTextDirection($rightToLeftText);
+ $secondSelect->setSortElements(false);
$secondRow->add($secondSelect, 12);
if ($showFilter) {
$secondFilterGroup = new htmlGroup();
diff --git a/lam/lib/modules/asteriskExtension.inc b/lam/lib/modules/asteriskExtension.inc
index 0bd0f8e1..83b2d97a 100644
--- a/lam/lib/modules/asteriskExtension.inc
+++ b/lam/lib/modules/asteriskExtension.inc
@@ -440,11 +440,13 @@ class asteriskExtension extends baseModule {
$users_dn[getAbstractDN($dn)] = $dn;
}
}
+ uasort($users_dn, 'compareDN');
if (isset($this->extensionOwners)) {
$memberList = $this->extensionOwners;
} else {
$memberList = array();
}
+ usort($memberList, 'compareDN');
$members = array();
for ($i = 0; $i < sizeof($memberList); $i++) {
$members[getAbstractDN($memberList[$i])] = $memberList[$i];
diff --git a/lam/lib/modules/posixGroup.inc b/lam/lib/modules/posixGroup.inc
index d096a868..6aeec63e 100644
--- a/lam/lib/modules/posixGroup.inc
+++ b/lam/lib/modules/posixGroup.inc
@@ -307,6 +307,7 @@ class posixGroup extends baseModule implements passwordService {
if (isset($this->attributes['memberUid'])) {
$remUsers = $this->attributes['memberUid'];
}
+ usort($remUsers, 'compareDN');
$remUsersDescriptive = array();
foreach ($remUsers as $user) {
if (isset($userAndGIDs[$user])) {