ACPSecurityController   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 42
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 2
c 1
b 0
f 1
lcom 0
cbo 1
dl 0
loc 42
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A loginCheckAction() 0 3 1
B loginAction() 0 24 1
1
<?php
2
3
/*
4
 * (c) Jim Martens <[email protected]>
5
 *
6
 * For the full copyright and license information, please view the LICENSE
7
 * file that was distributed with this source code.
8
 */
9
10
namespace TwoMartens\Bundle\CoreBundle\Controller;
11
12
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
13
use Symfony\Component\HttpFoundation\Response;
14
15
/**
16
 * Handles security actions for the ACP.
17
 *
18
 * @author    Jim Martens <[email protected]>
19
 * @copyright 2013-2015 Jim Martens
20
 */
21
class ACPSecurityController extends Controller
22
{
23
    /**
24
     * Displays the login.
25
     *
26
     * @return Response
27
     */
28
    public function loginAction()
29
    {
30
        $authenticationUtils = $this->get('security.authentication_utils');
31
32
        // get the login error if there is one
33
        $error = $authenticationUtils->getLastAuthenticationError();
34
35
        // last username entered by the user
36
        $lastUsername = $authenticationUtils->getLastUsername();
37
38
        return $this->render(
39
            'TwoMartensCoreBundle:ACPSecurity:login.html.twig',
40
            array(
41
                // last username entered by the user
42
                'last_username' => $lastUsername,
43
                'error'         => $error,
44
                'siteTitle'     => $this->get('translator')->trans('acp.login.title', array(), 'TwoMartensCoreBundle'),
45
                'login'         => [
46
                    'button' => $this->get('translator')->trans('acp.login.button', array(), 'TwoMartensCoreBundle'),
47
                    'title'  => $this->get('translator')->trans('acp.login.title', array(), 'TwoMartensCoreBundle')
48
                ],
49
            )
50
        );
51
    }
52
53
    /**
54
     * This action serves as a required placeholder.
55
     *
56
     * The real action happens in the Security system which handles
57
     * this action.
58
     */
59
    public function loginCheckAction()
60
    {
61
    }
62
}
63