Overview  Package  Tree cmsdAm 0.8

cmsdAm

Class cmsdam_ldap

cmsdAm.cmsdam_ldap

class cmsdam_ldap

Yeah!! One of the things that make cmsdam: a cool Content Management System: LDAP support.

LDAP support in cmsdam is integrated in the users and group classes, so you don't need to call these methods from your sections. This is only for developers.

Class instance: $cms->ldap

Author:
dAm2K (Dino Ciuffetti) <dam2k@users.sourceforge.net>

Field Summary
public var$conf

You should not use this variable from your section.

public var$logs

You should not use this variable from your section.

public var$debug

You should not use this variable from your section.

public var$errors

You should not use this variable from your section.

public var$ldapcon

You should not use this variable from your section.

public var$ldapbind

You should not use this variable from your section.

Method Summary
public boolldap_ldapconnect

Makes the LDAP connection and bind.

public boolldap_not_implemented

Writes to debug and logs that the "$method" method is not implemented on LDAP and returns false.

public arrayldap_user_names

This api method returns an array with ALL the user names from LDAP!

public arrayldap_group_names

This api method returns an array with ALL the group names from LDAP!

public arrayldap_group_users_name

Returns an array with all the usernames in "$group" group

public strldap_user_email

Returns the email of the user "$username" from LDAP

public strldap_user_attr

Returns the given attribute of the user "$username" from LDAP (users tree)

public boolldap_user_exist

Returns True if the user "$username" exists in LDAP or False if don't.

public boolldap_user_add

Add a user into ldap.

public boolldap_group_add

Add a user into ldap group, or create a group if it does not exists.

public intldap_user_count

Returns the number of the users in LDAP!

public boolldap_user_delete

Delete a user from LDAP

public boolldap_group_del_user

Delete $username user from $groupname group in LDAP

public boolldap_user_check

Returns true if user credentials are valid in LDAP.

Field Detail

conf

public var $conf

You should not use this variable from your section.

Configuration class instance.


logs

public var $logs

You should not use this variable from your section.

Logging class instance.


debug

public var $debug

You should not use this variable from your section.

Debugging class instance.


errors

public var $errors

You should not use this variable from your section.

Error Handling class instance.


ldapcon

public var $ldapcon

You should not use this variable from your section.

This is the LDAP connection pointer.


ldapbind

public var $ldapbind

You should not use this variable from your section.

This is the LDAP bind pointer.

Method Detail

ldap_ldapconnect()

public bool ldap_ldapconnect()

Makes the LDAP connection and bind.

Returns False on errors and True on success.

Author:
dAm2K (Dino Ciuffetti) <dam2k@users.sourceforge.net>
Returns:
False on errors and True on success

ldap_not_implemented()

public bool ldap_not_implemented(str method)

Writes to debug and logs that the "$method" method is not implemented on LDAP and returns false.

Parameters:
method - The method name not valid for LDAP
Author:
dAm2K (Dino Ciuffetti) <dam2k@users.sourceforge.net>
Returns:
Always returns False

ldap_user_names()

public array ldap_user_names()

This api method returns an array with ALL the user names from LDAP!

Author:
dAm2K (Dino Ciuffetti) <dam2k@users.sourceforge.net>
Returns:
ALL the user names from LDAP

ldap_group_names()

public array ldap_group_names()

This api method returns an array with ALL the group names from LDAP!

Author:
dAm2K (Dino Ciuffetti) <dam2k@users.sourceforge.net>
Returns:
ALL the group names from LDAP

ldap_group_users_name()

public array ldap_group_users_name(str group)

Returns an array with all the usernames in "$group" group

Parameters:
group - The groupname you want users of
Author:
dAm2K (Dino Ciuffetti) <dam2k@users.sourceforge.net>
Returns:
ALL the user names from LDAP for group "$group"

ldap_user_email()

public str ldap_user_email(str username)

Returns the email of the user "$username" from LDAP

Parameters:
username - The username you want email of
Author:
dAm2K (Dino Ciuffetti) <dam2k@users.sourceforge.net>
Returns:
The email of the user "$username"

ldap_user_attr()

public str ldap_user_attr(str username,
                          str attribute)

Returns the given attribute of the user "$username" from LDAP (users tree)

Parameters:
username - The username you want to retrieve
attribute - The LDAP attribute you want to retrieve for the user "$username"
Author:
dAm2K (Dino Ciuffetti) <dam2k@users.sourceforge.net>
Returns:
The attribute "$attribute" of the user "$username"

ldap_user_exist()

public bool ldap_user_exist(str username)

Returns True if the user "$username" exists in LDAP or False if don't.

Parameters:
username - The username you want to know if it exists
Author:
dAm2K (Dino Ciuffetti) <dam2k@users.sourceforge.net>
Returns:
True or False

ldap_user_add()

public bool ldap_user_add(str username,
                          str useremail,
                          str userpassword)

Add a user into ldap.

Please check etc/ldap_user.php.

Parameters:
username - The username you want to add
useremail - The user email address
userpassword - The user's password
Author:
dAm2K (Dino Ciuffetti) <dam2k@users.sourceforge.net>
Returns:
True or False

ldap_group_add()

public bool ldap_group_add(str groupname,
                           str username)

Add a user into ldap group, or create a group if it does not exists.

Please check etc/ldap_user.php.

Parameters:
groupname - The groupname you want to create/add
username - The username you want to add to the group groupname
Author:
dAm2K (Dino Ciuffetti) <dam2k@users.sourceforge.net>
Returns:
True or False

ldap_user_count()

public int ldap_user_count()

Returns the number of the users in LDAP!

Author:
dAm2K (Dino Ciuffetti) <dam2k@users.sourceforge.net>
Returns:
Returns the number of the users in LDAP

ldap_user_delete()

public bool ldap_user_delete(str username)

Delete a user from LDAP

Parameters:
username - The username you want to delete from ldap
Author:
dAm2K (Dino Ciuffetti) <dam2k@users.sourceforge.net>
Returns:
Returns true on success or false on errors

ldap_group_del_user()

public bool ldap_group_del_user(str groupname,
                                str username)

Delete $username user from $groupname group in LDAP

Parameters:
groupname - The name of the group
username - The username you want to delete from the group in ldap
Author:
dAm2K (Dino Ciuffetti) <dam2k@users.sourceforge.net>
Returns:
False on error, True on success

ldap_user_check()

public bool ldap_user_check(str username,
                            str password)

Returns true if user credentials are valid in LDAP.

This is made doing LDAP bind.

Parameters:
username - The user you want to check
password - The password of the user
Author:
dAm2K (Dino Ciuffetti) <dam2k@users.sourceforge.net>
Returns:
True if user credentials are valid, False if NOT

Overview  Package  Tree cmsdAm 0.8