equal
deleted
inserted
replaced
351 return false; |
351 return false; |
352 } |
352 } |
353 |
353 |
354 return ldap_delete($_ldapconn, ldap_make_group_dn($cn)); |
354 return ldap_delete($_ldapconn, ldap_make_group_dn($cn)); |
355 } |
355 } |
|
356 |
|
357 /** |
|
358 * Is the given username in the specified LDAP group? |
|
359 * @param string username |
|
360 * @param string Group name |
|
361 * @return bool |
|
362 */ |
|
363 |
|
364 function ldap_test_group_membership($username, $group) |
|
365 { |
|
366 global $_ldapconn, $ldap_group_basedn; |
|
367 |
|
368 $filter = sprintf('(&(memberUid=%s)(cn=%s)(objectClass=posixGroup))', ldap_escape($username), ldap_escape($group)); |
|
369 |
|
370 $result = ldap_search($_ldapconn, $ldap_group_basedn, $filter); |
|
371 return ldap_count_entries($_ldapconn, $result) > 0; |
|
372 } |