diff --git a/lam/lib/modules/sambaDomain.inc b/lam/lib/modules/sambaDomain.inc index 07ca49fe..dad35263 100644 --- a/lam/lib/modules/sambaDomain.inc +++ b/lam/lib/modules/sambaDomain.inc @@ -3,7 +3,7 @@ $Id$ This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/) - Copyright (C) 2005 - 2012 Roland Gruber + Copyright (C) 2005 - 2013 Roland Gruber This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -631,30 +631,20 @@ class sambaDomain extends baseModule { */ function get_pdfEntries() { $return = array(); - if (sizeof($this->attributes['sambaDomainName']) > 0) { - $return['sambaDomain_domainName'][0] = '' . _('Domain name') . '' . implode(', ', $this->attributes['sambaDomainName']) . ''; - } - if (sizeof($this->attributes['sambaSID']) > 0) { - $return['sambaDomain_domainSID'][0] = '' . _('Domain SID') . '' . implode(', ', $this->attributes['sambaSID']) . ''; - } - if (sizeof($this->attributes['sambaNextRid']) > 0) { - $return['sambaDomain_nextRID'][0] = '' . _('Next RID') . '' . implode(', ', $this->attributes['sambaNextRid']) . ''; - } - if (sizeof($this->attributes['sambaNextUserRid']) > 0) { - $return['sambaDomain_nextUserRID'][0] = '' . _('Next user RID') . '' . implode(', ', $this->attributes['sambaNextUserRid']) . ''; - } - if (sizeof($this->attributes['sambaNextGroupRid']) > 0) { - $return['sambaDomain_nextGroupRID'][0] = '' . _('Next group RID') . '' . implode(', ', $this->attributes['sambaNextGroupRid']) . ''; - } - if (sizeof($this->attributes['sambaAlgorithmicRidBase']) > 0) { - $return['sambaDomain_RIDbase'][0] = '' . _('RID base') . '' . implode(', ', $this->attributes['sambaAlgorithmicRidBase']) . ''; - } - if (isset($this->attributes['sambaMinPwdLength'])) { - $return['sambaDomain_minPwdLength'][0] = '' . _('Minimal password length') . '' . implode(', ', $this->attributes['sambaMinPwdLength']) . ''; - } - if (isset($this->attributes['sambaPwdHistoryLength'])) { - $return['sambaDomain_pwdHistoryLength'][0] = '' . _('Password history length') . '' . implode(', ', $this->attributes['sambaPwdHistoryLength']) . ''; - } + $this->addSimplePDFField($return, 'domainName', _('Domain name'), 'sambaDomainName'); + $this->addSimplePDFField($return, 'domainSID', _('Domain SID'), 'sambaSID'); + $this->addSimplePDFField($return, 'nextRID', _('Next RID'), 'sambaNextRid'); + $this->addSimplePDFField($return, 'nextUserRID', _('Next user RID'), 'sambaNextUserRid'); + $this->addSimplePDFField($return, 'nextGroupRID', _('Next group RID'), 'sambaNextGroupRid'); + $this->addSimplePDFField($return, 'RIDbase', _('RID base'), 'sambaAlgorithmicRidBase'); + $this->addSimplePDFField($return, 'minPwdLength', _('Minimal password length'), 'sambaMinPwdLength'); + $this->addSimplePDFField($return, 'pwdHistoryLength', _('Password history length'), 'sambaPwdHistoryLength'); + $this->addSimplePDFField($return, 'lockoutThreshold', _('Lockout users after bad logon attempts'), 'sambaLockoutThreshold'); + $this->addSimplePDFField($return, 'minPwdAge', _('Minimum password age'), 'sambaMinPwdAge'); + $this->addSimplePDFField($return, 'maxPwdAge', _('Maximum password age'), 'sambaMaxPwdAge'); + $this->addSimplePDFField($return, 'lockoutDuration', _('Lockout duration'), 'sambaLockoutDuration'); + $this->addSimplePDFField($return, 'lockoutObservationWindow', _('Reset time after lockout'), 'sambaLockoutObservationWindow'); + if (isset($this->attributes['sambaLogonToChgPwd'])) { $logonToChgPwd = _('Off'); if ($this->attributes['sambaPwdHistoryLength'][0] == 2) $logonToChgPwd = _('On'); @@ -670,21 +660,6 @@ class sambaDomain extends baseModule { if ($this->attributes['sambaRefuseMachinePwdChange'][0] == 0) $refuseMachinePwdChange = _('On'); $return['sambaDomain_refuseMachinePwdChange'][0] = '' . _('Allow machine password changes') . '' . $refuseMachinePwdChange . ''; } - if (isset($this->attributes['sambaLockoutThreshold'][0])) { - $return['sambaDomain_lockoutThreshold'][0] = '' . _('Lockout users after bad logon attempts') . '' . $this->attributes['sambaLockoutThreshold'][0] . ''; - } - if (isset($this->attributes['sambaMinPwdAge'])) { - $return['sambaDomain_minPwdAge'][0] = '' . _('Minimum password age') . '' . implode(', ', $this->attributes['sambaMinPwdAge']) . ''; - } - if (isset($this->attributes['sambaMaxPwdAge'])) { - $return['sambaDomain_maxPwdAge'][0] = '' . _('Maximum password age') . '' . implode(', ', $this->attributes['sambaMaxPwdAge']) . ''; - } - if (isset($this->attributes['sambaLockoutDuration'])) { - $return['sambaDomain_lockoutDuration'][0] = '' . _('Lockout duration') . '' . implode(', ', $this->attributes['sambaLockoutDuration']) . ''; - } - if (isset($this->attributes['sambaLockoutObservationWindow'])) { - $return['sambaDomain_lockoutObservationWindow'][0] = '' . _('Reset time after lockout') . '' . implode(', ', $this->attributes['sambaLockoutObservationWindow']) . ''; - } return $return; } diff --git a/lam/lib/modules/sambaGroupMapping.inc b/lam/lib/modules/sambaGroupMapping.inc index 066adf22..5396fb9d 100644 --- a/lam/lib/modules/sambaGroupMapping.inc +++ b/lam/lib/modules/sambaGroupMapping.inc @@ -4,7 +4,7 @@ $Id$ This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/) Copyright (C) 2003 - 2006 Tilo Lutz - 2007 - 2012 Roland Gruber + 2007 - 2013 Roland Gruber This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -380,15 +380,13 @@ class sambaGroupMapping extends baseModule { * @return array list of possible PDF entries */ function get_pdfEntries() { - $displayName = ''; - if (isset($this->attributes['displayName'][0])) $displayName = $this->attributes['displayName'][0]; - return array( - 'sambaGroupMapping_gidNumber' => array('' . _('GID number') . '' . $this->attributes['gidNumber'][0] . ''), - 'sambaGroupMapping_sambaSID' => array('' . _('Windows group') . '' . $this->attributes['sambaSID'][0] . ''), - 'sambaGroupMapping_displayName' => array('' . _('Display name') . '' . $displayName . ''), - 'sambaGroupMapping_sambaGroupType' => array('' . _('Samba group type') . '' . $this->attributes['sambaGroupType'][0] . ''), - 'sambaGroupMapping_description' => array('' . _('Description') . '' . $this->attributes['description'][0] . '') - ); + $return = array(); + $this->addSimplePDFField($return, 'gidNumber', _('GID number')); + $this->addSimplePDFField($return, 'sambaSID', _('Windows group')); + $this->addSimplePDFField($return, 'displayName', _('Display name')); + $this->addSimplePDFField($return, 'sambaGroupType', _('Samba group type')); + $this->addSimplePDFField($return, 'description', _('Description')); + return $return; }