diff --git a/lam/lib/modules/posixAccount.inc b/lam/lib/modules/posixAccount.inc
index df991c19..47bc8579 100644
--- a/lam/lib/modules/posixAccount.inc
+++ b/lam/lib/modules/posixAccount.inc
@@ -1843,9 +1843,14 @@ class posixAccount extends baseModule implements passwordService {
if ($this->get_scope() == 'host') {
$uidLabel = _('Host name');
}
+ $additionalGroups = array();
+ if (!empty($this->groups)) {
+ $additionalGroups = $this->groups;
+ natcasesort($additionalGroups);
+ }
$return = array(
'posixAccount_primaryGroup' => array('' . _('Primary group') . '' . $this->getGroupName($this->attributes['gidNumber'][0]) . ''),
- 'posixAccount_additionalGroups' => array('' . _('Additional groups') . '' . implode(", ", $this->groups) . ''),
+ 'posixAccount_additionalGroups' => array('' . _('Additional groups') . '' . implode(", ", $additionalGroups) . ''),
);
$this->addSimplePDFField($return, 'uid', $uidLabel);
$this->addSimplePDFField($return, 'cn', _('Common name'));
@@ -1862,6 +1867,7 @@ class posixAccount extends baseModule implements passwordService {
$gons[] = $allGons[$this->gonList[$i]]['cn'][0];
}
}
+ natcasesort($gons);
$return['posixAccount_gon'] = array('' . _('Groups of names') . '' . implode(", ", $gons) . '');
}
if (isset($this->clearTextPassword)) {
diff --git a/lam/lib/modules/posixGroup.inc b/lam/lib/modules/posixGroup.inc
index 295ec400..91767fe4 100644
--- a/lam/lib/modules/posixGroup.inc
+++ b/lam/lib/modules/posixGroup.inc
@@ -565,13 +565,8 @@ class posixGroup extends baseModule implements passwordService {
* @return array list of possible PDF entries
*/
function get_pdfEntries() {
- $members = '';
- if (isset($this->attributes['memberUid'][0])) {
- $members = implode(', ', $this->attributes['memberUid']);
- }
- $return = array(
- get_class($this) . '_memberUid' => array('' . _('Group members') . '' . $members . ''),
- );
+ $return = array();
+ $this->addSimplePDFField($return, 'memberUid', _('Group members'));
$this->addSimplePDFField($return, 'cn', _('Group name'));
$this->addSimplePDFField($return, 'gidNumber', _('GID number'));
$this->addSimplePDFField($return, 'description', _('Description'));