Skip to content

Commit ab2044f

Browse files
Merge branch '2.8'
* 2.8: [Bridge/Doctrine+Ldap] Fix tests Marked the Ldap component as internal and removed Ldap constants polyfill Conflicts: src/Symfony/Bridge/Doctrine/Tests/Form/Type/EntityTypeTest.php
2 parents 9952ef9 + 6ff5015 commit ab2044f

File tree

9 files changed

+23
-8
lines changed

9 files changed

+23
-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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
1919
* @author Francis Besset <[email protected]>
2020
* @author Charles Sarrazin <[email protected]>
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 <[email protected]>
2020
* @author Charles Sarrazin <[email protected]>
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/Tests/Authentication/Provider/LdapBindAuthenticationProviderTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616
use Symfony\Component\Security\Core\User\User;
1717
use Symfony\Component\Ldap\Exception\ConnectionException;
1818

19+
/**
20+
* @requires extension ldap
21+
*/
1922
class LdapBindAuthenticationProviderTest extends \PHPUnit_Framework_TestCase
2023
{
2124
/**

src/Symfony/Component/Security/Core/Tests/User/LdapUserProviderTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
use Symfony\Component\Security\Core\User\LdapUserProvider;
1515
use Symfony\Component\Ldap\Exception\ConnectionException;
1616

17+
/**
18+
* @requires extension ldap
19+
*/
1720
class LdapUserProviderTest extends \PHPUnit_Framework_TestCase
1821
{
1922
/**

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)