From 02ddc9b427221e6c513b0e7c596bd46fe9fb72f8 Mon Sep 17 00:00:00 2001 From: Roland Gruber Date: Thu, 17 Jul 2014 19:34:51 +0000 Subject: [PATCH] sort PDF output --- lam/lib/modules/posixAccount.inc | 8 +++++++- lam/lib/modules/posixGroup.inc | 9 ++------- 2 files changed, 9 insertions(+), 8 deletions(-) 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'));