added addPDFKeyValue()

This commit is contained in:
Roland Gruber 2015-03-15 17:38:03 +00:00
parent 7028ac28e4
commit 828bc5c638
4 changed files with 12 additions and 13 deletions

View File

@ -594,8 +594,7 @@ class posixGroup extends baseModule implements passwordService {
$members[] = $entry['uid'][0];
}
}
sort($members);
$return[get_class($this) . '_memberUidPrimary'] = array('<block><key>' . _('Group members') . '</key><value>' . implode(', ', $members) . '</value></block>');
$this->addPDFKeyValue($return, 'memberUidPrimary', _('Group members'), $members);
}
return $return;
}

View File

@ -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('<block><key>' . _('Group scope') . '</key><value>' . $groupScope . '</value></block>');
$return[get_class($this) . '_groupType'] = array('<block><key>' . _('Group type') . '</key><value>' . $groupType . '</value></block>');
$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('<block><key>' . _('Managed by') . '</key><value>' . $managedBy . '</value></block>');
$this->addPDFKeyValue($return, 'managedBy', _('Managed by'), $managedBy);
}
// members
if (sizeof($this->attributes['member']) > 0) {

View File

@ -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('<block><key>' . _('Managed by') . '</key><value>' . $managedBy . '</value></block>');
$this->addPDFKeyValue($return, 'managedBy', _('Managed by'), $managedBy);
}
return $return;
}

View File

@ -1619,22 +1619,22 @@ class windowsUser extends baseModule implements passwordService {
if ($this->isDeactivated($this->attributes)) {
$deactivated = _('yes');
}
$return[get_class($this) . '_deactivated'] = array('<block><key>' . _('Account is deactivated') . '</key><value>' . $deactivated . '</value></block>');
$this->addPDFKeyValue($return, 'deactivated', _('Account is deactivated'), $deactivated);
$noExpire = _('no');
if ($this->isNeverExpiring($this->attributes)) {
$noExpire = _('yes');
}
$return[get_class($this) . '_noExpire'] = array('<block><key>' . _('Password does not expire') . '</key><value>' . $noExpire . '</value></block>');
$this->addPDFKeyValue($return, 'noExpire', _('Password does not expire'), $noExpire);
$requireCard = _('no');
if ($this->isSmartCardRequired($this->attributes)) {
$requireCard = _('yes');
}
$return[get_class($this) . '_requireCard'] = array('<block><key>' . _('Require smartcard') . '</key><value>' . $requireCard . '</value></block>');
$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('<block><key>' . _('Password change at next login') . '</key><value>' . $pwdMustChange . '</value></block>');
$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('<block><key>' . _('Groups') . '</key><value>' . implode(', ', $groups) . '</value></block>');
$this->addPDFKeyValue($return, 'groups', _('Groups'), $groups);
// password
if (isset($this->clearTextPassword)) {
$return['windowsUser_password'] = array('<block><key>' . _('Password') . '</key><value>' . $this->clearTextPassword . '</value></block>');
$this->addPDFKeyValue($return, 'password', _('Password'), $this->clearTextPassword);
}
else if (isset($this->attributes['INFO.userPasswordClearText'])) {
$return['windowsUser_password'] = array('<block><key>' . _('Password') . '</key><value>' . $this->attributes['INFO.userPasswordClearText'] . '</value></block>');
$this->addPDFKeyValue($return, 'password', _('Password'), $this->attributes['INFO.userPasswordClearText']);
}
return $return;
}