This repository has been archived by the owner on May 17, 2021. It is now read-only.
/
LdapManagerInterface.php
60 lines (52 loc) · 1.98 KB
/
LdapManagerInterface.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<?php
namespace FR3D\LdapBundle\Ldap;
use FR3D\LdapBundle\Model\LdapUserInterface;
interface LdapManagerInterface
{
/**
* Find a user by its username.
*
* @param string $username
* @return \Symfony\Component\Security\Core\User\UserInterface or null if user does not exist
*/
function findUserByUsername($username);
/**
* Finds one user by the given criteria.
*
* @param array $criteria
* @return \Symfony\Component\Security\Core\User\UserInterface
*/
function findUserBy(array $criteria);
/**
* Bind the user on ldap
*
* @param LdapUserInterface $user
* @param string $password
* @return Boolean
*/
function bind(LdapUserInterface $user, $password);
/**
* Escapes the given VALUES according to RFC 2254 so that they can be safely used in LDAP filters.
*
* Any control characters with an ASCII code < 32 as well as the characters with special meaning in
* LDAP filters "*", "(", ")", and "\" (the backslash) are converted into the representation of a
* backslash followed by two hex digits representing the hexadecimal value of the character.
* @see Net_LDAP2_Util::escape_filter_value() from Benedikt Hallinger <beni@php.net>
* @link http://pear.php.net/package/Net_LDAP2
*
* @param string|array $values Array of values to escape
* @return array Array $values, but escaped
*/
public static function escapeValue($values = array());
/**
* Undoes the conversion done by {@link escapeValue()}.
*
* Converts any sequences of a backslash followed by two hex digits into the corresponding character.
* @see Net_LDAP2_Util::escape_filter_value() from Benedikt Hallinger <beni@php.net>
* @link http://pear.php.net/package/Net_LDAP2
*
* @param string|array $values Array of values to escape
* @return array Array $values, but unescaped
*/
public static function unescapeValue($values = array());
}