Functions

Get a list of usergroups on the LDAP server.

cns_get_all_ldap_groups() : array
package ldap

Returns

arrayThe list of user-groups (string).

(LDAP helper for cns_get_group_members_raw) Get a list of members in a group (or more full details if $non_validated is true).

cns_get_group_members_raw_ldap(array $members, \GROUP $group_id, boolean $include_primaries, boolean $non_validated, boolean $include_secondaries) 
package ldap

Parameters

$members

array

The list is written into this.

$group_id

\GROUP

The ID of the usergroup.

$include_primaries

boolean

Whether to include those in the usergroup as a primary member.

$non_validated

boolean

Whether to include those applied to join the usergroup, but not validated in.

$include_secondaries

boolean

Whether to include those in the usergroup as a secondary member.

Find the LDAP servers password for a certain member.

cns_get_ldap_hash(string $cn) : \?string
package ldap

Parameters

$cn

string

The username.

Returns

\?stringThe password (null: no such user).

(LDAP helper for cns_get_members_groups) Get a list of the usergroups a member is in (keys say the usergroups, values are irrelevant).

cns_get_members_groups_ldap(\?MEMBER $member_id) : array
package ldap

Parameters

$member_id

\?MEMBER

The member to find the usergroups of (null: current member).

Returns

arrayReverse list (e.g. array(1=>true,2=>true,3=>true) for someone in (1,2,3)).

Find the named LDAP usergroup for an Conversr ID. Note that the returned MAY NOT ACTUALLY EXIST!

cns_group_cnsid_to_ldapcn(\GROUP $id) : \?SHORT_TEXT
package ldap

Parameters

$id

\GROUP

The Conversr ID.

Returns

\?SHORT_TEXTThe named LDAP usergroup (null: none).

Find the Composr-ID for a named LDAP usergroup.

cns_group_ldapcn_to_cnsid(string $cn) : \?GROUP
package ldap

Parameters

$cn

string

The usergroup.

Returns

\?GROUPThe Composr-ID (null: none).

Find the LDAP ID for a named LDAP usergroup. POSIX Only.

cns_group_ldapcn_to_ldapgid(string $cn) : \?integer
package ldap

Parameters

$cn

string

The named LDAP usergroup.

Returns

\?integerThe LDAP usergroup ID (null: none).

Find the Composr-ID for an LDAP usergroup-ID. POSIX Only.

cns_group_ldapgid_to_cnsid(integer $gid) : \?GROUP
package ldap

Parameters

$gid

integer

The LDAP ID.

Returns

\?GROUPThe Composr-ID (null: could not find).

Find whether a member of a certain username WOULD be bound to LDAP authentication (an exceptional situation, only for sites that use it).

cns_is_ldap_member_potential(string $cn) : boolean
package ldap

Parameters

$cn

string

The username.

Returns

booleanThe answer.

Find whether a member exists on the LDAP server.

cns_is_on_ldap(\SHORT_TEXT $cn) : boolean
package ldap

Parameters

$cn

\SHORT_TEXT

The username.

Returns

booleanThe answer.

Performs the Conversr LDAP connection bind, used to do general querying (not a user login).

cns_ldap_bind() 
package ldap

Set up the Conversr LDAP connection.

cns_ldap_connect() 
package ldap

Get the primary usergroup of a member in LDAP.

cns_ldap_get_member_primary_group(\MEMBER $member_id) : \GROUP
package ldap

Parameters

$member_id

\MEMBER

The member.

Returns

\GROUPThe.

Get the e-mail of a member in LDAP.

cns_ldap_guess_email(\ID_TEXT $cn) : \SHORT_TEXT
package ldap

Parameters

$cn

\ID_TEXT

The CN of the member.

Returns

\SHORT_TEXTGuessed e-mail address (blank: couldn't find).

Convert a plain-text password into a hashed password.

cns_ldap_hash(string $cn, string $password) : string
package ldap

Parameters

$cn

string

The username (we use this to extract the hash algorithm being used by the member).

$password

string

The password.

Returns

stringThe hashed password.

Converts an active directory style long-CN to a short one.

cns_long_cn_to_short_cn(string $long, string $type) : string
package ldap

Parameters

$long

string

The long one.

$type

string

The type (e.g. CN, DN).

Returns

stringThe short one.

Find the LDAP username for a Composr member-ID.

cns_member_cnsid_to_ldapcn(integer $id) : \?SHORT_TEXT
package ldap

Parameters

$id

integer

The Composr member-ID.

Returns

\?SHORT_TEXTThe username (null: none).

Find the Composr member-ID for an LDAP username.

cns_member_ldapcn_to_cnsid(string $cn) : \?integer
package ldap

Parameters

$cn

string

The username.

Returns

\?integerThe Composr member-ID (null: none).

The LDAP class indicating a group.

get_group_class() : string
package ldap

Returns

stringThe property.

The LDAP group that maps to the first administrative group in Composr (db_get_first_id()+1).

get_mapped_admin_group() : string
package ldap

Returns

stringThe group.

The LDAP group that maps to the default Composr group.

get_mapped_users_group() : string
package ldap

Returns

stringThe group.

The LDAP class indicating an account.

get_member_class() : string
package ldap

Returns

stringThe property.

The group naming property LDAP will be using.

group_property() : string
package ldap

Returns

stringThe property.

Where in the LDAP hierarchy to search for members.

group_search_qualifier() : string
package ldap

Returns

stringThe property.

Escape, ready for an LDAP query.

ldap_escape(string $str, boolean $for_dn = false) : string
package ldap

Parameters

$str

string

The value.

$for_dn

boolean

Whether this is for use in a DN string.

Returns

stringThe escaped value.

Unescape data from LDAP. Technically this is not unescaping, it's just a character set conversion, but function is named to provide symmetry with ldap_escape which does both escaping and character set conversion.

ldap_unescape(string $str) : string
package ldap

Parameters

$str

string

The escaped value.

Returns

stringThe value.

The property in LDAP used for logins.

member_property() : string
package ldap

Returns

stringThe property.

Where in the LDAP hierarchy to search for groups.

member_search_qualifier() : string
package ldap

Returns

stringThe property.

Constants

 

LDAP_OPT_DIAGNOSTIC_MESSAGE

LDAP_OPT_DIAGNOSTIC_MESSAGE = 50 
package ldap