reduced PDF code

This commit is contained in:
Roland Gruber 2013-05-09 17:26:56 +00:00
parent e87af38aaa
commit 6449a78587
2 changed files with 17 additions and 46 deletions

View File

@ -1871,30 +1871,14 @@ class sambaSamAccount extends baseModule implements passwordService {
*/
function get_pdfEntries() {
$return = array();
if (isset($this->attributes['displayName'][0])) {
$return['sambaSamAccount_displayName'] = array('<block><key>' . _('Display name') . '</key><value>' . $this->attributes['displayName'][0] . '</value></block>');
}
if (isset($this->attributes['sambaHomeDrive'][0])) {
$return['sambaSamAccount_sambaHomePath'] = array('<block><key>' . _('Home path') . '</key><value>' . $this->attributes['sambaHomeDrive'][0] . '</value></block>');
}
if (isset($this->attributes['sambaHomePath'][0])) {
$return['sambaSamAccount_sambaHomeDrive'] = array('<block><key>' . _('Home drive') . '</key><value>' . $this->attributes['sambaHomePath'][0] . '</value></block>');
}
if (isset($this->attributes['sambaLogonScript'][0])) {
$return['sambaSamAccount_sambaLogonScript'] = array('<block><key>' . _('Logon script') . '</key><value>' . $this->attributes['sambaLogonScript'][0] . '</value></block>');
}
if (isset($this->attributes['sambaProfilePath'][0])) {
$return['sambaSamAccount_sambaProfilePath'] = array('<block><key>' . _('Profile path') . '</key><value>' . $this->attributes['sambaProfilePath'][0] . '</value></block>');
}
if (isset($this->attributes['sambaUserWorkstations'][0])) {
$return['sambaSamAccount_sambaUserWorkstations'] = array('<block><key>' . _('Samba workstations') . '</key><value>' . $this->attributes['sambaUserWorkstations'][0] . '</value></block>');
}
if (isset($this->attributes['sambaDomainName'][0])) {
$return['sambaSamAccount_sambaDomainName'] = array('<block><key>' . _('Domain') . '</key><value>' . $this->attributes['sambaDomainName'][0] . '</value></block>');
}
if (isset($this->attributes['sambaPrimaryGroupSID'][0])) {
$return['sambaSamAccount_sambaPrimaryGroupSID'] = array('<block><key>' . _('Windows group') . '</key><value>' . $this->attributes['sambaPrimaryGroupSID'][0] . '</value></block>');
}
$this->addSimplePDFField($return, 'displayName', _('Display name'));
$this->addSimplePDFField($return, 'sambaHomePath', _('Home path'));
$this->addSimplePDFField($return, 'sambaHomeDrive', _('Home drive'));
$this->addSimplePDFField($return, 'sambaLogonScript', _('Logon script'));
$this->addSimplePDFField($return, 'sambaProfilePath', _('Profile path'));
$this->addSimplePDFField($return, 'sambaUserWorkstations', _('Samba workstations'));
$this->addSimplePDFField($return, 'sambaDomainName', _('Domain'));
$this->addSimplePDFField($return, 'sambaPrimaryGroupSID', _('Windows group'));
// terminal server options
if (isset($this->attributes['sambaMungedDial'][0])) {
$mDial = new sambaMungedDial();

View File

@ -160,7 +160,9 @@ class shadowAccount extends baseModule implements passwordService {
'shadowLastChange' => _('Last password change'),
'shadowWarning' => _('Password warning'),
'shadowInactive' => _('Account inactive'),
'shadowExpire' => _('Password expiration')
'shadowExpire' => _('Password expiration'),
'shadowMinAge' => _('Minimum password age'),
'shadowMaxAge' => _('Maximum password age'),
);
// help Entries
$return['help'] = array (
@ -480,33 +482,18 @@ class shadowAccount extends baseModule implements passwordService {
if (isset($this->attributes['shadowLastChange'][0])) {
$shadowLastChange = date('d. m. Y',$this->attributes['shadowLastChange'][0]*24*3600);
}
$shadowWarn = '';
if (isset($this->attributes['shadowWarn'][0])) {
$shadowWarn = $this->attributes['shadowWarn'][0];
}
$shadowInactive = '';
if (isset($this->attributes['shadowInactive'][0])) {
$shadowInactive = $this->attributes['shadowInactive'][0];
}
$shadowExpire = '';
if (isset($this->attributes['shadowExpire'][0])) {
$shadowExpire = date('d. m. Y',$this->attributes['shadowExpire'][0]*24*3600);
}
$shadowMin = '';
if (isset($this->attributes['shadowMin'][0])) {
$shadowMin = $this->attributes['shadowMin'][0];
}
$shadowMax = '';
if (isset($this->attributes['shadowMax'][0])) {
$shadowMax = $this->attributes['shadowMax'][0];
}
return array('shadowAccount_shadowLastChange' => array('<block><key>' . _('Last password change') . '</key><value>' . $shadowLastChange . '</value></block>'),
'shadowAccount_shadowWarning' => array('<block><key>' . _('Password warning') . '</key><value>' . $shadowWarn . '</value><block>'),
'shadowAccount_shadowInactive' => array('<block><key>' . _('Password expiration') . '</key><value>' . $shadowInactive . '</value></block>'),
$return = array('shadowAccount_shadowLastChange' => array('<block><key>' . _('Last password change') . '</key><value>' . $shadowLastChange . '</value></block>'),
'shadowAccount_shadowExpire' => array('<block><key>' . _('Account expiration date') . '</key><value>' . $shadowExpire . '</value></block>'),
'shadowAccount_shadowMinAge' => array('<block><key>' . _('Minimum password age') . '</key><value>' . $shadowMin . '</value><block>'),
'shadowAccount_shadowMaxAge' => array('<block><key>' . _('Maximum password age') . '</key><value>' . $shadowMax . '</value><block>'),
);
$this->addSimplePDFField($return, 'shadowWarning', _('Password warning'));
$this->addSimplePDFField($return, 'shadowInactive', _('Password expiration'));
$this->addSimplePDFField($return, 'shadowMinAge', _('Minimum password age'), 'shadowMin');
$this->addSimplePDFField($return, 'shadowMaxAge', _('Maximum password age'), 'shadowMax');
return $return;
}
/**