8000 Various fixes by pborreli · Pull Request #119 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

Various fixes #119

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
16 commits merged into from
Feb 27, 2011
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
[Security] Removed useless else
  • Loading branch information
pborreli committed Feb 27, 2011
commit 787812d968338761731d5847ef1644d9ce819c80
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,8 @@ protected function isAceApplicable($requiredMask, EntryInterface $ace)
return 0 !== ($ace->getMask() & $requiredMask);
} else if (self::EQUAL === $strategy) {
return $requiredMask === $ace->getMask();
} else {
throw new \RuntimeException(sprintf('The strategy "%s" is not supported.', $strategy));
}

throw new \RuntimeException(sprintf('The strategy "%s" is not supported.', $strategy));
}
}
10 changes: 5 additions & 5 deletions src/Symfony/Component/Security/Acl/Voter/AclVoter.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,13 +111,13 @@ public function vote(TokenInterface $token, $object, array $attributes)
}

return self::ACCESS_GRANTED;
} else {
if (null !== $this->logger) {
$this->logger->debug('ACL found, insufficient permissions. Voting to deny access.');
}
}

return self::ACCESS_DENIED;
if (null !== $this->logger) {
$this->logger->debug('ACL found, insufficient permissions. Voting to deny access.');
}

return self::ACCESS_DENIED;
} catch (NoAceFoundException $noAce) {
if (null !== $this->logger) {
$this->logger->debug('ACL found, no ACE applicable. Voting to deny access.');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ public function isPasswordValid($encoded, $raw, $salt)

if (!$this->ignorePasswordCase) {
return $this->comparePasswords($encoded, $pass2);
} else {
return $this->comparePasswords(strtolower($encoded), strtolower($pass2));
}

return $this->comparePasswords(strtolower($encoded), strtolower($pass2));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -198,15 +198,15 @@ protected function onFailure($event, Request $request, AuthenticationException $
$subRequest->attributes->set(SecurityContextInterface::AUTHENTICATION_ERROR, $failed);

return $event->getSubject()->handle($subRequest, HttpKernelInterface::SUB_REQUEST);
} else {
if (null !== $this->logger) {
$this->logger->debug(sprintf('Redirecting to %s', $this->options['failure_path']));
}

$request->getSession()->set(SecurityContextInterface::AUTHENTICATION_ERROR, $failed);
}

return new RedirectResponse(0 !== strpos($this->options['failure_path'], 'http') ? $request->getUriForPath($this->options['failure_path']) : $this->options['failure_path'], 302);
if (null !== $this->logger) {
$this->logger->debug(sprintf('Redirecting to %s', $this->options['failure_path']));
}

$request->getSession()->set(SecurityContextInterface::AUTHENTICATION_ERROR, $failed);

return new RedirectResponse(0 !== strpos($this->options['failure_path'], 'http') ? $request->getUriForPath($this->options['failure_path']) : $this->options['failure_path'], 302);
}

protected function onSuccess(EventInterface $event, Request $request, TokenInterface $token)
Expand Down
0