Skip to content

Commit f8c19f1

Browse files
author
Bastian Waidelich
authored
Merge pull request #17 from Flowpack/coding-style
TASK: Adjust Coding style to recent CGL
2 parents 8e38941 + 8a61743 commit f8c19f1

File tree

3 files changed

+83
-75
lines changed

3 files changed

+83
-75
lines changed

Classes/Flowpack/Neos/FrontendLogin/Controller/AuthenticationController.php

Lines changed: 51 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -8,50 +8,55 @@
88
/**
99
* Controller for displaying a login/logout form and authenticating/logging out "frontend users"
1010
*/
11-
class AuthenticationController extends AbstractAuthenticationController {
12-
13-
/**
14-
* @return void
15-
*/
16-
public function indexAction() {
17-
$this->view->assign('account', $this->securityContext->getAccount());
18-
}
19-
20-
/**
21-
* return void
22-
*/
23-
public function logoutAction() {
24-
parent::logoutAction();
25-
26-
$uri = $this->request->getInternalArgument('__redirectAfterLogoutUri');
27-
28-
if (empty($uri)) {
29-
$this->redirect('index');
30-
} else {
31-
$this->redirectToUri($uri);
32-
}
33-
}
34-
35-
/**
36-
* @param ActionRequest $originalRequest The request that was intercepted by the security framework, NULL if there was none
37-
* @return string
38-
*/
39-
protected function onAuthenticationSuccess(ActionRequest $originalRequest = NULL) {
40-
$uri = $this->request->getInternalArgument('__redirectAfterLoginUri');
41-
42-
if (empty($uri)) {
43-
$this->redirect('index');
44-
} else {
45-
$this->redirectToUri($uri);
46-
}
47-
}
48-
49-
/**
50-
* Disable the technical error flash message
51-
*
52-
* @return boolean
53-
*/
54-
protected function getErrorFlashMessage() {
55-
return FALSE;
56-
}
11+
class AuthenticationController extends AbstractAuthenticationController
12+
{
13+
14+
/**
15+
* @return void
16+
*/
17+
public function indexAction()
18+
{
19+
$this->view->assign('account', $this->securityContext->getAccount());
20+
}
21+
22+
/**
23+
* return void
24+
*/
25+
public function logoutAction()
26+
{
27+
parent::logoutAction();
28+
29+
$uri = $this->request->getInternalArgument('__redirectAfterLogoutUri');
30+
31+
if (empty($uri)) {
32+
$this->redirect('index');
33+
} else {
34+
$this->redirectToUri($uri);
35+
}
36+
}
37+
38+
/**
39+
* @param ActionRequest $originalRequest The request that was intercepted by the security framework, NULL if there was none
40+
* @return string
41+
*/
42+
protected function onAuthenticationSuccess(ActionRequest $originalRequest = null)
43+
{
44+
$uri = $this->request->getInternalArgument('__redirectAfterLoginUri');
45+
46+
if (empty($uri)) {
47+
$this->redirect('index');
48+
} else {
49+
$this->redirectToUri($uri);
50+
}
51+
}
52+
53+
/**
54+
* Disable the technical error flash message
55+
*
56+
* @return boolean
57+
*/
58+
protected function getErrorFlashMessage()
59+
{
60+
return false;
61+
}
5762
}

Classes/Flowpack/Neos/FrontendLogin/Security/NeosRequestPattern.php

Lines changed: 31 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -8,36 +8,39 @@
88
/**
99
* A request pattern that can detect and match "frontend" and "backend" mode
1010
*/
11-
class NeosRequestPattern implements RequestPatternInterface {
11+
class NeosRequestPattern implements RequestPatternInterface
12+
{
1213

13-
/**
14-
* @var array
15-
*/
16-
protected $options;
14+
/**
15+
* @var array
16+
*/
17+
protected $options;
1718

18-
/**
19-
* Expects options in the form array('matchFrontend' => TRUE/FALSE)
20-
*
21-
* @param array $options
22-
*/
23-
public function __construct(array $options) {
24-
$this->options = $options;
25-
}
19+
/**
20+
* Expects options in the form array('matchFrontend' => TRUE/FALSE)
21+
*
22+
* @param array $options
23+
*/
24+
public function __construct(array $options)
25+
{
26+
$this->options = $options;
27+
}
2628

27-
/**
28-
* Matches a \Neos\Flow\Mvc\RequestInterface against its set pattern rules
29-
*
30-
* @param RequestInterface $request The request that should be matched
31-
* @return boolean TRUE if the pattern matched, FALSE otherwise
32-
*/
33-
public function matchRequest(RequestInterface $request) {
34-
if (!$request instanceof ActionRequest) {
35-
return FALSE;
36-
}
37-
$shouldMatchFrontend = isset($this->options['matchFrontend']) && $this->options['matchFrontend'] === true;
38-
$requestPath = $request->getHttpRequest()->getUri()->getPath();
39-
$requestPathMatchesBackend = substr($requestPath, 0, 5) === '/neos' || strpos($requestPath, '@') !== FALSE;
40-
return $shouldMatchFrontend !== $requestPathMatchesBackend;
41-
}
29+
/**
30+
* Matches a \Neos\Flow\Mvc\RequestInterface against its set pattern rules
31+
*
32+
* @param RequestInterface $request The request that should be matched
33+
* @return boolean TRUE if the pattern matched, FALSE otherwise
34+
*/
35+
public function matchRequest(RequestInterface $request)
36+
{
37+
if (!$request instanceof ActionRequest) {
38+
return false;
39+
}
40+
$shouldMatchFrontend = isset($this->options['matchFrontend']) && $this->options['matchFrontend'] === true;
41+
$requestPath = $request->getHttpRequest()->getUri()->getPath();
42+
$requestPathMatchesBackend = substr($requestPath, 0, 5) === '/neos' || strpos($requestPath, '@') !== false;
43+
return $shouldMatchFrontend !== $requestPathMatchesBackend;
44+
}
4245

4346
}

Configuration/NodeTypes.LoginForm.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#
44
'Flowpack.Neos.FrontendLogin:LoginForm':
55
superTypes:
6-
'Neos.Neos:Plugin': TRUE
6+
'Neos.Neos:Plugin': true
77
ui:
88
label: i18n
99
icon: 'icon-key'

0 commit comments

Comments
 (0)