From 1a5fa4e41c8c4c4ec090845f1d15a2012987b761 Mon Sep 17 00:00:00 2001 From: Roland Gruber Date: Fri, 14 Jun 2024 21:36:26 +0200 Subject: [PATCH] refactoring --- lam/lib/types/asteriskExt.inc | 242 ++++++++++++------------ lam/lib/types/dhcp.inc | 107 ++++++----- lam/lib/types/group.inc | 62 +++--- lam/lib/types/host.inc | 50 ++--- lam/lib/types/kolabSharedFolderType.inc | 50 ++--- lam/lib/types/mailAlias.inc | 50 ++--- lam/lib/types/netgroup.inc | 50 ++--- lam/lib/types/pykotaBillingCodeType.inc | 50 ++--- lam/lib/types/pykotaPrinterType.inc | 50 ++--- lam/lib/types/smbDomain.inc | 50 ++--- lam/lib/types/user.inc | 52 ++--- 11 files changed, 407 insertions(+), 406 deletions(-) diff --git a/lam/lib/types/asteriskExt.inc b/lam/lib/types/asteriskExt.inc index aaec4936f..f78f9d08f 100644 --- a/lam/lib/types/asteriskExt.inc +++ b/lam/lib/types/asteriskExt.inc @@ -37,52 +37,52 @@ */ class asteriskExt extends baseType { - /** - * Constructs a new domain type object. - * - * @param ConfiguredType $type configuration - */ - public function __construct($type) { - parent::__construct($type); - $this->LABEL_CREATE_ANOTHER_ACCOUNT = _('Create another extension'); - $this->LABEL_BACK_TO_ACCOUNT_LIST = _('Back to extensions list'); - } - - /** - * Returns the alias name of this account type. - * - * @return string alias name - */ - function getAlias() { - return _("Asterisk extensions"); - } - - /** - * Returns the description of this account type. - * - * @return string description - */ - function getDescription() { - return _("Asterisk extensions entries"); - } - - /** - * Returns the class name for the list object. - * - * @return string class name - */ - function getListClassName() { - return "lamAsteriskExtList"; - } - - /** - * Returns the default attribute list for this account type. - * - * @return string attribute list - */ - function getDefaultListAttributes() { - return "#AstExtension;#AstContext;#member"; - } + /** + * Constructs a new domain type object. + * + * @param ConfiguredType $type configuration + */ + public function __construct($type) { + parent::__construct($type); + $this->LABEL_CREATE_ANOTHER_ACCOUNT = _('Create another extension'); + $this->LABEL_BACK_TO_ACCOUNT_LIST = _('Back to extensions list'); + } + + /** + * Returns the alias name of this account type. + * + * @return string alias name + */ + function getAlias() { + return _("Asterisk extensions"); + } + + /** + * Returns the description of this account type. + * + * @return string description + */ + function getDescription() { + return _("Asterisk extensions entries"); + } + + /** + * Returns the class name for the list object. + * + * @return string class name + */ + function getListClassName() { + return "lamAsteriskExtList"; + } + + /** + * Returns the default attribute list for this account type. + * + * @return string attribute list + */ + function getDefaultListAttributes() { + return "#AstExtension;#AstContext;#member"; + } /** * Returns the the title text for the title bar on the new/edit page. @@ -90,22 +90,22 @@ class asteriskExt extends baseType { * @param accountContainer $container account container * @return String title text */ - public function getTitleBarTitle($container) { + public function getTitleBarTitle($container) { $attributes = null; if ($container->getAccountModule('asteriskExtension') != null) { $attributes = $container->getAccountModule('asteriskExtension')->getAttributes(); } // check if a common name is set - if (isset($attributes['AstExtension'][0])) { - return htmlspecialchars($attributes['AstExtension'][0]); - } - // new account - if ($container->isNewAccount) { - return _("New extension"); - } - // fall back to default - return parent::getTitleBarTitle($container); - } + if (isset($attributes['AstExtension'][0])) { + return htmlspecialchars($attributes['AstExtension'][0]); + } + // new account + if ($container->isNewAccount) { + return _("New extension"); + } + // fall back to default + return parent::getTitleBarTitle($container); + } } @@ -118,74 +118,74 @@ class asteriskExt extends baseType { */ class lamAsteriskExtList extends lamList { - /** - * Constructor - * - * @param string $type account type - * @return lamList list object - */ - function __construct($type) { - parent::__construct($type); - $this->labels = [ - 'nav' => _("Extension count: %s"), - 'error_noneFound' => _("No Asterisk extensions found."), - 'newEntry' => _("New extension"), - 'deleteEntry' => _("Delete selected extensions") - ]; - } - - /** - * Forces the list view to show only specific attributes. + /** + * Constructor + * + * @param string $type account type + * @return lamList list object + */ + function __construct($type) { + parent::__construct($type); + $this->labels = [ + 'nav' => _("Extension count: %s"), + 'error_noneFound' => _("No Asterisk extensions found."), + 'newEntry' => _("New extension"), + 'deleteEntry' => _("Delete selected extensions") + ]; + } + + /** + * Forces the list view to show only specific attributes. * - * @see lamList::listGetParams() - */ - protected function listGetParams() { - // check if only PDF should be shown - parent::listGetParams(); - $this->attrArray = ["astextension", "astcontext", "member"]; - $this->descArray = [_("Extension name"), _("Account context"), _("Owner")]; - } - - /** - * Groups the extensions. - * - * (non-PHPdoc) - * @see lamList::listRefreshData() - */ - protected function listRefreshData() { - // configure search filter - $module_filter = get_ldap_filter($this->type->getId()); // basic filter is provided by modules - $filter = "(&" . $module_filter . $this->buildLDAPAttributeFilter() . ")"; - $attrs = $this->attrArray; - $attrs[] = "astpriority"; - $entries = searchLDAP($this->suffix, $filter, $attrs); - $lastError = getLastLDAPError(); - if ($lastError != null) { - call_user_func_array('StatusMessage', $lastError); - } - - $this->ldapEntries = $this->normalizeLdapOutput($entries); - $this->entries = []; + * @see lamList::listGetParams() + */ + protected function listGetParams() { + // check if only PDF should be shown + parent::listGetParams(); + $this->attrArray = ["astextension", "astcontext", "member"]; + $this->descArray = [_("Extension name"), _("Account context"), _("Owner")]; + } + + /** + * Groups the extensions. + * + * (non-PHPdoc) + * @see lamList::listRefreshData() + */ + protected function listRefreshData() { + // configure search filter + $module_filter = get_ldap_filter($this->type->getId()); // basic filter is provided by modules + $filter = "(&" . $module_filter . $this->buildLDAPAttributeFilter() . ")"; + $attrs = $this->attrArray; + $attrs[] = "astpriority"; + $entries = searchLDAP($this->suffix, $filter, $attrs); + $lastError = getLastLDAPError(); + if ($lastError != null) { + call_user_func_array('StatusMessage', $lastError); + } + + $this->ldapEntries = $this->normalizeLdapOutput($entries); + $this->entries = []; foreach ($this->ldapEntries as $index => &$attrs) { $this->entries[$index] = &$attrs; } - // generate list of possible suffixes - $this->possibleSuffixes = $this->type->getSuffixList(); - } - - /** - * Groups the extensions. - * - * @param array $entries extension entries - */ - private function normalizeLdapOutput($entries) { - $filteredEntries = []; - foreach ($entries as $entry){ - if ($entry["astpriority"][0] == '1') { + // generate list of possible suffixes + $this->possibleSuffixes = $this->type->getSuffixList(); + } + + /** + * Groups the extensions. + * + * @param array $entries extension entries + */ + private function normalizeLdapOutput($entries) { + $filteredEntries = []; + foreach ($entries as $entry) { + if ($entry["astpriority"][0] == '1') { $filteredEntries[] = $entry; - } - } - return $filteredEntries; - } + } + } + return $filteredEntries; + } } diff --git a/lam/lib/types/dhcp.inc b/lam/lib/types/dhcp.inc index 5aeb4a3b3..b2ed96405 100644 --- a/lam/lib/types/dhcp.inc +++ b/lam/lib/types/dhcp.inc @@ -23,18 +23,17 @@ /** -* The account type for DHCP -* -* @package types -* @author Thomas Manninger -**/ + * The account type for DHCP + * + * @package types + * @author Thomas Manninger + **/ /** -* The account type for DHCP -* -* @package types -**/ - + * The account type for DHCP + * + * @package types + **/ class dhcp extends baseType { /** @@ -49,19 +48,19 @@ class dhcp extends baseType { } /** - * Returns the alias name of this account type. - * - * @return string alias name - */ + * Returns the alias name of this account type. + * + * @return string alias name + */ public function getAlias() { return _("DHCP"); } /** - * Returns the description of this account type. - * - * @return string description - */ + * Returns the description of this account type. + * + * @return string description + */ public function getDescription() { return _("DHCP administration"); } @@ -74,20 +73,20 @@ class dhcp extends baseType { } /** - * Returns the class name for the list object. - * - * @return string class name - */ + * Returns the class name for the list object. + * + * @return string class name + */ public function getListClassName() { return "lamDHCPList"; } /** - * Returns the default attribute list for this account type. - * - * @return string attribute list - */ - public function getDefaultListAttributes() { + * Returns the default attribute list for this account type. + * + * @return string attribute list + */ + public function getDefaultListAttributes() { return "#cn;#dhcpRange;#fixed_ips"; } @@ -203,26 +202,26 @@ class lamDHCPList extends lamList { } return false; } - elseif ($filterAttribute === "dhcprange") { - if (isset($data['dhcprange'])) { - foreach ($data['dhcprange'] as $range) { - if (preg_match($regex, $range)) { - return true; - } - } - } - $pooledRanges = searchLDAP($data['dn'], '(objectclass=dhcpPool)', ['dhcprange']); - foreach ($pooledRanges as $pooledRange) { - if (empty($pooledRange['dhcprange'])) { - continue; - } - foreach ($pooledRange['dhcprange'] as $range) { - if (preg_match($regex, $range)) { - return true; - } - } - } - } + elseif ($filterAttribute === "dhcprange") { + if (isset($data['dhcprange'])) { + foreach ($data['dhcprange'] as $range) { + if (preg_match($regex, $range)) { + return true; + } + } + } + $pooledRanges = searchLDAP($data['dn'], '(objectclass=dhcpPool)', ['dhcprange']); + foreach ($pooledRanges as $pooledRange) { + if (empty($pooledRange['dhcprange'])) { + continue; + } + foreach ($pooledRange['dhcprange'] as $range) { + if (preg_match($regex, $range)) { + return true; + } + } + } + } return parent::isFilterMatching($data, $filterAttribute, $regex); } @@ -245,12 +244,12 @@ class lamDHCPList extends lamList { */ function listDoPost() { $fragment = parent::listDoPost(); - if (isset($_POST['dhcpDefaults'])) { - metaRefresh("../account/edit.php?type=" . $this->type->getId() . "&DN='" . $this->type->getSuffix() . "'"); - die(); - } - else { - return $fragment; - } + if (isset($_POST['dhcpDefaults'])) { + metaRefresh("../account/edit.php?type=" . $this->type->getId() . "&DN='" . $this->type->getSuffix() . "'"); + die(); + } + else { + return $fragment; + } } } diff --git a/lam/lib/types/group.inc b/lam/lib/types/group.inc index 9c55e0ec8..be392a608 100644 --- a/lam/lib/types/group.inc +++ b/lam/lib/types/group.inc @@ -1,5 +1,7 @@ getType() != null) { - $modules = $this->getType()->getModules(); + $modules = $this->getType()->getModules(); if (in_array('organizationalRole', $modules)) { return _('Roles'); } @@ -70,10 +72,10 @@ class group extends baseType { } /** - * Returns the description of this account type. - * - * @return string description - */ + * Returns the description of this account type. + * + * @return string description + */ function getDescription() { return _("Group accounts (e.g. Unix and Samba)"); } @@ -86,19 +88,19 @@ class group extends baseType { } /** - * Returns the class name for the list object. - * - * @return string class name - */ + * Returns the class name for the list object. + * + * @return string class name + */ function getListClassName() { return "lamGroupList"; } /** - * Returns the default attribute list for this account type. - * - * @return string attribute list - */ + * Returns the default attribute list for this account type. + * + * @return string attribute list + */ function getDefaultListAttributes() { return "#cn;#gidNumber;#memberUID;#description"; } @@ -295,7 +297,7 @@ class lamGroupList extends lamList { $primaryvals = array_flip(array_values($primary_hash)); // test if group has some secondary members if (isset($entry[$attribute])) { - $attr = array_merge($primary_hash,$entry[$attribute]); + $attr = array_merge($primary_hash, $entry[$attribute]); } else { $attr = $primary_hash; @@ -366,7 +368,7 @@ class lamGroupList extends lamList { continue; } $gid = $this->ldapEntries[$i]['gidnumber'][0]; - $filter = "(&(&" . $module_filter . ")(gidNumber=" . $gid . "))"; + $filter = "(&(&" . $module_filter . ")(gidNumber=" . $gid . "))"; $entries = searchLDAPByFilter($filter, $attrs, [$scope]); for ($j = 0; $j < sizeof($entries); $j++) { $this->primary_hash[$gid][$j] = $entries[$j]['uid'][0]; @@ -392,7 +394,7 @@ class lamGroupList extends lamList { parent::listConfigurationChanged(); $tpOption = $this->listGetConfigOptionByID(self::TRANS_PRIMARY_OPTION_NAME); $use_primary = $this->include_primary; - $this->include_primary = $tpOption->isSelected(); + $this->include_primary = $tpOption->isSelected(); if (!$use_primary && $this->include_primary) { $this->refresh_primary = true; } diff --git a/lam/lib/types/host.inc b/lam/lib/types/host.inc index 8f8312176..8f40cefc6 100644 --- a/lam/lib/types/host.inc +++ b/lam/lib/types/host.inc @@ -21,17 +21,17 @@ */ /** -* The account type for host accounts (e.g. Samba). -* -* @package types -* @author Roland Gruber -*/ + * The account type for host accounts (e.g. Samba). + * + * @package types + * @author Roland Gruber + */ /** -* The account type for host accounts (e.g. Samba). -* -* @package types -*/ + * The account type for host accounts (e.g. Samba). + * + * @package types + */ class host extends baseType { /** @@ -46,19 +46,19 @@ class host extends baseType { } /** - * Returns the alias name of this account type. - * - * @return string alias name - */ + * Returns the alias name of this account type. + * + * @return string alias name + */ function getAlias() { return _("Hosts"); } /** - * Returns the description of this account type. - * - * @return string description - */ + * Returns the description of this account type. + * + * @return string description + */ function getDescription() { return _("Host accounts (e.g. Samba)"); } @@ -71,19 +71,19 @@ class host extends baseType { } /** - * Returns the class name for the list object. - * - * @return string class name - */ + * Returns the class name for the list object. + * + * @return string class name + */ function getListClassName() { return "lamHostList"; } /** - * Returns the default attribute list for this account type. - * - * @return string attribute list - */ + * Returns the default attribute list for this account type. + * + * @return string attribute list + */ function getDefaultListAttributes() { return "#cn;#description;#uidNumber;#gidNumber"; } diff --git a/lam/lib/types/kolabSharedFolderType.inc b/lam/lib/types/kolabSharedFolderType.inc index 8f734c9e8..d95770d2d 100644 --- a/lam/lib/types/kolabSharedFolderType.inc +++ b/lam/lib/types/kolabSharedFolderType.inc @@ -21,17 +21,17 @@ */ /** -* The account type for Kolab shared folders. -* -* @package types -* @author Roland Gruber -*/ + * The account type for Kolab shared folders. + * + * @package types + * @author Roland Gruber + */ /** -* The account type for Kolab shared folders. -* -* @package types -*/ + * The account type for Kolab shared folders. + * + * @package types + */ class kolabSharedFolderType extends baseType { /** @@ -46,37 +46,37 @@ class kolabSharedFolderType extends baseType { } /** - * Returns the alias name of this account type. - * - * @return string alias name - */ + * Returns the alias name of this account type. + * + * @return string alias name + */ function getAlias() { return _("Kolab shared folders"); } /** - * Returns the description of this account type. - * - * @return string description - */ + * Returns the description of this account type. + * + * @return string description + */ function getDescription() { return _("Kolab shared folders (e.g. mail folders)"); } /** - * Returns the class name for the list object. - * - * @return string class name - */ + * Returns the class name for the list object. + * + * @return string class name + */ function getListClassName() { return "kolabSharedFolderTypeList"; } /** - * Returns the default attribute list for this account type. - * - * @return string attribute list - */ + * Returns the default attribute list for this account type. + * + * @return string attribute list + */ function getDefaultListAttributes() { return "#cn;#kolabDelegate;#alias"; } diff --git a/lam/lib/types/mailAlias.inc b/lam/lib/types/mailAlias.inc index 21dee7ad4..5742c89dc 100644 --- a/lam/lib/types/mailAlias.inc +++ b/lam/lib/types/mailAlias.inc @@ -21,17 +21,17 @@ */ /** -* The account type for mail aliases. -* -* @package types -* @author Roland Gruber -*/ + * The account type for mail aliases. + * + * @package types + * @author Roland Gruber + */ /** -* The account type for mail aliases. -* -* @package types -*/ + * The account type for mail aliases. + * + * @package types + */ class mailAlias extends baseType { /** @@ -46,19 +46,19 @@ class mailAlias extends baseType { } /** - * Returns the alias name of this account type. - * - * @return string alias name - */ + * Returns the alias name of this account type. + * + * @return string alias name + */ function getAlias() { return _("Mail aliases"); } /** - * Returns the description of this account type. - * - * @return string description - */ + * Returns the description of this account type. + * + * @return string description + */ function getDescription() { return _("Mailing aliases (e.g. NIS mail aliases)"); } @@ -71,19 +71,19 @@ class mailAlias extends baseType { } /** - * Returns the class name for the list object. - * - * @return string class name - */ + * Returns the class name for the list object. + * + * @return string class name + */ function getListClassName() { return "lamMailAliasList"; } /** - * Returns the default attribute list for this account type. - * - * @return string attribute list - */ + * Returns the default attribute list for this account type. + * + * @return string attribute list + */ function getDefaultListAttributes() { return "#cn;#rfc822MailMember"; } diff --git a/lam/lib/types/netgroup.inc b/lam/lib/types/netgroup.inc index 8c71c6cec..7f67199be 100644 --- a/lam/lib/types/netgroup.inc +++ b/lam/lib/types/netgroup.inc @@ -21,17 +21,17 @@ */ /** -* The account type for NIS netgroups. -* -* @package types -* @author Roland Gruber -*/ + * The account type for NIS netgroups. + * + * @package types + * @author Roland Gruber + */ /** -* The account type for NIS netgroups. -* -* @package types -*/ + * The account type for NIS netgroups. + * + * @package types + */ class netgroup extends baseType { /** @@ -46,19 +46,19 @@ class netgroup extends baseType { } /** - * Returns the alias name of this account type. - * - * @return string alias name - */ + * Returns the alias name of this account type. + * + * @return string alias name + */ function getAlias() { return _("NIS netgroups"); } /** - * Returns the description of this account type. - * - * @return string description - */ + * Returns the description of this account type. + * + * @return string description + */ function getDescription() { return _("NIS netgroup entries"); } @@ -71,19 +71,19 @@ class netgroup extends baseType { } /** - * Returns the class name for the list object. - * - * @return string class name - */ + * Returns the class name for the list object. + * + * @return string class name + */ function getListClassName() { return "lamNetgroupList"; } /** - * Returns the default attribute list for this account type. - * - * @return string attribute list - */ + * Returns the default attribute list for this account type. + * + * @return string attribute list + */ function getDefaultListAttributes() { return "#cn;#description;#memberNisNetgroup"; } diff --git a/lam/lib/types/pykotaBillingCodeType.inc b/lam/lib/types/pykotaBillingCodeType.inc index f158714d8..bbd4e5f2f 100644 --- a/lam/lib/types/pykotaBillingCodeType.inc +++ b/lam/lib/types/pykotaBillingCodeType.inc @@ -21,17 +21,17 @@ */ /** -* The account type for PyKota billing codes. -* -* @package types -* @author Roland Gruber -*/ + * The account type for PyKota billing codes. + * + * @package types + * @author Roland Gruber + */ /** -* The account type for PyKota billing codes. -* -* @package types -*/ + * The account type for PyKota billing codes. + * + * @package types + */ class pykotaBillingCodeType extends baseType { /** @@ -46,37 +46,37 @@ class pykotaBillingCodeType extends baseType { } /** - * Returns the alias name of this account type. - * - * @return string alias name - */ + * Returns the alias name of this account type. + * + * @return string alias name + */ function getAlias() { return _("Billing codes"); } /** - * Returns the description of this account type. - * - * @return string description - */ + * Returns the description of this account type. + * + * @return string description + */ function getDescription() { return _("PyKota billing codes"); } /** - * Returns the class name for the list object. - * - * @return string class name - */ + * Returns the class name for the list object. + * + * @return string class name + */ function getListClassName() { return "lamPykotaBillingCodeTypeList"; } /** - * Returns the default attribute list for this account type. - * - * @return string attribute list - */ + * Returns the default attribute list for this account type. + * + * @return string attribute list + */ function getDefaultListAttributes() { return "#cn;#description;#pykotaBalance;#pykotaPageCounter"; } diff --git a/lam/lib/types/pykotaPrinterType.inc b/lam/lib/types/pykotaPrinterType.inc index 29cda55af..de38b1e7a 100644 --- a/lam/lib/types/pykotaPrinterType.inc +++ b/lam/lib/types/pykotaPrinterType.inc @@ -21,17 +21,17 @@ */ /** -* The account type for PyKota printers. -* -* @package types -* @author Roland Gruber -*/ + * The account type for PyKota printers. + * + * @package types + * @author Roland Gruber + */ /** -* The account type for PyKota printers. -* -* @package types -*/ + * The account type for PyKota printers. + * + * @package types + */ class pykotaPrinterType extends baseType { /** @@ -46,37 +46,37 @@ class pykotaPrinterType extends baseType { } /** - * Returns the alias name of this account type. - * - * @return string alias name - */ + * Returns the alias name of this account type. + * + * @return string alias name + */ function getAlias() { return _("Printers"); } /** - * Returns the description of this account type. - * - * @return string description - */ + * Returns the description of this account type. + * + * @return string description + */ function getDescription() { return _("PyKota printers"); } /** - * Returns the class name for the list object. - * - * @return string class name - */ + * Returns the class name for the list object. + * + * @return string class name + */ function getListClassName() { return "lamPykotaPrinterTypeList"; } /** - * Returns the default attribute list for this account type. - * - * @return string attribute list - */ + * Returns the default attribute list for this account type. + * + * @return string attribute list + */ function getDefaultListAttributes() { return "#cn;#description;#pykotaPricePerPage;#pykotaPricePerJob;#pykotaMaxJobSize"; } diff --git a/lam/lib/types/smbDomain.inc b/lam/lib/types/smbDomain.inc index 04c9de82e..b3b814e29 100644 --- a/lam/lib/types/smbDomain.inc +++ b/lam/lib/types/smbDomain.inc @@ -21,17 +21,17 @@ */ /** -* The account type for Samba domains. -* -* @package types -* @author Roland Gruber -*/ + * The account type for Samba domains. + * + * @package types + * @author Roland Gruber + */ /** -* The account type for Samba domains. -* -* @package types -*/ + * The account type for Samba domains. + * + * @package types + */ class smbDomain extends baseType { /** @@ -46,19 +46,19 @@ class smbDomain extends baseType { } /** - * Returns the alias name of this account type. - * - * @return string alias name - */ + * Returns the alias name of this account type. + * + * @return string alias name + */ function getAlias() { return _("Samba domains"); } /** - * Returns the description of this account type. - * - * @return string description - */ + * Returns the description of this account type. + * + * @return string description + */ function getDescription() { return _("Samba 3 domain entries"); } @@ -71,19 +71,19 @@ class smbDomain extends baseType { } /** - * Returns the class name for the list object. - * - * @return string class name - */ + * Returns the class name for the list object. + * + * @return string class name + */ function getListClassName() { return "lamSmbDomainList"; } /** - * Returns the default attribute list for this account type. - * - * @return string attribute list - */ + * Returns the default attribute list for this account type. + * + * @return string attribute list + */ function getDefaultListAttributes() { return "#sambaDomainName;#sambaSID"; } diff --git a/lam/lib/types/user.inc b/lam/lib/types/user.inc index a4e203ceb..a28bb1bcf 100644 --- a/lam/lib/types/user.inc +++ b/lam/lib/types/user.inc @@ -22,17 +22,17 @@ */ /** -* The account type for user accounts (e.g. Unix, Samba and Kolab). -* -* @package types -* @author Roland Gruber -*/ + * The account type for user accounts (e.g. Unix, Samba and Kolab). + * + * @package types + * @author Roland Gruber + */ /** -* The account type for user accounts (e.g. Unix, Samba and Kolab). -* -* @package types -*/ + * The account type for user accounts (e.g. Unix, Samba and Kolab). + * + * @package types + */ class user extends baseType { /** @@ -47,19 +47,19 @@ class user extends baseType { } /** - * Returns the alias name of this account type. - * - * @return string alias name - */ + * Returns the alias name of this account type. + * + * @return string alias name + */ function getAlias() { return _("Users"); } /** - * Returns the description of this account type. - * - * @return string description - */ + * Returns the description of this account type. + * + * @return string description + */ function getDescription() { return _("User accounts (e.g. Unix, Samba and Kolab)"); } @@ -72,19 +72,19 @@ class user extends baseType { } /** - * Returns the class name for the list object. - * - * @return string class name - */ + * Returns the class name for the list object. + * + * @return string class name + */ function getListClassName() { return "lamUserList"; } /** - * Returns the default attribute list for this account type. - * - * @return string attribute list - */ + * Returns the default attribute list for this account type. + * + * @return string attribute list + */ function getDefaultListAttributes() { return "#uid;#givenName;#sn;#uidNumber;#gidNumber"; } @@ -126,7 +126,7 @@ class user extends baseType { } // check if first and last name can be shown if (($personalAttributes != null) && isset($personalAttributes['sn'][0]) && !empty($personalAttributes['sn'][0]) - && isset($personalAttributes['givenName'][0]) && !empty($personalAttributes['givenName'][0])) { + && isset($personalAttributes['givenName'][0]) && !empty($personalAttributes['givenName'][0])) { return $title . htmlspecialchars($personalAttributes['givenName'][0] . ' ' . $personalAttributes['sn'][0]); } // check if a display name is set