Skip to content

Commit afe1668

Browse files
committed
feature #16735 [WIP] [Ldap] Marked the Ldap component as internal (csarrazi)
This PR was merged into the 2.8 branch. Discussion ---------- [WIP] [Ldap] Marked the Ldap component as internal | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | BC breaks? | yes | Deprecations? | no | Tests pass? | no | Fixed tickets | no | License | MIT | Doc PR | not yet As mentioned earlier, the LDAP component suffers from a few problems, addressed in PR #15994 However, as raised by @Tobion, the component does not yet have tests (they can be added at a later time, though), and is not considered stable yet. Commits ------- 3f89b2c Marked the Ldap component as internal and removed Ldap constants polyfill
2 parents b255dfe + 3f89b2c commit afe1668

File tree

7 files changed

+17
-8
lines changed

7 files changed

+17
-8
lines changed

src/Symfony/Component/Ldap/Exception/ConnectionException.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
* ConnectionException is throw if binding to ldap can not be established.
1616
*
1717
* @author Grégoire Pineau <lyrixx@lyrixx.info>
18+
*
19+
* @internal
1820
*/
1921
class ConnectionException extends \RuntimeException
2022
{

src/Symfony/Component/Ldap/Exception/LdapException.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
* LdapException is throw if php ldap module is not loaded.
1616
*
1717
* @author Grégoire Pineau <lyrixx@lyrixx.info>
18+
*
19+
* @internal
1820
*/
1921
class LdapException extends \RuntimeException
2022
{

src/Symfony/Component/Ldap/LdapClient.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
* @author Grégoire Pineau <lyrixx@lyrixx.info>
1919
* @author Francis Besset <francis.besset@gmail.com>
2020
* @author Charles Sarrazin <charles@sarraz.in>
21+
*
22+
* @internal
2123
*/
2224
class LdapClient implements LdapClientInterface
2325
{

src/Symfony/Component/Ldap/LdapClientInterface.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,11 @@
1818
*
1919
* @author Grégoire Pineau <lyrixx@lyrixx.info>
2020
* @author Charles Sarrazin <charles@sarraz.in>
21+
*
22+
* @internal
2123
*/
2224
interface LdapClientInterface
2325
{
24-
const LDAP_ESCAPE_FILTER = 0x01;
25-
const LDAP_ESCAPE_DN = 0x02;
26-
2726
/**
2827
* Return a connection bound to the ldap.
2928
*

src/Symfony/Component/Ldap/README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
Ldap Component
2-
=============
2+
==============
33

44
A Ldap client for PHP on top of PHP's ldap extension.
55

6-
This component also provides a stub for the missing
7-
`ldap_escape` function in PHP versions lower than 5.6.
6+
Disclaimer
7+
----------
8+
9+
This component is currently marked as internal, as it
10+
still needs some work. Breaking changes will be introduced
11+
in the next minor version of Symfony.
812

913
Documentation
1014
-------------

src/Symfony/Component/Security/Core/Authentication/Provider/LdapBindAuthenticationProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ protected function checkAuthentication(UserInterface $user, UsernamePasswordToke
7474
$password = $token->getCredentials();
7575

7676
try {
77-
$username = $this->ldap->escape($username, '', LdapClientInterface::LDAP_ESCAPE_DN);
77+
$username = $this->ldap->escape($username, '', LDAP_ESCAPE_DN);
7878
$dn = str_replace('{username}', $username, $this->dnString);
7979

8080
$this->ldap->bind($dn, $password);

src/Symfony/Component/Security/Core/User/LdapUserProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public function loadUserByUsername($username)
5757
{
5858
try {
5959
$this->ldap->bind($this->searchDn, $this->searchPassword);
60-
$username = $this->ldap->escape($username, '', LdapClientInterface::LDAP_ESCAPE_FILTER);
60+
$username = $this->ldap->escape($username, '', LDAP_ESCAPE_FILTER);
6161
$query = str_replace('{username}', $username, $this->defaultSearch);
6262
$search = $this->ldap->find($this->baseDn, $query);
6363
} catch (ConnectionException $e) {

0 commit comments

Comments
 (0)