allow to print primary group members

This commit is contained in:
Roland Gruber 2015-01-07 17:33:06 +00:00
parent 8c27a44cf8
commit 42abddfc7c
2 changed files with 13 additions and 0 deletions

View File

@ -1,5 +1,6 @@
March 2015 March 2015
- templates for server profiles - templates for server profiles
- PDF export: added option to print primary group members
16.12.2014 4.8 16.12.2014 4.8

View File

@ -572,6 +572,18 @@ class posixGroup extends baseModule implements passwordService {
$this->addSimplePDFField($return, 'cn', _('Group name')); $this->addSimplePDFField($return, 'cn', _('Group name'));
$this->addSimplePDFField($return, 'gidNumber', _('GID number')); $this->addSimplePDFField($return, 'gidNumber', _('GID number'));
$this->addSimplePDFField($return, 'description', _('Description')); $this->addSimplePDFField($return, 'description', _('Description'));
if (in_array(get_class($this) . '_memberUidPrimary', $pdfKeys)) {
$members = !empty($this->attributes['memberUid']) ? $this->attributes['memberUid'] : array();
if (!empty($this->attributes['gidNumber'])) {
$filter = "(&(&" . get_ldap_filter('user') . ")(gidNumber=" . $this->attributes['gidNumber'][0] . "))";
$entries = searchLDAPByFilter($filter, array('uid'), array('user'));
foreach ($entries as $entry) {
$members[] = $entry['uid'][0];
}
}
sort($members);
$return[get_class($this) . '_memberUidPrimary'] = array('<block><key>' . _('Group members') . '</key><value>' . implode(', ', $members) . '</value></block>');
}
return $return; return $return;
} }