diff --git a/lam/lib/modules/sambaSamAccount.inc b/lam/lib/modules/sambaSamAccount.inc index 1e924379..ac6d7670 100644 --- a/lam/lib/modules/sambaSamAccount.inc +++ b/lam/lib/modules/sambaSamAccount.inc @@ -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('' . _('Display name') . '' . $this->attributes['displayName'][0] . ''); - } - if (isset($this->attributes['sambaHomeDrive'][0])) { - $return['sambaSamAccount_sambaHomePath'] = array('' . _('Home path') . '' . $this->attributes['sambaHomeDrive'][0] . ''); - } - if (isset($this->attributes['sambaHomePath'][0])) { - $return['sambaSamAccount_sambaHomeDrive'] = array('' . _('Home drive') . '' . $this->attributes['sambaHomePath'][0] . ''); - } - if (isset($this->attributes['sambaLogonScript'][0])) { - $return['sambaSamAccount_sambaLogonScript'] = array('' . _('Logon script') . '' . $this->attributes['sambaLogonScript'][0] . ''); - } - if (isset($this->attributes['sambaProfilePath'][0])) { - $return['sambaSamAccount_sambaProfilePath'] = array('' . _('Profile path') . '' . $this->attributes['sambaProfilePath'][0] . ''); - } - if (isset($this->attributes['sambaUserWorkstations'][0])) { - $return['sambaSamAccount_sambaUserWorkstations'] = array('' . _('Samba workstations') . '' . $this->attributes['sambaUserWorkstations'][0] . ''); - } - if (isset($this->attributes['sambaDomainName'][0])) { - $return['sambaSamAccount_sambaDomainName'] = array('' . _('Domain') . '' . $this->attributes['sambaDomainName'][0] . ''); - } - if (isset($this->attributes['sambaPrimaryGroupSID'][0])) { - $return['sambaSamAccount_sambaPrimaryGroupSID'] = array('' . _('Windows group') . '' . $this->attributes['sambaPrimaryGroupSID'][0] . ''); - } + $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(); diff --git a/lam/lib/modules/shadowAccount.inc b/lam/lib/modules/shadowAccount.inc index eebd9800..64af90e3 100644 --- a/lam/lib/modules/shadowAccount.inc +++ b/lam/lib/modules/shadowAccount.inc @@ -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('' . _('Last password change') . '' . $shadowLastChange . ''), - 'shadowAccount_shadowWarning' => array('' . _('Password warning') . '' . $shadowWarn . ''), - 'shadowAccount_shadowInactive' => array('' . _('Password expiration') . '' . $shadowInactive . ''), + $return = array('shadowAccount_shadowLastChange' => array('' . _('Last password change') . '' . $shadowLastChange . ''), 'shadowAccount_shadowExpire' => array('' . _('Account expiration date') . '' . $shadowExpire . ''), - 'shadowAccount_shadowMinAge' => array('' . _('Minimum password age') . '' . $shadowMin . ''), - 'shadowAccount_shadowMaxAge' => array('' . _('Maximum password age') . '' . $shadowMax . ''), ); + $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; } /**