diff options
author | Fabien Potencier <fabien.potencier@gmail.com> | 2014-01-24 15:36:08 +0100 |
---|---|---|
committer | Fabien Potencier <fabien.potencier@gmail.com> | 2014-01-24 15:36:08 +0100 |
commit | c8e2d4a8bc6cb7bf9418a57e680278723aa76f94 (patch) | |
tree | c2eb9450fe71fc2b6f89e4ec62b95a69168020be | |
parent | 243eb156955e2427dabd3e5b6ecb68dae09ebbea (diff) | |
parent | 3dbf1fddbcd36fac27982869cdc6fbb4ff03b89a (diff) | |
download | symfony-security-c8e2d4a8bc6cb7bf9418a57e680278723aa76f94.zip symfony-security-c8e2d4a8bc6cb7bf9418a57e680278723aa76f94.tar.gz symfony-security-c8e2d4a8bc6cb7bf9418a57e680278723aa76f94.tar.bz2 |
Merge branch '2.3' into 2.4
* 2.3: (30 commits)
Update validators.ro.xlf
add non-standard port to HTTP_HOST
fixed attribute "source-language" for translations
Update PluralizationRules.php
Update validators.pt_BR.xlf
Translated remaining items (57-72)
Updated Vietnamese translation
added missing dot in translation
updated Arabic translations
Update validators.id.xlf
[Validator] Translate validator messages into Brazilian Portuguese
Added more Swedish validator translations
Update validators.ca.xlf
fixed typos in Welsh translation
Added missing Croatian translations
[Form] fixed allow render 0 and 0.0 numeric input values
Fixed validators.nl.xlf
[Component/Security] Fixed some phpdocs in Security/Core
Completed Luxembourgish translation
Fixing the Logger deprecation notices to match the correct method name it should be informing of
...
Conflicts:
src/Symfony/Bridge/Twig/composer.json
src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/form_widget_simple.html.php
src/Symfony/Component/Console/Application.php
20 files changed, 242 insertions, 47 deletions
diff --git a/Core/Authentication/Provider/RememberMeAuthenticationProvider.php b/Core/Authentication/Provider/RememberMeAuthenticationProvider.php index 4175907..234bddb 100644 --- a/Core/Authentication/Provider/RememberMeAuthenticationProvider.php +++ b/Core/Authentication/Provider/RememberMeAuthenticationProvider.php @@ -22,6 +22,13 @@ class RememberMeAuthenticationProvider implements AuthenticationProviderInterfac private $key; private $providerKey; + /** + * Constructor. + * + * @param UserCheckerInterface $userChecker An UserCheckerInterface interface + * @param string $key A key + * @param string $providerKey A provider key + */ public function __construct(UserCheckerInterface $userChecker, $key, $providerKey) { $this->userChecker = $userChecker; @@ -29,6 +36,9 @@ class RememberMeAuthenticationProvider implements AuthenticationProviderInterfac $this->providerKey = $providerKey; } + /** + * {@inheritdoc} + */ public function authenticate(TokenInterface $token) { if (!$this->supports($token)) { @@ -48,6 +58,9 @@ class RememberMeAuthenticationProvider implements AuthenticationProviderInterfac return $authenticatedToken; } + /** + * {@inheritdoc} + */ public function supports(TokenInterface $token) { return $token instanceof RememberMeToken && $token->getProviderKey() === $this->providerKey; diff --git a/Core/Authentication/RememberMe/InMemoryTokenProvider.php b/Core/Authentication/RememberMe/InMemoryTokenProvider.php index a15c2b4..719d7a1 100644 --- a/Core/Authentication/RememberMe/InMemoryTokenProvider.php +++ b/Core/Authentication/RememberMe/InMemoryTokenProvider.php @@ -22,6 +22,9 @@ class InMemoryTokenProvider implements TokenProviderInterface { private $tokens = array(); + /** + * {@inheritdoc} + */ public function loadTokenBySeries($series) { if (!isset($this->tokens[$series])) { @@ -31,6 +34,9 @@ class InMemoryTokenProvider implements TokenProviderInterface return $this->tokens[$series]; } + /** + * {@inheritdoc} + */ public function updateToken($series, $tokenValue, \DateTime $lastUsed) { if (!isset($this->tokens[$series])) { @@ -47,11 +53,17 @@ class InMemoryTokenProvider implements TokenProviderInterface $this->tokens[$series] = $token; } + /** + * {@inheritdoc} + */ public function deleteTokenBySeries($series) { unset($this->tokens[$series]); } + /** + * {@inheritdoc} + */ public function createNewToken(PersistentTokenInterface $token) { $this->tokens[$token->getSeries()] = $token; diff --git a/Core/Authentication/RememberMe/PersistentToken.php b/Core/Authentication/RememberMe/PersistentToken.php index 8919be9..5df71ec 100644 --- a/Core/Authentication/RememberMe/PersistentToken.php +++ b/Core/Authentication/RememberMe/PersistentToken.php @@ -58,9 +58,7 @@ final class PersistentToken implements PersistentTokenInterface } /** - * Returns the class of the user - * - * @return string + * {@inheritdoc} */ public function getClass() { @@ -68,9 +66,7 @@ final class PersistentToken implements PersistentTokenInterface } /** - * Returns the username - * - * @return string + * {@inheritdoc} */ public function getUsername() { @@ -78,9 +74,7 @@ final class PersistentToken implements PersistentTokenInterface } /** - * Returns the series - * - * @return string + * {@inheritdoc} */ public function getSeries() { @@ -88,9 +82,7 @@ final class PersistentToken implements PersistentTokenInterface } /** - * Returns the token value - * - * @return string + * {@inheritdoc} */ public function getTokenValue() { @@ -98,9 +90,7 @@ final class PersistentToken implements PersistentTokenInterface } /** - * Returns the time the token was last used - * - * @return \DateTime + * {@inheritdoc} */ public function getLastUsed() { diff --git a/Core/Authentication/RememberMe/PersistentTokenInterface.php b/Core/Authentication/RememberMe/PersistentTokenInterface.php index 6e9d891..ad52753 100644 --- a/Core/Authentication/RememberMe/PersistentTokenInterface.php +++ b/Core/Authentication/RememberMe/PersistentTokenInterface.php @@ -20,31 +20,36 @@ namespace Symfony\Component\Security\Core\Authentication\RememberMe; interface PersistentTokenInterface { /** - * Returns the class of the user + * Returns the class of the user. + * * @return string */ public function getClass(); /** - * Returns the username + * Returns the username. + * * @return string */ public function getUsername(); /** - * Returns the series + * Returns the series. + * * @return string */ public function getSeries(); /** - * Returns the token value + * Returns the token value. + * * @return string */ public function getTokenValue(); /** - * Returns the last time the cookie was used + * Returns the time the token was last used. + * * @return \DateTime */ public function getLastUsed(); diff --git a/Core/Authentication/Token/AbstractToken.php b/Core/Authentication/Token/AbstractToken.php index 59510ee..5160fc5 100644 --- a/Core/Authentication/Token/AbstractToken.php +++ b/Core/Authentication/Token/AbstractToken.php @@ -70,6 +70,9 @@ abstract class AbstractToken implements TokenInterface return (string) $this->user; } + /** + * {@inheritdoc} + */ public function getUser() { return $this->user; diff --git a/Core/Authentication/Token/AnonymousToken.php b/Core/Authentication/Token/AnonymousToken.php index cabb6d5..d39fec8 100644 --- a/Core/Authentication/Token/AnonymousToken.php +++ b/Core/Authentication/Token/AnonymousToken.php @@ -18,7 +18,6 @@ use Symfony\Component\Security\Core\Role\RoleInterface; * * @author Fabien Potencier <fabien@symfony.com> */ - class AnonymousToken extends AbstractToken { private $key; diff --git a/Core/Authentication/Token/PreAuthenticatedToken.php b/Core/Authentication/Token/PreAuthenticatedToken.php index ff0572f..abcd2bf 100644 --- a/Core/Authentication/Token/PreAuthenticatedToken.php +++ b/Core/Authentication/Token/PreAuthenticatedToken.php @@ -41,11 +41,19 @@ class PreAuthenticatedToken extends AbstractToken } } + /** + * Returns the provider key. + * + * @return string The provider key + */ public function getProviderKey() { return $this->providerKey; } + /** + * {@inheritdoc} + */ public function getCredentials() { return $this->credentials; @@ -61,11 +69,17 @@ class PreAuthenticatedToken extends AbstractToken $this->credentials = null; } + /** + * {@inheritdoc} + */ public function serialize() { return serialize(array($this->credentials, $this->providerKey, parent::serialize())); } + /** + * {@inheritdoc} + */ public function unserialize($str) { list($this->credentials, $this->providerKey, $parentStr) = unserialize($str); diff --git a/Core/Authentication/Token/RememberMeToken.php b/Core/Authentication/Token/RememberMeToken.php index 6f3d821..609fdad 100644 --- a/Core/Authentication/Token/RememberMeToken.php +++ b/Core/Authentication/Token/RememberMeToken.php @@ -51,6 +51,9 @@ class RememberMeToken extends AbstractToken parent::setAuthenticated(true); } + /** + * {@inheritdoc} + */ public function setAuthenticated($authenticated) { if ($authenticated) { @@ -60,16 +63,29 @@ class RememberMeToken extends AbstractToken parent::setAuthenticated(false); } + /** + * Returns the provider key. + * + * @return string The provider key + */ public function getProviderKey() { return $this->providerKey; } + /** + * Returns the key. + * + * @return string The Key + */ public function getKey() { return $this->key; } + /** + * {@inheritdoc} + */ public function getCredentials() { return ''; diff --git a/Core/Authentication/Token/UsernamePasswordToken.php b/Core/Authentication/Token/UsernamePasswordToken.php index 3854242..b6dfce4 100644 --- a/Core/Authentication/Token/UsernamePasswordToken.php +++ b/Core/Authentication/Token/UsernamePasswordToken.php @@ -60,11 +60,19 @@ class UsernamePasswordToken extends AbstractToken parent::setAuthenticated(false); } + /** + * {@inheritdoc} + */ public function getCredentials() { return $this->credentials; } + /** + * Returns the provider key. + * + * @return string The provider key + */ public function getProviderKey() { return $this->providerKey; diff --git a/Core/Role/RoleHierarchy.php b/Core/Role/RoleHierarchy.php index a368a44..2e7df0e 100644 --- a/Core/Role/RoleHierarchy.php +++ b/Core/Role/RoleHierarchy.php @@ -34,11 +34,7 @@ class RoleHierarchy implements RoleHierarchyInterface } /** - * Returns an array of all roles reachable by the given ones. - * - * @param RoleInterface[] $roles An array of RoleInterface instances - * - * @return RoleInterface[] An array of RoleInterface instances + * {@inheritdoc} */ public function getReachableRoles(array $roles) { diff --git a/Core/Role/RoleHierarchyInterface.php b/Core/Role/RoleHierarchyInterface.php index 2ea6ca3..c994009 100644 --- a/Core/Role/RoleHierarchyInterface.php +++ b/Core/Role/RoleHierarchyInterface.php @@ -19,7 +19,7 @@ namespace Symfony\Component\Security\Core\Role; interface RoleHierarchyInterface { /** - * Returns an array of all reachable roles. + * Returns an array of all reachable roles by the given ones. * * Reachable roles are the roles directly assigned but also all roles that * are transitively reachable from them in the role hierarchy. diff --git a/Core/SecurityContext.php b/Core/SecurityContext.php index 1ec43e6..c55cecf 100644 --- a/Core/SecurityContext.php +++ b/Core/SecurityContext.php @@ -46,14 +46,9 @@ class SecurityContext implements SecurityContextInterface } /** - * Checks if the attributes are granted against the current token. + * {@inheritdoc} * * @throws AuthenticationCredentialsNotFoundException when the security context has no authentication token. - * - * @param mixed $attributes - * @param mixed|null $object - * - * @return Boolean */ final public function isGranted($attributes, $object = null) { @@ -73,9 +68,7 @@ class SecurityContext implements SecurityContextInterface } /** - * Gets the currently authenticated token. - * - * @return TokenInterface|null A TokenInterface instance or null if no authentication information is available + * {@inheritdoc} */ public function getToken() { @@ -83,9 +76,7 @@ class SecurityContext implements SecurityContextInterface } /** - * Sets the currently authenticated token. - * - * @param TokenInterface $token A TokenInterface token, or null if no further authentication information should be stored + * {@inheritdoc} */ public function setToken(TokenInterface $token = null) { diff --git a/Core/SecurityContextInterface.php b/Core/SecurityContextInterface.php index 78d6477..434f9a5 100644 --- a/Core/SecurityContextInterface.php +++ b/Core/SecurityContextInterface.php @@ -34,14 +34,14 @@ interface SecurityContextInterface /** * Sets the authentication token. * - * @param TokenInterface $token + * @param TokenInterface $token A TokenInterface token, or null if no further authentication information should be stored */ public function setToken(TokenInterface $token = null); /** * Checks if the attributes are granted against the current authentication token and optionally supplied object. * - * @param array $attributes + * @param mixed $attributes * @param mixed $object * * @return Boolean diff --git a/Core/Validator/Constraints/UserPassword.php b/Core/Validator/Constraints/UserPassword.php index ed29b0c..76c4b3b 100644 --- a/Core/Validator/Constraints/UserPassword.php +++ b/Core/Validator/Constraints/UserPassword.php @@ -21,6 +21,9 @@ class UserPassword extends Constraint public $message = 'This value should be the user current password.'; public $service = 'security.validator.user_password'; + /** + * {@inheritdoc} + */ public function validatedBy() { return $this->service; diff --git a/Core/Validator/Constraints/UserPasswordValidator.php b/Core/Validator/Constraints/UserPasswordValidator.php index a4e0f90..ab455f3 100644 --- a/Core/Validator/Constraints/UserPasswordValidator.php +++ b/Core/Validator/Constraints/UserPasswordValidator.php @@ -29,6 +29,9 @@ class UserPasswordValidator extends ConstraintValidator $this->encoderFactory = $encoderFactory; } + /** + * {@inheritdoc} + */ public function validate($password, Constraint $constraint) { $user = $this->securityContext->getToken()->getUser(); diff --git a/Resources/translations/security.da.xlf b/Resources/translations/security.da.xlf index 9c7b886..2ac4150 100644 --- a/Resources/translations/security.da.xlf +++ b/Resources/translations/security.da.xlf @@ -1,6 +1,6 @@ <?xml version="1.0"?> <xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2"> - <file source-language="no" datatype="plaintext" original="file.ext"> + <file source-language="en" datatype="plaintext" original="file.ext"> <body> <trans-unit id="1"> <source>An authentication exception occurred.</source> diff --git a/Resources/translations/security.hr.xlf b/Resources/translations/security.hr.xlf new file mode 100644 index 0000000..147b6e3 --- /dev/null +++ b/Resources/translations/security.hr.xlf @@ -0,0 +1,71 @@ +<?xml version="1.0"?> +<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2"> + <file source-language="en" datatype="plaintext" original="file.ext"> + <body> + <trans-unit id="1"> + <source>An authentication exception occurred.</source> + <target>Dogodila se autentifikacijske iznimka.</target> + </trans-unit> + <trans-unit id="2"> + <source>Authentication credentials could not be found.</source> + <target>Autentifikacijski podaci nisu pronađeni.</target> + </trans-unit> + <trans-unit id="3"> + <source>Authentication request could not be processed due to a system problem.</source> + <target>Autentifikacijski zahtjev nije moguće provesti uslijed sistemskog problema.</target> + </trans-unit> + <trans-unit id="4"> + <source>Invalid credentials.</source> + <target>Neispravni akreditacijski podaci.</target> + </trans-unit> + <trans-unit id="5"> + <source>Cookie has already been used by someone else.</source> + <target>Cookie je već netko drugi iskoristio.</target> + </trans-unit> + <trans-unit id="6"> + <source>Not privileged to request the resource.</source> + <target>Nemate privilegije zahtijevati resurs.</target> + </trans-unit> + <trans-unit id="7"> + <source>Invalid CSRF token.</source> + <target>Neispravan CSRF token.</target> + </trans-unit> + <trans-unit id="8"> + <source>Digest nonce has expired.</source> + <target>Digest nonce je isteko.</target> + </trans-unit> + <trans-unit id="9"> + <source>No authentication provider found to support the authentication token.</source> + <target>Nije pronađen autentifikacijski provider koji bi podržao autentifikacijski token.</target> + </trans-unit> + <trans-unit id="10"> + <source>No session available, it either timed out or cookies are not enabled.</source> + <target>Sesija nije dostupna, ili je istekla ili cookies nisu omogućeni.</target> + </trans-unit> + <trans-unit id="11"> + <source>No token could be found.</source> + <target>Token nije pronađen.</target> + </trans-unit> + <trans-unit id="12"> + <source>Username could not be found.</source> + <target>Korisničko ime nije pronađeno.</target> + </trans-unit> + <trans-unit id="13"> + <source>Account has expired.</source> + <target>Račun je isteko.</target> + </trans-unit> + <trans-unit id="14"> + <source>Credentials have expired.</source> + <target>Akreditacijski podaci su istekli.</target> + </trans-unit> + <trans-unit id="15"> + <source>Account is disabled.</source> + <target>Račun je onemogućen.</target> + </trans-unit> + <trans-unit id="16"> + <source>Account is locked.</source> + <target>Račun je zaključan.</target> + </trans-unit> + </body> + </file> +</xliff> diff --git a/Resources/translations/security.no.xlf b/Resources/translations/security.no.xlf index 3857ab4..3369d43 100644 --- a/Resources/translations/security.no.xlf +++ b/Resources/translations/security.no.xlf @@ -1,6 +1,6 @@ <?xml version="1.0"?> <xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2"> - <file source-language="no" datatype="plaintext" original="file.ext"> + <file source-language="en" datatype="plaintext" original="file.ext"> <body> <trans-unit id="1"> <source>An authentication exception occurred.</source> diff --git a/Resources/translations/security.pt_BR.xlf b/Resources/translations/security.pt_BR.xlf index 846fd49..61685d9 100644 --- a/Resources/translations/security.pt_BR.xlf +++ b/Resources/translations/security.pt_BR.xlf @@ -20,7 +20,7 @@ </trans-unit> <trans-unit id="5"> <source>Cookie has already been used by someone else.</source> - <target>Este cookie já esta em uso.</target> + <target>Este cookie já está em uso.</target> </trans-unit> <trans-unit id="6"> <source>Not privileged to request the resource.</source> @@ -40,7 +40,7 @@ </trans-unit> <trans-unit id="10"> <source>No session available, it either timed out or cookies are not enabled.</source> - <target>Nenhuma sessão disponível, ela expirou ou cookies estão desativados.</target> + <target>Nenhuma sessão disponível, ela expirou ou os cookies estão desativados.</target> </trans-unit> <trans-unit id="11"> <source>No token could be found.</source> @@ -52,7 +52,7 @@ </trans-unit> <trans-unit id="13"> <source>Account has expired.</source> - <target>A conta esta expirada.</target> + <target>A conta está expirada.</target> </trans-unit> <trans-unit id="14"> <source>Credentials have expired.</source> @@ -64,7 +64,7 @@ </trans-unit> <trans-unit id="16"> <source>Account is locked.</source> - <target>A conta esta travada.</target> + <target>A conta está travada.</target> </trans-unit> </body> </file> diff --git a/Resources/translations/security.vi.xlf b/Resources/translations/security.vi.xlf new file mode 100644 index 0000000..b85a439 --- /dev/null +++ b/Resources/translations/security.vi.xlf @@ -0,0 +1,71 @@ +<?xml version="1.0"?> +<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2"> + <file source-language="en" datatype="plaintext" original="file.ext"> + <body> + <trans-unit id="1"> + <source>An authentication exception occurred.</source> + <target>Có lỗi trong quá trình xác thực.</target> + </trans-unit> + <trans-unit id="2"> + <source>Authentication credentials could not be found.</source> + <target>Thông tin dùng để xác thực không tìm thấy.</target> + </trans-unit> + <trans-unit id="3"> + <source>Authentication request could not be processed due to a system problem.</source> + <target>Yêu cầu xác thực không thể thực hiện do lỗi của hệ thống.</target> + </trans-unit> + <trans-unit id="4"> + <source>Invalid credentials.</source> + <target>Thông tin dùng để xác thực không hợp lệ.</target> + </trans-unit> + <trans-unit id="5"> + <source>Cookie has already been used by someone else.</source> + <target>Cookie đã được dùng bởi người dùng khác.</target> + </trans-unit> + <trans-unit id="6"> + <source>Not privileged to request the resource.</source> + <target>Không được phép yêu cầu tài nguyên.</target> + </trans-unit> + <trans-unit id="7"> + <source>Invalid CSRF token.</source> + <target>Mã CSRF không hợp lệ.</target> + </trans-unit> + <trans-unit id="8"> + <source>Digest nonce has expired.</source> + <target>Mã dùng một lần đã hết hạn.</target> + </trans-unit> + <trans-unit id="9"> + <source>No authentication provider found to support the authentication token.</source> + <target>Không tìm thấy nhà cung cấp dịch vụ xác thực nào cho mã xác thực mà bạn sử dụng.</target> + </trans-unit> + <trans-unit id="10"> + <source>No session available, it either timed out or cookies are not enabled.</source> + <target>Không tìm thấy phiên làm việc. Phiên làm việc hoặc cookie có thể bị tắt.</target> + </trans-unit> + <trans-unit id="11"> + <source>No token could be found.</source> + <target>Không tìm thấy mã token.</target> + </trans-unit> + <trans-unit id="12"> + <source>Username could not be found.</source> + <target>Không tìm thấy tên người dùng username.</target> + </trans-unit> + <trans-unit id="13"> + <source>Account has expired.</source> + <target>Tài khoản đã hết hạn.</target> + </trans-unit> + <trans-unit id="14"> + <source>Credentials have expired.</source> + <target>Thông tin xác thực đã hết hạn.</target> + </trans-unit> + <trans-unit id="15"> + <source>Account is disabled.</source> + <target>Tài khoản bị tạm ngừng.</target> + </trans-unit> + <trans-unit id="16"> + <source>Account is locked.</source> + <target>Tài khoản bị khóa.</target> + </trans-unit> + </body> + </file> +</xliff> |