use type filters when searching for groups (bug 165)
This commit is contained in:
parent
59ad00f9d2
commit
85fa2b8bf0
|
@ -1052,7 +1052,16 @@ class posixGroup extends baseModule implements passwordService {
|
||||||
if ($this->cachedUserToGIDList != null) {
|
if ($this->cachedUserToGIDList != null) {
|
||||||
return $this->cachedUserToGIDList;
|
return $this->cachedUserToGIDList;
|
||||||
}
|
}
|
||||||
$result = searchLDAPByAttribute('gidNumber', '*', 'posixAccount', array('uid', 'gidNumber', 'cn'), array('user'));
|
$typeSettings = $_SESSION['config']->get_typeSettings();
|
||||||
|
$filter = '(&(objectClass=posixAccount)(gidNumber=*))';
|
||||||
|
if (!empty($typeSettings['filter_user'])) {
|
||||||
|
$typeFilter = $typeSettings['filter_user'];
|
||||||
|
if (strpos($typeFilter, '(') !== 0) {
|
||||||
|
$typeFilter = '(' . $typeFilter . ')';
|
||||||
|
}
|
||||||
|
$filter = '(&' . $filter . $typeFilter . ')';
|
||||||
|
}
|
||||||
|
$result = searchLDAPByFilter($filter, array('uid', 'gidNumber', 'cn'), array('user'));
|
||||||
$this->cachedUserToGIDList = array();
|
$this->cachedUserToGIDList = array();
|
||||||
$resultCount = sizeof($result);
|
$resultCount = sizeof($result);
|
||||||
for ($i = 0; $i < $resultCount; $i++) {
|
for ($i = 0; $i < $resultCount; $i++) {
|
||||||
|
|
Loading…
Reference in New Issue