Commit Graph

22775 Commits

Author SHA1 Message Date
Christophe Coevoet
9e51279b7f [CssSelector] Tag all internal classes as internal ones
All these classes are meant to be considered as an implementation
detail. A normal usage of the component does not require to deal with
them at all.
2015-09-28 16:03:26 +02:00
Christophe Coevoet
f4563c39ce Add a non-static API for the CssSelector component 2015-09-28 16:03:26 +02:00
Fabien Potencier
7f13f9537c [WebProfilerBundle] fixed a template reference 2015-09-28 15:53:15 +02:00
Fabien Potencier
c2cfbcfa60 feature #14132 Applied the new styles to the router: commands (javiereguiluz)
This PR was submitted for the 2.7 branch but it was merged into the 2.8 branch instead (closes #14132).

Discussion
----------

Applied the new styles to the router: commands

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

Here are some screenshots comparing these commands before/after.

## debug:router

![debug_router_all](https://cloud.githubusercontent.com/assets/73419/6919169/f9c44c14-d7b4-11e4-8470-fcaae35f334f.png)

## debug:router --show-controllers

![debug_router_all_and_controllers](https://cloud.githubusercontent.com/assets/73419/6919172/ff9aa610-d7b4-11e4-9d9b-07e9ba00a948.png)

## debug:router admin_post_delete

![debug_router_route](https://cloud.githubusercontent.com/assets/73419/6919177/08b1cfee-d7b5-11e4-8310-93a37e68faa5.png)

## router:match - no match

![router_match_no_match](https://cloud.githubusercontent.com/assets/73419/6919186/1cda7afc-d7b5-11e4-9833-2083b4f7b3b2.png)

## router:match - almost match

![router_match_almost](https://cloud.githubusercontent.com/assets/73419/6919190/2095ba8a-d7b5-11e4-8d19-d51fa52cd3f5.png)

## router:match - exact match

![router_match_exact](https://cloud.githubusercontent.com/assets/73419/6919193/236ddb48-d7b5-11e4-9be0-53ec95ce940f.png)

## Deprecated router:dump-apache

![dump_apache](https://cloud.githubusercontent.com/assets/73419/6919164/ebe3651c-d7b4-11e4-9f73-ddf2db825974.png)

Commits
-------

13d0da2 Applied the new styles to the router: commands
2015-09-28 15:51:13 +02:00
Javier Eguiluz
13d0da26fd Applied the new styles to the router: commands 2015-09-28 15:50:38 +02:00
Fabien Potencier
078f953935 feature #15356 [WebProfilerBundle] Profiler View Latest should preserve all the current query parameters (jbafford)
This PR was merged into the 2.8 branch.

Discussion
----------

[WebProfilerBundle] Profiler View Latest should preserve all the current query parameters

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        |

This improves the View Latest link by preserving all of the current query parameters, which makes it more useful with the Logs panel, for example.

Commits
-------

dc6ee81 Profiler View Latest should preserve all the current query parameters
2015-09-28 15:36:39 +02:00
John Bafford
dc6ee81196 Profiler View Latest should preserve all the current query parameters
* Restore View Latest button
* In order to fit into the horizontal space available, shorten the names of the Latest Profiles and View Latest buttons and adjust the buttons' margin and padding.
2015-09-28 09:22:20 -04:00
Tobias Schultze
03a63dbc14 [PropertyAccess] fix cs 2015-09-28 14:41:55 +02:00
Fabien Potencier
3bea01bd0d feature #15953 [TwigBridge] is_granted no longer raise an exception if the token storage is empty (lyrixx)
This PR was merged into the 2.8 branch.

Discussion
----------

[TwigBridge] is_granted no longer raise an exception if the token storage is empty

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #10159
| License       | MIT
| Doc PR        |

Commits
-------

6be68fd [TwigBridge] is_granted no longer raise an exception if the token storage is empty
2015-09-28 13:35:25 +02:00
Fabien Potencier
7d7e07fefa feature #14602 [2.8] [Ldap] Added support for LDAP (New Component + integration in the Security Component). (csarrazi, lyrixx)
This PR was merged into the 2.8 branch.

Discussion
----------

[2.8] [Ldap] Added support for LDAP (New Component + integration in the Security Component).

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | not yet
| Fixed tickets | -
| License       | MIT
| Doc PR        | not yet

Current state:

- [x] Implement logic
- [x] Post-review tuning and stabilization
- [x] Fix tests

This PR is a follow-up to #5189, which was in a stand-still for a few years now. It tries to fix the remaining issues which were mentioned in the discussion.

There are still a few issues with the PR, as it is. For example, it introduces two new firewall factories, whereas the base factories (`form_login` and `http_basic`) could simply introduce new configuration options.

Also, for a user to use an LDAP server as an authentication provider, he first needs to define a service which should be an instance of `Symfony\Component\Security\Ldap\Ldap`.

For example:

```yml
services:
    my_ldap:
        class: Symfony\Component\Security\Ldap\Ldap
        arguments: [ "ldap.mydomain.tld" ]
```

Then, in `security.yml`, this service can be used in both the user provider and the firewalls:

```yml
security:
    encoders:
        Symfony\Component\Security\Core\User\User: plaintext

    role_hierarchy:
        ROLE_ADMIN:       ROLE_USER
        ROLE_SUPER_ADMIN: [ROLE_USER, ROLE_ADMIN, ROLE_ALLOWED_TO_SWITCH]

    providers:
        ldap_users:
            ldap:
                service: my_ldap
                base_dn: dc=MyDomain,dc=tld
                search_dn: CN=My User,OU=Users,DC=MyDomain,DC=tld
                search_password: p455w0rd
                filter: (sAMAccountName={username})
                default_roles: ROLE_USER

    firewalls:
        dev:
            pattern:  ^/(_(profiler|wdt)|css|images|js)/
            security: false
        demo_login:
            pattern:  ^/login$
            security: false
        api:
            provider: ldap_users
            stateless: true
            pattern:    ^/api
            http_basic_ldap:
                service: my_ldap
                dn_string: "{username}@MYDOMAIN"
        demo_secured_area:
            provider: ldap_users
            pattern:    ^/
            logout:
                path:   logout
                target: login
            form_login_ldap:
                service: my_ldap
                dn_string: CN={username},OU=Users,DC=MyDomain,DC=tld
                check_path: login_check
                login_path: login
```

Commits
-------

60b9f2e Implemented LDAP authentication and LDAP user provider
1c964b9 Introducing the LDAP component
2015-09-28 13:32:19 +02:00
Fabien Potencier
32002d771e feature #15939 Removed the "Delete profiles" action from the web profiler sidebar (javiereguiluz)
This PR was merged into the 2.8 branch.

Discussion
----------

Removed the "Delete profiles" action from the web profiler sidebar

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | yes
| Tests pass?   | yes
| Fixed tickets | #15819
| License       | MIT
| Doc PR        | -

Commits
-------

8c47eb9 Removed the "Delete profiles" action from the web profiler sidebar
2015-09-28 13:21:15 +02:00
Fabien Potencier
779d6dc7f4 feature #15962 [Finder] simplified code (fabpot)
This PR was merged into the 2.8 branch.

Discussion
----------

[Finder] simplified code

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | yes
| Tests pass?   | yes
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | n/a

Commits
-------

4fa3eaf [Finder] simplified code
2015-09-28 13:14:02 +02:00
Grégoire Pineau
60b9f2e7ec Implemented LDAP authentication and LDAP user provider 2015-09-28 13:12:05 +02:00
Charles Sarrazin
1c964b993f Introducing the LDAP component 2015-09-28 13:11:59 +02:00
Fabien Potencier
4fa3eaf0c2 [Finder] simplified code 2015-09-28 12:21:41 +02:00
Fabien Potencier
d3271e1fae missing tags in whitelist 2015-09-28 12:16:05 +02:00
Florian Pfitzer
f51fe4ac41 [FrameworkBundle] [DependencyInjection] added logging of unused tags during container compilation 2015-09-28 12:07:01 +02:00
Fabien Potencier
3765d8a01d bug #15799 [HttpFoundation] NativeSessionStorage regenerate method wrongly sets storage as started (iambrosi)
This PR was squashed before being merged into the 2.3 branch (closes #15799).

Discussion
----------

[HttpFoundation] NativeSessionStorage `regenerate` method wrongly sets storage as started

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        |

This PR fixes an error when regenerating session IDs for non-active sessions.
Right now, the session is flagged as _started_, no matter if the session ID was successfully regenerated or not, making the storage [unable to _start the session_](6393ec3169/src/Symfony/Component/HttpFoundation/Session/Storage/NativeSessionStorage.php (L130-L132)) later on.

This also fixes a future error with PHP 7, which throws an error if a regeneration is attempted for non-active sessions.

```
session_regenerate_id(): Cannot regenerate session id - session is not active
```

Commits
-------

8e6ef9c [HttpFoundation] NativeSessionStorage  method wrongly sets storage as started
2015-09-28 11:26:18 +02:00
Ismael Ambrosi
8e6ef9cb56 [HttpFoundation] NativeSessionStorage method wrongly sets storage as started 2015-09-28 11:26:16 +02:00
Fabien Potencier
8990968b01 minor #15434 [property-access] Improvement for Accessing Reference Chain (zerustech)
This PR was merged into the 2.7 branch.

Discussion
----------

[property-access] Improvement for Accessing Reference Chain

Improve performance for the following scenarios:

- Example 1:
```php
$a = array(
    'a' => array(
        'b' => array(
            'c' => 'old-value'
        )
    )
);
$pa->setValue($a, '[a][b][c]', 'new-value');
// The PropertyAccessor will try to set values for
// $a['a']['b']['c'], $a['a']['b'] and $a['a'],
// but in fact it may terminate the loop
// right after the value of $a[a][b][c] is set,
// because $a, $[a], $[a][b] and $[a][b][c]
// are all passed as reference - the reference chain is not broken.
```

- Example 2
```php
$b = array(
    'a' => array(
        'b' => array(
            'c' => 'old-value'
        )
    )
)

$a = new Foo($b);
// In this example, the reference chain of $b is broken,
// because it's passed to $a.value as value
// But its elements are all passed as reference,
// so after setting the value for $b[a][b][c], there is no need
// to set value for $b[a][b] and $b[a]

$pa->setValue($a, 'value[a][b][c]', 'new-value');
```

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | n/a

Commits
-------

e24a798 [property-access] Improvement for Accessing Reference Chain
2015-09-28 11:21:52 +02:00
Fabien Potencier
c43bf08b09 bug #15446 [Twig][Bridge] force space between widget and label in checkbox_radio_label (MatTheCat)
This PR was submitted for the 2.6 branch but it was merged into the 2.7 branch instead (closes #15446).

Discussion
----------

[Twig][Bridge] force space between widget and label in checkbox_radio_label

| Q             | A
| ------------- | ---
| Fixed tickets | N/A
| License       | MIT

Update

![without space](https://cloud.githubusercontent.com/assets/1898254/9058780/481326ae-3aa4-11e5-9a8a-ebd6bf963361.png)

to

![with space](https://cloud.githubusercontent.com/assets/1898254/9058791/52184238-3aa4-11e5-854f-4a8105dacb84.png)

Commits
-------

ed9c610 [Twig][Bridge] force space between widget and label in checkbox_radio_label
2015-09-28 11:09:47 +02:00
MatTheCat
ed9c6103f8 [Twig][Bridge] force space between widget and label in checkbox_radio_label 2015-09-28 11:09:38 +02:00
Fabien Potencier
2d1d9d68df minor #15943 Remove failing test to fix #15935 (mpdude)
This PR was merged into the 2.7 branch.

Discussion
----------

Remove failing test to fix #15935

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #15935
| License       | MIT
| Doc PR        |

Test has been removed on 2.8 already in https://github.com/symfony/symfony/pull/15738/files#diff-990df0e8238847f8ae54e8227f295c22L107

Commits
-------

5392a0c Remove failing test
2015-09-28 11:05:00 +02:00
Fabien Potencier
6600aefdfc minor #15956 Updated default German IBAN validation message (synaris)
This PR was submitted for the master branch but it was merged into the 2.3 branch instead (closes #15956).

Discussion
----------

Updated default German IBAN validation message

This PR was submitted on the symfony/validator read-only repository by @synaris and moved automatically to the main Symfony repository (closes symfony/validator#15).

IBAN is an acronym. The term 'IBAN-Kontonummer' is redundant, since the 'AN' part (Account Number) already translates to 'Kontonummer'. It's like saying 'International Bank Account Number Account Number'.

Commits
-------

5423ba0 Updated default German IBAN validation message
2015-09-28 10:52:30 +02:00
Julia
5423ba0974 Updated default German IBAN validation message
IBAN is an acronym. The term 'IBAN-Kontonummer' is redundant, since the 'AN' part (Account Number) already translates to 'Kontonummer'. It's like saying 'International Bank Account Number Account Number'.
2015-09-28 10:52:29 +02:00
Fabien Potencier
882681d1a1 minor #15955 Fixed incorrect and inconsistent translations (lashae)
This PR was submitted for the master branch but it was merged into the 2.3 branch instead (closes #15955).

Discussion
----------

Fixed incorrect and inconsistent translations

This PR was submitted on the symfony/security read-only repository by @lashae and moved automatically to the main Symfony repository (closes symfony/security#8).

"Fiş" is a correct translation for "token", however "bilet" is also used, I fixed that inconsistency. Moreover, "kimlik bilgileri" is a better translation for "credentials" than "girdiler". "Girdiler" is the translation of "inputs", so I fixed sentences with "credentials". "Hesap engellenmiş" is better than "Hesap devre dışı bırakılmış" for "Account is disabled.". "Digest nonce has expired" can be translated better as "Derleme zaman aşımına uğradı." because "Derleme zaman aşımı gerçekleşti" has a confirmation sense like user requested it to expire and it has expired.

References:

token: http://tureng.com/search/token (3rd entry)
credentials: http://www2.zargan.com/tr/q/credentials-ceviri-nedir (1st entry)
disable: http://tureng.com/search/disable (15th entry)

Commits
-------

f99f40e Fixed incorrect and inconsistent translations
2015-09-28 10:50:46 +02:00
lashae
f99f40eb65 Fixed incorrect and inconsistent translations
"Fiş" is a correct translation for "token", however "bilet" is also used, I fixed that inconsistency. Moreover, "kimlik bilgileri" is a better translation for "credentials" than "girdiler". "Girdiler" is the translation of "inputs", so I fixed sentences with "credentials". "Hesap engellenmiş" is better than "Hesap devre dışı bırakılmış" for "Account is disabled.". "Digest nonce has expired" can be translated better as "Derleme zaman aşımına uğradı." because "Derleme zaman aşımı gerçekleşti" has a confirmation sense like user requested it to expire and it has expired.

References:

token: http://tureng.com/search/token (3rd entry)
credentials: http://www2.zargan.com/tr/q/credentials-ceviri-nedir (1st entry)
disable: http://tureng.com/search/disable (15th entry)
2015-09-28 10:50:45 +02:00
Fabien Potencier
dc937f899e minor #15961 [Security] Fix tests in 2.8 (WouterJ)
This PR was merged into the 2.8 branch.

Discussion
----------

[Security] Fix tests in 2.8

ping @fabpot

Commits
-------

20c90f5 Fix tests in 2.8
2015-09-28 10:22:58 +02:00
Wouter J
20c90f5891 Fix tests in 2.8 2015-09-28 10:20:11 +02:00
Fabien Potencier
46746f8954 minor #15960 [Validator] Sync polish translation file (stloyd)
This PR was merged into the 2.8 branch.

Discussion
----------

[Validator] Sync polish translation file

| Q             | A
| ------------- | ---
| Bug fix?      | no
| BC breaks?    | no
| License       | MIT

Commits
-------

7a88c37 [Validator] Sync polish translation file
2015-09-28 10:04:29 +02:00
Joseph Bielawski
7a88c37743 [Validator] Sync polish translation file 2015-09-28 09:59:13 +02:00
Grégoire Pineau
6be68fd845 [TwigBridge] is_granted no longer raise an exception if the token storage is empty 2015-09-28 09:38:38 +02:00
Fabien Potencier
1c68f3cedb minor #15951 Make Proper English (redstar504)
This PR was submitted for the master branch but it was merged into the 2.3 branch instead (closes #15951).

Discussion
----------

Make Proper English

This PR was submitted on the symfony/browser-kit read-only repository by @redstar504 and moved automatically to the main Symfony repository (closes symfony/browser-kit#4).

Commits
-------

95417f6 Make Proper English
2015-09-28 09:26:53 +02:00
Brayden Williams
95417f6ddd Make Proper English 2015-09-28 09:26:52 +02:00
Fabien Potencier
156368fa43 feature #15882 Easier Custom Authentication errors (weaverryan)
This PR was merged into the 2.8 branch.

Discussion
----------

Easier Custom Authentication errors

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | not yet

This makes failing authentication with a custom message much easier:

```php
throw CustomAuthenticationException::createWithSafeMessage(
    'That was a ridiculous username'
);

// or
$e = new CustomAuthenticationException();
$e->setSafeMessage('That was a ridiculous username');

throw $e;
```

Currently, to do this, you'd need to create a new sub-class of `AuthenticationException`, which is way more work than it needs to be. The original design was so that all messages exposed are safe, which is why I've named the methods like I have.

Thanks!

Commits
-------

d7c1463 Adding a class to make it easier to set custom authentication error messages
2015-09-28 09:00:41 +02:00
Fabien Potencier
4021353591 Merge branch '2.7' into 2.8
* 2.7:
  Readd the correct tests
2015-09-28 08:58:50 +02:00
Fabien Potencier
df7a89f171 minor #15942 [Security] Improve AbstractVoter tests (WouterJ)
This PR was merged into the 2.7 branch.

Discussion
----------

[Security] Improve AbstractVoter tests

Applying the improved tests from https://github.com/symfony/symfony/pull/15932 into the oldest possible branch.

Merge conflicts from 2.7 into 2.8 caused by this PR do not need to be done carefully, I'll create a new PR for 2.8 updating the tests as soon as these changes are merged up.

| Q             | A
| ------------- | ---
| Fixed tickets | -
| License       | MIT

Commits
-------

5ff741d Readd the correct tests
2015-09-28 08:54:42 +02:00
Fabien Potencier
3a665af934 Merge branch '2.7' into 2.8
* 2.7:
  [Security] fixed composer.json
2015-09-28 08:51:00 +02:00
Fabien Potencier
8a1f0a0501 [Security] fixed composer.json 2015-09-28 08:50:50 +02:00
Ryan Weaver
d7c14632f7 Adding a class to make it easier to set custom authentication error messages 2015-09-27 16:39:53 -04:00
Fabien Potencier
4b942741e5 minor #15940 [Console] don't rely on internal sort implementation om test (xabbuh)
This PR was merged into the 2.8 branch.

Discussion
----------

[Console] don't rely on internal sort implementation om test

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #14894
| License       | MIT
| Doc PR        |

PHP does not guarantuee how array elements with the same value will be
sorted when applying `asort()`. Since all namespaces used in the test
produce the same Levenshtein value, we should only check for presence of
these namespaces instead of comparing the exact order.

Commits
-------

3011fa0 don't rely on internal sort implementation in test
2015-09-27 16:47:35 +02:00
Matthias Pigulla
5392a0ca1f Remove failing test
Fixes #15935, test has been removed on 2.8 already in https://github.com/symfony/symfony/pull/15738/files#diff-990df0e8238847f8ae54e8227f295c22L107
2015-09-27 16:27:15 +02:00
Wouter J
5ff741de8a Readd the correct tests 2015-09-27 16:25:18 +02:00
Christian Flothmann
3011fa0ea9 don't rely on internal sort implementation in test
PHP does not guarantuee how array elements with the same value will be
sorted when applying `asort()`. Since all namespaces used in the test
produce the same Levenshtein value, we should only check for presence of
these namespaces instead of comparing the exact order.
2015-09-27 15:45:05 +02:00
Javier Eguiluz
8c47eb9be6 Removed the "Delete profiles" action from the web profiler sidebar 2015-09-27 15:39:02 +02:00
Fabien Potencier
7f829b8d55 bug #15533 [Console] Fix input validation when required arguments are missing (jakzal)
This PR was merged into the 2.3 branch.

Discussion
----------

[Console] Fix input validation when required arguments are missing

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #15505
| License       | MIT
| Doc PR        | -

The rule that was here in place previously only works when arguments are passed from command line, as in command line there is no way of skipping an argument. The rule does not work for arguments set on the Input after a command is run.

Commits
-------

4982b02 [Console] Add the command name to input arguments if it's missing
f12a4c1 [Console] Fix input validation when required arguments are missing
2015-09-27 15:31:56 +02:00
Fabien Potencier
6ae7d95e13 feature #15907 [DomCrawler] Deprecate methods inherited from SplObjectStorage (stof)
This PR was merged into the 2.8 branch.

Discussion
----------

[DomCrawler] Deprecate methods inherited from SplObjectStorage

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | yes
| Tests pass?   | yes
| Fixed tickets | half of #15849
| License       | MIT
| Doc PR        | n/a

There is no documentation change to be done for it: we don't document the fact that DomCrawler extends SplObjectStorage (this is an implementation detail which leaked because of using inheritance rather than composition).

Commits
-------

997c650 Deprecate methods inherited from SplObjectStorage
2015-09-27 15:24:43 +02:00
Christophe Coevoet
997c650c1c Deprecate methods inherited from SplObjectStorage 2015-09-27 15:06:19 +02:00
ogizanagi
d961f7f344 [Config] Fix ArrayNode extra keys "ignore" and "remove" behaviors 2015-09-27 12:15:37 +02:00
Fabien Potencier
58ed0762e9 Merge branch '2.7' into 2.8
* 2.7:
  Detect Mintty for color support on Windows
  Detect Mintty for color support on Windows
  Add a group for tests of the finder against the FTP server
  Fix license headers
  Forbid serializing a Crawler
  Fix phpdoc block of NativeSessionStorage class
  Added exception when setAutoInitialize is called when locked
  [FrameworkBundle] Advanced search templates of bundles
  [Security] Allow user providers to be defined in many files
  Use random_bytes function if it is available for random number generation
2015-09-27 12:09:46 +02:00