Commit b18bf7ae8327174d705f4f3352d15f4b7410cef1
1 parent
7d1b14d4d7
Exists in
master
desrenombrado el login debido a que dejo de funcionar
Showing
4 changed files
with
167 additions
and
167 deletions
Show diff stats
app/Resources/views/login/login.html.twig
... | ... | @@ -1,112 +0,0 @@ |
1 | -{% extends 'base.html.twig' %} | |
2 | - | |
3 | - | |
4 | -{% block stylesheets %} | |
5 | - {{ parent() }} | |
6 | - <link rel="stylesheet" href="{{ asset('assets/vendor/AppBundle/login.css') }}"> | |
7 | -{% endblock %} | |
8 | - | |
9 | -{% block body %} | |
10 | - {% block navegacion %} | |
11 | - | |
12 | - | |
13 | - <nav class="navbar navbar-default"> | |
14 | - <div class="container-fluid"> | |
15 | - <div class="navbar-header"> | |
16 | - <a class="navbar-brand" href="#"> | |
17 | - Centro de Estudios Ambientales UBV | |
18 | - </a> | |
19 | - </div> | |
20 | - | |
21 | - <div class="collapse navbar-collapse"> | |
22 | - <ul class="nav navbar-nav navbar-right"> | |
23 | - <li><a href="{{ path('homepage') }}">Regresar al Portal</a></li> | |
24 | - </ul> | |
25 | - | |
26 | - </div> | |
27 | - | |
28 | - </div> | |
29 | - | |
30 | - </nav> | |
31 | - | |
32 | - | |
33 | - {% endblock %} | |
34 | - | |
35 | - <div class="content-wrapper"> | |
36 | - <div class="container"> | |
37 | - <div class="row"> | |
38 | - <div class="col-md-12"> | |
39 | - <h4 class="page-head-line">Acceso al sistema CEA@UBV</h4> | |
40 | - | |
41 | - </div> | |
42 | - | |
43 | - </div> | |
44 | - <div class="row"> | |
45 | - <div class="col-md-6"> | |
46 | - | |
47 | - <div class="col-md-4"> | |
48 | - <img src="{{ asset('bundles/framework/images/portal/logo_ubv.png') }}" /> | |
49 | - </div> | |
50 | - | |
51 | - <div class="col-md-8"> | |
52 | - {% if error %} | |
53 | - <div class="alert alert-danger">{{ error.messageKey|trans(error.messageData, 'security') }}</div> | |
54 | - {% endif %} | |
55 | - <form action="{{ path('login') }}" method="post" role="form"> | |
56 | - <div class="form-group"> | |
57 | - <label for="username">Nombre de Usuario:</label> | |
58 | - <input type="text" class="form-control" id="username" name="_username" value="{{ last_username }}" /> | |
59 | - </div> | |
60 | - | |
61 | - <div class="form-group"> | |
62 | - <label for="password">Contraseรฑa:</label> | |
63 | - <input type="password" class="form-control" id="password" name="_password" /> | |
64 | - </div> | |
65 | - | |
66 | - <input type="hidden" name="_csrf_token" | |
67 | - value="{{ csrf_token('authenticate') }}" | |
68 | - > | |
69 | - | |
70 | - | |
71 | - <input type="hidden" name="_target_path" value="{{ path('user_roles') }}" /> | |
72 | - | |
73 | - | |
74 | - | |
75 | - <button class="btn btn-primary" type="submit"><span class="glyphicon glyphicon-user"></span> Ingresar</button> | |
76 | - </form> | |
77 | - <hr /> | |
78 | - </div> | |
79 | - </div> | |
80 | - <div class="col-md-5"> | |
81 | - | |
82 | - <div class="alert alert-success"> | |
83 | - <strong> ยฟIngresa por Primera Vez? Aquรญ unas breves instrucciones:</strong> | |
84 | - <ul> | |
85 | - <li> | |
86 | - A su direcciรณn de Correo deben haber llegado las credenciales de Acceso luego de haber solicitado Adscripciรณn | |
87 | - </li> | |
88 | - <li> | |
89 | - Una vez dentro, realizarรก el proceso de solicitud de adscripciรณn al CEA | |
90 | - </li> | |
91 | - <li> | |
92 | - Para este proceso debe tener en digital los siguientes documentos: | |
93 | - <ol> | |
94 | - <li>Digital de la Constancia de Trabajo (*)</li> | |
95 | - <li>Digital del Tรญtulo de Pregrado (*)</li> | |
96 | - <li>Digital del Tรญtulo de Postgrado mas reciente</li> | |
97 | - <li>Digital de la Constancia de Aprobaciรณn de Concurso de Oposiciรณn</li> | |
98 | - <li>Digital de la Constancia de Aprobaciรณn de Ascensos</li> | |
99 | - | |
100 | - </ol> | |
101 | - </li> | |
102 | - | |
103 | - </ul> | |
104 | - | |
105 | - </div> | |
106 | - </div> | |
107 | - | |
108 | - </div> | |
109 | - </div> | |
110 | - </div> | |
111 | - | |
112 | -{% endblock %} | |
113 | 0 | \ No newline at end of file |
app/Resources/views/security/login.html.twig
... | ... | @@ -0,0 +1,112 @@ |
1 | +{% extends 'base.html.twig' %} | |
2 | + | |
3 | + | |
4 | +{% block stylesheets %} | |
5 | + {{ parent() }} | |
6 | + <link rel="stylesheet" href="{{ asset('assets/vendor/AppBundle/login.css') }}"> | |
7 | +{% endblock %} | |
8 | + | |
9 | +{% block body %} | |
10 | + {% block navegacion %} | |
11 | + | |
12 | + | |
13 | + <nav class="navbar navbar-default"> | |
14 | + <div class="container-fluid"> | |
15 | + <div class="navbar-header"> | |
16 | + <a class="navbar-brand" href="#"> | |
17 | + Centro de Estudios Ambientales UBV | |
18 | + </a> | |
19 | + </div> | |
20 | + | |
21 | + <div class="collapse navbar-collapse"> | |
22 | + <ul class="nav navbar-nav navbar-right"> | |
23 | + <li><a href="{{ path('homepage') }}">Regresar al Portal</a></li> | |
24 | + </ul> | |
25 | + | |
26 | + </div> | |
27 | + | |
28 | + </div> | |
29 | + | |
30 | + </nav> | |
31 | + | |
32 | + | |
33 | + {% endblock %} | |
34 | + | |
35 | + <div class="content-wrapper"> | |
36 | + <div class="container"> | |
37 | + <div class="row"> | |
38 | + <div class="col-md-12"> | |
39 | + <h4 class="page-head-line">Acceso al sistema CEA@UBV</h4> | |
40 | + | |
41 | + </div> | |
42 | + | |
43 | + </div> | |
44 | + <div class="row"> | |
45 | + <div class="col-md-6"> | |
46 | + | |
47 | + <div class="col-md-4"> | |
48 | + <img src="{{ asset('bundles/framework/images/portal/logo_ubv.png') }}" /> | |
49 | + </div> | |
50 | + | |
51 | + <div class="col-md-8"> | |
52 | + {% if error %} | |
53 | + <div class="alert alert-danger">{{ error.messageKey|trans(error.messageData, 'security') }}</div> | |
54 | + {% endif %} | |
55 | + <form action="{{ path('login') }}" method="post" role="form"> | |
56 | + <div class="form-group"> | |
57 | + <label for="username">Nombre de Usuario:</label> | |
58 | + <input type="text" class="form-control" id="username" name="_username" value="{{ last_username }}" /> | |
59 | + </div> | |
60 | + | |
61 | + <div class="form-group"> | |
62 | + <label for="password">Contraseรฑa:</label> | |
63 | + <input type="password" class="form-control" id="password" name="_password" /> | |
64 | + </div> | |
65 | + | |
66 | + <input type="hidden" name="_csrf_token" | |
67 | + value="{{ csrf_token('authenticate') }}" | |
68 | + > | |
69 | + | |
70 | + | |
71 | + <input type="hidden" name="_target_path" value="{{ path('user_roles') }}" /> | |
72 | + | |
73 | + | |
74 | + | |
75 | + <button class="btn btn-primary" type="submit"><span class="glyphicon glyphicon-user"></span> Ingresar</button> | |
76 | + </form> | |
77 | + <hr /> | |
78 | + </div> | |
79 | + </div> | |
80 | + <div class="col-md-5"> | |
81 | + | |
82 | + <div class="alert alert-success"> | |
83 | + <strong> ยฟIngresa por Primera Vez? Aquรญ unas breves instrucciones:</strong> | |
84 | + <ul> | |
85 | + <li> | |
86 | + A su direcciรณn de Correo deben haber llegado las credenciales de Acceso luego de haber solicitado Adscripciรณn | |
87 | + </li> | |
88 | + <li> | |
89 | + Una vez dentro, realizarรก el proceso de solicitud de adscripciรณn al CEA | |
90 | + </li> | |
91 | + <li> | |
92 | + Para este proceso debe tener en digital los siguientes documentos: | |
93 | + <ol> | |
94 | + <li>Digital de la Constancia de Trabajo (*)</li> | |
95 | + <li>Digital del Tรญtulo de Pregrado (*)</li> | |
96 | + <li>Digital del Tรญtulo de Postgrado mas reciente</li> | |
97 | + <li>Digital de la Constancia de Aprobaciรณn de Concurso de Oposiciรณn</li> | |
98 | + <li>Digital de la Constancia de Aprobaciรณn de Ascensos</li> | |
99 | + | |
100 | + </ol> | |
101 | + </li> | |
102 | + | |
103 | + </ul> | |
104 | + | |
105 | + </div> | |
106 | + </div> | |
107 | + | |
108 | + </div> | |
109 | + </div> | |
110 | + </div> | |
111 | + | |
112 | +{% endblock %} | |
0 | 113 | \ No newline at end of file | ... | ... |
src/AppBundle/Controller/LoginController.php
... | ... | @@ -1,55 +0,0 @@ |
1 | -<?php | |
2 | -/** | |
3 | - * Created by PhpStorm. | |
4 | - * User: ubv-cipee | |
5 | - * Date: 29/06/16 | |
6 | - * Time: 10:02 AM | |
7 | - */ | |
8 | - | |
9 | -// src/AppBundle/Controller/SecurityController.php | |
10 | -namespace AppBundle\Controller; | |
11 | - | |
12 | -use Symfony\Bundle\FrameworkBundle\Controller\Controller; | |
13 | -use Symfony\Component\HttpFoundation\Request; | |
14 | -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; | |
15 | - | |
16 | -class LoginController extends Controller | |
17 | -{ | |
18 | - /** | |
19 | - * @Route("/ingresar", name="login") | |
20 | - */ | |
21 | - public function loginAction(Request $request) | |
22 | - { | |
23 | - $authenticationUtils = $this->get('security.authentication_utils'); | |
24 | - | |
25 | - // get the login error if there is one | |
26 | - $error = $authenticationUtils->getLastAuthenticationError(); | |
27 | - | |
28 | - // last username entered by the user | |
29 | - $lastUsername = $authenticationUtils->getLastUsername(); | |
30 | - | |
31 | - return $this->render( | |
32 | - 'login/login.html.twig', | |
33 | - array( | |
34 | - // last username entered by the user | |
35 | - 'last_username' => $lastUsername, | |
36 | - 'error' => $error, | |
37 | - ) | |
38 | - ); | |
39 | - } | |
40 | - | |
41 | - /** | |
42 | - * @Route("/verificar", name="user_roles") | |
43 | - */ | |
44 | - public function verificarAction(Request $request) | |
45 | - { | |
46 | - if (!$this->get('security.authorization_checker')->isGranted('IS_AUTHENTICATED_FULLY')) { | |
47 | - return $this->redirect($this->generateUrl('login')); | |
48 | - } | |
49 | - | |
50 | - | |
51 | - if($this->isGranted('ROLE_DOCENTE')){ | |
52 | - return $this->redirect($this->generateUrl('solicitud_adscripcion')); | |
53 | - } | |
54 | - } | |
55 | -} | |
56 | 0 | \ No newline at end of file |
src/AppBundle/Controller/SecurityController.php
... | ... | @@ -0,0 +1,55 @@ |
1 | +<?php | |
2 | +/** | |
3 | + * Created by PhpStorm. | |
4 | + * User: ubv-cipee | |
5 | + * Date: 29/06/16 | |
6 | + * Time: 10:02 AM | |
7 | + */ | |
8 | + | |
9 | +// src/AppBundle/Controller/SecurityController.php | |
10 | +namespace AppBundle\Controller; | |
11 | + | |
12 | +use Symfony\Bundle\FrameworkBundle\Controller\Controller; | |
13 | +use Symfony\Component\HttpFoundation\Request; | |
14 | +use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; | |
15 | + | |
16 | +class SecurityController extends Controller | |
17 | +{ | |
18 | + /** | |
19 | + * @Route("/login", name="login") | |
20 | + */ | |
21 | + public function loginAction(Request $request) | |
22 | + { | |
23 | + $authenticationUtils = $this->get('security.authentication_utils'); | |
24 | + | |
25 | + // get the login error if there is one | |
26 | + $error = $authenticationUtils->getLastAuthenticationError(); | |
27 | + | |
28 | + // last username entered by the user | |
29 | + $lastUsername = $authenticationUtils->getLastUsername(); | |
30 | + | |
31 | + return $this->render( | |
32 | + 'security/login.html.twig', | |
33 | + array( | |
34 | + // last username entered by the user | |
35 | + 'last_username' => $lastUsername, | |
36 | + 'error' => $error, | |
37 | + ) | |
38 | + ); | |
39 | + } | |
40 | + | |
41 | + /** | |
42 | + * @Route("/verificar", name="user_roles") | |
43 | + */ | |
44 | + public function verificarAction(Request $request) | |
45 | + { | |
46 | + if (!$this->get('security.authorization_checker')->isGranted('IS_AUTHENTICATED_FULLY')) { | |
47 | + return $this->redirect($this->generateUrl('login')); | |
48 | + } | |
49 | + | |
50 | + | |
51 | + if($this->isGranted('ROLE_DOCENTE')){ | |
52 | + return $this->redirect($this->generateUrl('solicitud_adscripcion')); | |
53 | + } | |
54 | + } | |
55 | +} | |
0 | 56 | \ No newline at end of file | ... | ... |