2017-08-08 03:01:11 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Class to interact with LDAP
|
|
|
|
*
|
2020-04-30 21:43:07 +08:00
|
|
|
* @author Denis CLAVIER <clavierd at gmail dot com>
|
2017-08-08 03:01:11 +08:00
|
|
|
*/
|
|
|
|
interface LDAPInterface
|
|
|
|
{
|
2020-04-30 21:43:07 +08:00
|
|
|
/**
|
|
|
|
* @param string @user
|
|
|
|
* A ldap username or email or sAMAccountName
|
|
|
|
* @param string @password
|
|
|
|
* An optional password linked to the user, if not provided an anonymous bind is attempted
|
|
|
|
* @param string @ldap_search_attribute
|
|
|
|
* The attribute used on your LDAP to identify user (uid, email, cn, sAMAccountName)
|
|
|
|
* @param string @ldap_filter
|
|
|
|
* An optional filter to search in LDAP (ex : objectClass = person).
|
|
|
|
* @param string @ldap_base_dn
|
|
|
|
* The LDAP base DN.
|
|
|
|
* @param string @ldap_bind_dn
|
|
|
|
* The directory name of a service user to bind before search. Must be a user with read permission on LDAP.
|
|
|
|
* @param string @ldap_bind_pass
|
|
|
|
* The password associated to the service user to bind before search.
|
|
|
|
*
|
|
|
|
* @return
|
|
|
|
* TRUE if the user is identified and can access to the LDAP server
|
|
|
|
* and FALSE if it isn't
|
|
|
|
*/
|
|
|
|
public function checkLogin($user, $password = null, $ldap_search_attribute, $ldap_filter = null, $ldap_base_dn, $ldap_bind_dn, $ldap_bind_pass);
|
2017-08-08 03:01:11 +08:00
|
|
|
|
|
|
|
/**
|
2019-05-02 20:51:50 +08:00
|
|
|
* @param string @ldap_base_dn
|
2020-04-30 21:43:07 +08:00
|
|
|
* The LDAP base DN.
|
2019-05-02 20:51:50 +08:00
|
|
|
* @param string @ldap_filter
|
2017-08-26 21:54:24 +08:00
|
|
|
* A filter to get relevant data. Often the user id in ldap (uid or sAMAccountName).
|
2019-05-02 20:51:50 +08:00
|
|
|
* @param string @ldap_bind_dn
|
2020-04-30 21:43:07 +08:00
|
|
|
* The directory name of a service user to bind before search. Must be a user with read permission on LDAP.
|
2019-05-02 20:51:50 +08:00
|
|
|
* @param string @ldap_bind_pass
|
2017-08-26 21:54:24 +08:00
|
|
|
* The password associated to the service user to bind before search.
|
2019-05-02 20:51:50 +08:00
|
|
|
* @param string @ldap_search_attribute
|
2017-08-26 21:54:24 +08:00
|
|
|
* The attribute used on your LDAP to identify user (uid, email, cn, sAMAccountName)
|
|
|
|
* @param string @user
|
2020-04-30 21:43:07 +08:00
|
|
|
* A ldap username or email or sAMAccountName
|
|
|
|
*
|
|
|
|
* @return
|
2018-05-20 00:04:13 +08:00
|
|
|
* An array with the user's mail, complete name and directory name.
|
2017-08-08 03:01:11 +08:00
|
|
|
*/
|
2019-05-02 20:51:50 +08:00
|
|
|
public function getDataForMattermost($ldap_base_dn, $ldap_filter, $ldap_bind_dn, $ldap_bind_pass, $ldap_search_attribute, $user);
|
2017-08-08 03:01:11 +08:00
|
|
|
}
|