2017-08-08 03:01:11 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Class to interact with LDAP
|
|
|
|
*
|
|
|
|
* @author Denis CLAVIER <clavierd at gmail dot com>
|
|
|
|
*/
|
|
|
|
interface LDAPInterface
|
|
|
|
{
|
2017-08-26 21:54:24 +08:00
|
|
|
/**
|
|
|
|
* @param string @user
|
|
|
|
* A ldap username or email or sAMAccountName
|
2017-08-08 03:01:11 +08:00
|
|
|
* @param string @password
|
2017-08-26 21:54:24 +08:00
|
|
|
* An optional password linked to the user, if not provided an anonymous bind is attempted
|
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)
|
2019-05-02 20:51:50 +08:00
|
|
|
* @param string @ldap_filter
|
2017-08-26 21:54:24 +08:00
|
|
|
* An optional filter to search in LDAP (ex : objectClass = person).
|
2019-05-02 20:51:50 +08:00
|
|
|
* @param string @ldap_base_dn
|
2017-08-26 21:54:24 +08:00
|
|
|
* The LDAP base DN.
|
2019-05-02 20:51:50 +08:00
|
|
|
* @param string @ldap_bind_dn
|
2017-08-26 21:54:24 +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.
|
2017-08-08 03:01:11 +08:00
|
|
|
*
|
|
|
|
* @return
|
|
|
|
* TRUE if the user is identified and can access to the LDAP server
|
|
|
|
* and FALSE if it isn't
|
|
|
|
*/
|
2019-05-02 20:51:50 +08:00
|
|
|
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
|
2017-08-08 03:01:11 +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
|
2017-08-22 05:10:20 +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
|
|
|
|
* A ldap username or email or sAMAccountName
|
|
|
|
*
|
2017-08-08 03:01:11 +08:00
|
|
|
* @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
|
|
|
}
|