From 828bc5c638edd9fa6a94bf35eb120f3ad5c497a8 Mon Sep 17 00:00:00 2001 From: Roland Gruber Date: Sun, 15 Mar 2015 17:38:03 +0000 Subject: [PATCH] added addPDFKeyValue() --- lam/lib/modules/posixGroup.inc | 3 +-- lam/lib/modules/windowsGroup.inc | 6 +++--- lam/lib/modules/windowsHost.inc | 2 +- lam/lib/modules/windowsUser.inc | 14 +++++++------- 4 files changed, 12 insertions(+), 13 deletions(-) diff --git a/lam/lib/modules/posixGroup.inc b/lam/lib/modules/posixGroup.inc index e66ae039..2bee205d 100644 --- a/lam/lib/modules/posixGroup.inc +++ b/lam/lib/modules/posixGroup.inc @@ -594,8 +594,7 @@ class posixGroup extends baseModule implements passwordService { $members[] = $entry['uid'][0]; } } - sort($members); - $return[get_class($this) . '_memberUidPrimary'] = array('' . _('Group members') . '' . implode(', ', $members) . ''); + $this->addPDFKeyValue($return, 'memberUidPrimary', _('Group members'), $members); } return $return; } diff --git a/lam/lib/modules/windowsGroup.inc b/lam/lib/modules/windowsGroup.inc index e63f206e..6131facb 100644 --- a/lam/lib/modules/windowsGroup.inc +++ b/lam/lib/modules/windowsGroup.inc @@ -775,13 +775,13 @@ class windowsGroup extends baseModule { $groupType = $groupTypeLabels[$groupType]; $groupScopeLabels = array_flip($this->groupScopes); $groupScope = $groupScopeLabels[$groupScope]; - $return[get_class($this) . '_groupScope'] = array('' . _('Group scope') . '' . $groupScope . ''); - $return[get_class($this) . '_groupType'] = array('' . _('Group type') . '' . $groupType . ''); + $this->addPDFKeyValue($return, 'groupScope', _('Group scope'), $groupScope); + $this->addPDFKeyValue($return, 'groupType', _('Group type'), $groupType); // managed by $managedBy = ''; if (isset($this->attributes['managedBy'][0])) { $managedBy = getAbstractDN($this->attributes['managedBy'][0]); - $return[get_class($this) . '_managedBy'] = array('' . _('Managed by') . '' . $managedBy . ''); + $this->addPDFKeyValue($return, 'managedBy', _('Managed by'), $managedBy); } // members if (sizeof($this->attributes['member']) > 0) { diff --git a/lam/lib/modules/windowsHost.inc b/lam/lib/modules/windowsHost.inc index 8ade25b6..3586a3cc 100644 --- a/lam/lib/modules/windowsHost.inc +++ b/lam/lib/modules/windowsHost.inc @@ -295,7 +295,7 @@ class windowsHost extends baseModule { $managedBy = ''; if (isset($this->attributes['managedBy'][0])) { $managedBy = getAbstractDN($this->attributes['managedBy'][0]); - $return[get_class($this) . '_managedBy'] = array('' . _('Managed by') . '' . $managedBy . ''); + $this->addPDFKeyValue($return, 'managedBy', _('Managed by'), $managedBy); } return $return; } diff --git a/lam/lib/modules/windowsUser.inc b/lam/lib/modules/windowsUser.inc index ab4ac8ce..8374d623 100644 --- a/lam/lib/modules/windowsUser.inc +++ b/lam/lib/modules/windowsUser.inc @@ -1619,22 +1619,22 @@ class windowsUser extends baseModule implements passwordService { if ($this->isDeactivated($this->attributes)) { $deactivated = _('yes'); } - $return[get_class($this) . '_deactivated'] = array('' . _('Account is deactivated') . '' . $deactivated . ''); + $this->addPDFKeyValue($return, 'deactivated', _('Account is deactivated'), $deactivated); $noExpire = _('no'); if ($this->isNeverExpiring($this->attributes)) { $noExpire = _('yes'); } - $return[get_class($this) . '_noExpire'] = array('' . _('Password does not expire') . '' . $noExpire . ''); + $this->addPDFKeyValue($return, 'noExpire', _('Password does not expire'), $noExpire); $requireCard = _('no'); if ($this->isSmartCardRequired($this->attributes)) { $requireCard = _('yes'); } - $return[get_class($this) . '_requireCard'] = array('' . _('Require smartcard') . '' . $requireCard . ''); + $this->addPDFKeyValue($return, 'requireCard', _('Require smartcard'), $requireCard); $pwdMustChange = _('no'); if (isset($this->attributes['pwdLastSet'][0]) && ($this->attributes['pwdLastSet'][0] === '0')) { $pwdMustChange = _('yes'); } - $return[get_class($this) . '_pwdMustChange'] = array('' . _('Password change at next login') . '' . $pwdMustChange . ''); + $this->addPDFKeyValue($return, 'pwdMustChange', _('Password change at next login'), $pwdMustChange); $this->addSimplePDFField($return, 'profilePath', _('Profile path')); $this->addSimplePDFField($return, 'scriptPath', _('Logon script')); $this->addSimplePDFField($return, 'homeDirectory', _('Home directory')); @@ -1643,13 +1643,13 @@ class windowsUser extends baseModule implements passwordService { foreach ($this->groupList as $group) { $groups[] = extractRDNValue($group); } - $return[get_class($this) . '_groups'] = array('' . _('Groups') . '' . implode(', ', $groups) . ''); + $this->addPDFKeyValue($return, 'groups', _('Groups'), $groups); // password if (isset($this->clearTextPassword)) { - $return['windowsUser_password'] = array('' . _('Password') . '' . $this->clearTextPassword . ''); + $this->addPDFKeyValue($return, 'password', _('Password'), $this->clearTextPassword); } else if (isset($this->attributes['INFO.userPasswordClearText'])) { - $return['windowsUser_password'] = array('' . _('Password') . '' . $this->attributes['INFO.userPasswordClearText'] . ''); + $this->addPDFKeyValue($return, 'password', _('Password'), $this->attributes['INFO.userPasswordClearText']); } return $return; }