use cleanLDAPResult()
This commit is contained in:
parent
23e36ba2cd
commit
9f5570482e
|
@ -190,9 +190,12 @@ class ddns extends baseModule {
|
||||||
$search = @ldap_search($ldap,$dn,"dhcpStatements=ddns-update-style interim", array(), 0, 0, 0, LDAP_DEREF_NEVER);
|
$search = @ldap_search($ldap,$dn,"dhcpStatements=ddns-update-style interim", array(), 0, 0, 0, LDAP_DEREF_NEVER);
|
||||||
if ($search) {
|
if ($search) {
|
||||||
$info = @ldap_get_entries($ldap,$search);
|
$info = @ldap_get_entries($ldap,$search);
|
||||||
if ($info && ($info['count'] > 0)) {
|
if ($info) {
|
||||||
|
$info = cleanLDAPResult($info);
|
||||||
|
if (sizeof($info) > 0) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -827,7 +827,8 @@ class kolabUser extends baseModule {
|
||||||
$sr = @ldap_search($_SESSION['ldapHandle'], escapeDN($this->selfServiceSettings->LDAPSuffix), '(&(objectClass=inetOrgPerson)(mail=*))', array('mail'), 0, 0, 0, LDAP_DEREF_NEVER);
|
$sr = @ldap_search($_SESSION['ldapHandle'], escapeDN($this->selfServiceSettings->LDAPSuffix), '(&(objectClass=inetOrgPerson)(mail=*))', array('mail'), 0, 0, 0, LDAP_DEREF_NEVER);
|
||||||
if ($sr) {
|
if ($sr) {
|
||||||
$result = ldap_get_entries($_SESSION['ldapHandle'], $sr);
|
$result = ldap_get_entries($_SESSION['ldapHandle'], $sr);
|
||||||
for ($i = 0; $i < $result['count']; $i++) {
|
$result = cleanLDAPResult($result);
|
||||||
|
for ($i = 0; $i < sizeof($result); $i++) {
|
||||||
$delegates[] = $result[$i]['mail'][0];
|
$delegates[] = $result[$i]['mail'][0];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -165,11 +165,8 @@ class lamGroupList extends lamList {
|
||||||
isset($this->primary_hash[$gid]) && is_array($this->primary_hash[$gid]) &&
|
isset($this->primary_hash[$gid]) && is_array($this->primary_hash[$gid]) &&
|
||||||
(sizeof($this->primary_hash[$gid]) > 0));
|
(sizeof($this->primary_hash[$gid]) > 0));
|
||||||
}
|
}
|
||||||
if ($use_primary) {
|
if (!$use_primary) {
|
||||||
if (isset($entry[$attribute]) && isset($entry[$attribute]['count'])) unset($entry[$attribute]['count']);
|
|
||||||
} else {
|
|
||||||
if (!isset($entry[$attribute]) || !is_array($entry[$attribute]) || (sizeof($entry[$attribute]) < 1)) return;
|
if (!isset($entry[$attribute]) || !is_array($entry[$attribute]) || (sizeof($entry[$attribute]) < 1)) return;
|
||||||
if (isset($entry[$attribute]['count'])) unset($entry[$attribute]['count']);
|
|
||||||
// sort array
|
// sort array
|
||||||
sort($entry[$attribute]);
|
sort($entry[$attribute]);
|
||||||
}
|
}
|
||||||
|
@ -250,8 +247,7 @@ class lamGroupList extends lamList {
|
||||||
if ($sr) {
|
if ($sr) {
|
||||||
$members = ldap_get_entries($_SESSION["ldap"]->server(), $sr);
|
$members = ldap_get_entries($_SESSION["ldap"]->server(), $sr);
|
||||||
ldap_free_result($sr);
|
ldap_free_result($sr);
|
||||||
// delete first array entry which is "count"
|
$members = cleanLDAPResult($members);
|
||||||
unset($members['count']);
|
|
||||||
for ($j = 0; $j < sizeof($members); $j++) {
|
for ($j = 0; $j < sizeof($members); $j++) {
|
||||||
$this->primary_hash[$gid][$j] = $members[$j]['uid'][0];
|
$this->primary_hash[$gid][$j] = $members[$j]['uid'][0];
|
||||||
}
|
}
|
||||||
|
|
|
@ -170,7 +170,7 @@ class lamUserList extends lamList {
|
||||||
$sr = @ldap_search($_SESSION["ldap"]->server(), escapeDN($grp_suffix), $filter, $attrs, 0, 0, 0, LDAP_DEREF_NEVER);
|
$sr = @ldap_search($_SESSION["ldap"]->server(), escapeDN($grp_suffix), $filter, $attrs, 0, 0, 0, LDAP_DEREF_NEVER);
|
||||||
if ($sr) {
|
if ($sr) {
|
||||||
$info = @ldap_get_entries($_SESSION["ldap"]->server(), $sr);
|
$info = @ldap_get_entries($_SESSION["ldap"]->server(), $sr);
|
||||||
unset($info['count']); // delete count entry
|
$info = cleanLDAPResult($info);
|
||||||
for ($i = 0; $i < sizeof($info); $i++) {
|
for ($i = 0; $i < sizeof($info); $i++) {
|
||||||
$this->trans_primary_hash[$info[$i]['gidnumber'][0]] = $info[$i]['cn'][0];
|
$this->trans_primary_hash[$info[$i]['gidnumber'][0]] = $info[$i]['cn'][0];
|
||||||
}
|
}
|
||||||
|
@ -186,7 +186,6 @@ class lamUserList extends lamList {
|
||||||
protected function listPrintTableCellContent(&$entry, &$attribute) {
|
protected function listPrintTableCellContent(&$entry, &$attribute) {
|
||||||
// check if there is something to display at all
|
// check if there is something to display at all
|
||||||
if (!isset($entry[$attribute]) || !is_array($entry[$attribute]) || (sizeof($entry[$attribute]) < 1)) return;
|
if (!isset($entry[$attribute]) || !is_array($entry[$attribute]) || (sizeof($entry[$attribute]) < 1)) return;
|
||||||
if (isset($entry[$attribute]['count'])) unset($entry[$attribute]['count']);
|
|
||||||
// translate GID to group name
|
// translate GID to group name
|
||||||
if (($attribute == "gidnumber") && ($this->trans_primary == "on")) {
|
if (($attribute == "gidnumber") && ($this->trans_primary == "on")) {
|
||||||
if (isset($this->trans_primary_hash[$entry[$attribute][0]])) {
|
if (isset($this->trans_primary_hash[$entry[$attribute][0]])) {
|
||||||
|
@ -205,7 +204,6 @@ class lamUserList extends lamList {
|
||||||
$tempEntry = @ldap_first_entry($_SESSION['ldap']->server(), $result);
|
$tempEntry = @ldap_first_entry($_SESSION['ldap']->server(), $result);
|
||||||
if ($tempEntry) {
|
if ($tempEntry) {
|
||||||
$binData = ldap_get_values_len($_SESSION['ldap']->server(), $tempEntry, $attribute);
|
$binData = ldap_get_values_len($_SESSION['ldap']->server(), $tempEntry, $attribute);
|
||||||
if (isset($binData['count'])) unset($binData['count']);
|
|
||||||
$entry[$attribute] = $binData;
|
$entry[$attribute] = $binData;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue