sc_ldap_users($filter = 'all', $attributes = array())
|
|
The sc_ldap_users() macro is used to retrieve information about users stored on an LDAP (Lightweight Directory Access Protocol) server.
With this function, it is possible to retrieve all attributes visible to the authenticated user or filter only those they are part of, allowing for efficient user and permission management.
Parameters
| Parameters |
Description |
filter |
Defines the scope of the search in LDAP. It can be:
"all" – Returns all information accessible to the authenticated user.
"member" – Returns only the attributes of the specified users. |
attributes |
An array containing the desired attributes for the query. If omitted, the function returns all attributes available to the authenticated user. |
Syntax
$users = sc_ldap_users( $filter = 'all', $attributes = array());
Expected Return
Array ( [0] => Array ( [sn] => Array ( [count] => 1 [0] => Newton )
[0] => sn [objectclass] => Array ( [count] => 4 [0] => inetOrgPerson [1] => organizationalPerson [2] => person [3] => top )
[1] => objectclass [uid] => Array ( [count] => 1 [0] => newton )
[2] => uid [mail] => Array ( [count] => 1 [0] => newton@ldap.forumsys.com )
[3] => mail [cn] => Array ( [count] => 1 [0] => Isaac Newton )
[4] => cn [count] => 5 [dn] => uid=newton,dc=example,dc=com ) )
|
|