ACPSecurityController::loginAction()   B
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 24
Code Lines 13

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 24
rs 8.9713
cc 1
eloc 13
nc 1
nop 0
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