diff --git a/lam/HISTORY b/lam/HISTORY
index dfd986b6..4f457c11 100644
--- a/lam/HISTORY
+++ b/lam/HISTORY
@@ -1,3 +1,7 @@
+September 2019
+ - Group account types can show member+owner count in list view
+
+
02.07.2019 6.8
- Parallel editing of multiple entries in different browser tabs supported
- LAM supports the progressive web app standard which allows to install LAM as an icon on home screen
diff --git a/lam/docs/manual-sources/chapter-modules.xml b/lam/docs/manual-sources/chapter-modules.xml
index ea2ff5c7..fa085a4c 100644
--- a/lam/docs/manual-sources/chapter-modules.xml
+++ b/lam/docs/manual-sources/chapter-modules.xml
@@ -2259,8 +2259,8 @@ AuthorizedKeysCommandUser root
Configuration
- Please add the account type "Groups" and then select account
- module "Unix (posixGroup)".
+ Special Please add the account type "Groups" and then select
+ account module "Unix (posixGroup)".
@@ -2270,6 +2270,43 @@ AuthorizedKeysCommandUser root
+ Virtual list attributes:
+
+
+
+
+
+ The following virtual attributes can be shown in the group list.
+ These are no real LDAP attributes but extra data that can be shown by
+ LAM.
+
+
+
+ memberuid_count: number of entries in attribute
+ "memberuid"
+
+
+
+ member_count: number of entries in attribute "member"
+
+
+
+ uniqueMember_count: number of entries in attribute
+ "uniquemember"
+
+
+
+ owner_count: number of entries in attribute "owner"
+
+
+
+ roleOccupant_count: number of entries in attribute
+ "roleOccupant"
+
+
+
+ Module settings:
+
GID generator: LAM will suggest GID numbers for your accounts.
Please note that it may happen that there are duplicate IDs assigned if
users create groups at the same time. Use an
+ Virtual list attributes:
+
+
+
+
+
+ The following virtual attributes can be shown in the group list.
+ These are no real LDAP attributes but extra data that can be shown by
+ LAM.
+
+
+
+ member_count: number of entries in attribute "member"
+
+
+
+ uniqueMember_count: number of entries in attribute
+ "uniquemember"
+
+
+
+ owner_count: number of entries in attribute "owner"
+
+
+
+ roleOccupant_count: number of entries in attribute
+ "roleOccupant"
+
+
+
+ Module settings:
+
On the module settings tab you set some options like the display
format for members/owners and if fields like description should not be
displayed.
diff --git a/lam/docs/manual-sources/images/mod_gon.png b/lam/docs/manual-sources/images/mod_gon.png
new file mode 100644
index 00000000..bae0276e
Binary files /dev/null and b/lam/docs/manual-sources/images/mod_gon.png differ
diff --git a/lam/docs/manual-sources/images/mod_unixGroupConfig2.png b/lam/docs/manual-sources/images/mod_unixGroupConfig2.png
new file mode 100644
index 00000000..6b27c10c
Binary files /dev/null and b/lam/docs/manual-sources/images/mod_unixGroupConfig2.png differ
diff --git a/lam/lib/types/group.inc b/lam/lib/types/group.inc
index fb1941fd..a20910b7 100644
--- a/lam/lib/types/group.inc
+++ b/lam/lib/types/group.inc
@@ -3,7 +3,7 @@ use \LAM\TYPES\TypeManager;
/*
This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/)
- Copyright (C) 2005 - 2018 Roland Gruber
+ Copyright (C) 2005 - 2019 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
@@ -115,7 +115,12 @@ class group extends baseType {
"roleOccupant" => _("Role member DNs"),
"uniqueMember" => _("Group member DNs"),
"memberUrl" => _("Entries"),
- ));
+ 'memberuid_count' => _('Member count'),
+ 'member_count' => _('Member count'),
+ 'uniqueMember_count' => _('Member count'),
+ 'owner_count' => _('Owner count'),
+ 'roleOccupant_count' => _('Member count')
+ ));
if ($this->getType() != null) {
$modules = $this->getType()->getModules();
if (in_array('organizationalRole', $modules)) {
@@ -279,8 +284,9 @@ class lamGroupList extends lamList {
parent::listGetParams();
// generate list primary group memebers
// after parent::listGetParams is $this->refresh set to correct value
- if ($this->include_primary && !$this->refresh && ($this->refresh_primary || (sizeof($this->primary_hash) == 0)))
+ if ($this->include_primary && !$this->refresh && ($this->refresh_primary || (sizeof($this->primary_hash) == 0))) {
$this->groupRefreshPrimary();
+ }
}
/**
@@ -288,6 +294,7 @@ class lamGroupList extends lamList {
* @see lamList::getTableCellContent()
*/
protected function getTableCellContent(&$entry, &$attribute) {
+ $countAttributes = array('memberuid_count', 'member_count', 'uniqueMember_count', 'owner_count', 'roleOccupant_count');
if ($attribute == "memberuid") {
// $gid is used for linking primary group memebers
$gid = -1;
@@ -360,12 +367,10 @@ class lamGroupList extends lamList {
for ($i = 0; $i < $count; $i++) {
$replaced = false;
foreach ($this->suffixList as $suffix => $type) {
- if (stripos($values[$i], $suffix) > 0) {
- if (!isAccountTypeHidden($type)) {
- $values[$i] = '' . getAbstractDN($values[$i]) . '';
- $replaced = true;
- break;
- }
+ if ((stripos($values[$i], $suffix) > 0) && !isAccountTypeHidden($type)) {
+ $values[$i] = '' . getAbstractDN($values[$i]) . '';
+ $replaced = true;
+ break;
}
}
if (!$replaced) {
@@ -374,6 +379,15 @@ class lamGroupList extends lamList {
}
return new htmlDiv(null, new htmlOutputText(implode('
', $values), false), array('rightToLeftText'));
}
+ elseif (in_array_ignore_case($attribute, $countAttributes)) {
+ $count = 0;
+ $realAttributeName = str_replace('_count', '', $attribute);
+ $values = &$entry[$realAttributeName];
+ if (!empty($values)) {
+ $count = sizeof($values);
+ }
+ return new htmlOutputText($count);
+ }
// print all other attributes
else {
return parent::getTableCellContent($entry, $attribute);