Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
smsManager
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Cristian Mauricio Diaz Canales
smsManager
Commits
6ca25d59
Commit
6ca25d59
authored
Jun 05, 2019
by
Cristian Mauricio Diaz Canales
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
correccion
parent
e0095f35
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
31 deletions
+31
-31
src/BackendBundle/Controller/BackendUsuarioController.php
src/BackendBundle/Controller/BackendUsuarioController.php
+31
-31
No files found.
src/BackendBundle/Controller/BackendUsuarioController.php
View file @
6ca25d59
...
...
@@ -43,7 +43,7 @@ class BackendUsuarioController extends Controller
}
public
function
crearAction
(
Request
$request
){
$busId
=
$this
->
getUser
()
->
getBusId
();
//
$busId = $this->getUser()->getBusId();
//$busId = '';
$log
=
Utiles
::
setLog
(
'BackendBundle\Controller\BackendUsuarioController:crearAction[BusId:'
.
$busId
.
']'
,
'backend/backend'
);
$log
->
debug
(
'Entrando'
);
...
...
@@ -105,7 +105,7 @@ class BackendUsuarioController extends Controller
'Usuario creado exitosamente!'
);
return
$this
->
redirect
(
$this
->
generateUrl
(
'backend_backendusuario_editar'
,
array
(
'b
us_
id'
=>
$backendUsuario
->
getBusId
())));
return
$this
->
redirect
(
$this
->
generateUrl
(
'backend_backendusuario_editar'
,
array
(
'bid'
=>
$backendUsuario
->
getBusId
())));
}
...
...
@@ -114,13 +114,13 @@ class BackendUsuarioController extends Controller
//$busId = '';
$log
=
Utiles
::
setLog
(
'BackendBundle\Controller\BackendUsuarioController:editarAction[BusId:'
.
$busId
.
']'
,
'backend/backend'
);
$log
->
debug
(
'Entrando'
);
$b
us_
id
=
$request
->
get
(
'bid'
,
null
);
$log
->
debug
(
'Entrando... bid:'
.
$b
us_
id
);
$bid
=
$request
->
get
(
'bid'
,
null
);
$log
->
debug
(
'Entrando... bid:'
.
$bid
);
$backendUsuario
=
BackendUsuarioQuery
::
create
()
->
filterByBusEliminado
(
0
)
->
findPk
(
$b
us_
id
);
$backendUsuario
=
BackendUsuarioQuery
::
create
()
->
filterByBusEliminado
(
0
)
->
findPk
(
$bid
);
if
(
$backendUsuario
==
null
){
throw
$this
->
createNotFoundException
(
'BackendUsuario no existe en base a b
us_id:'
.
$bus_
id
);
throw
$this
->
createNotFoundException
(
'BackendUsuario no existe en base a b
id:'
.
$b
id
);
}
return
$this
->
render
(
'backend/backendusuario/editar.html.twig'
,
array
(
...
...
@@ -136,35 +136,35 @@ class BackendUsuarioController extends Controller
$log
=
Utiles
::
setLog
(
'BackendBundle\Controller\BackendUsuarioController:actualizarAction[BusId:'
.
$busId
.
']'
,
'backend/backend'
);
$log
->
debug
(
'Entrando.'
);
$b
us_
id
=
$request
->
get
(
'bid'
);
$bid
=
$request
->
get
(
'bid'
);
$email
=
$request
->
get
(
'backendUsuarioEmail'
);
$nombres
=
$request
->
get
(
'backendUsuarioNombres'
);
$roles
=
$request
->
get
(
'backendUsuarioRoles'
,
array
());
$estado
=
$request
->
get
(
'backendUsuarioEstado'
);
$log
->
debug
(
'bid:'
.
$b
us_
id
.
' | email:'
.
$email
.
' | nombres:'
.
$nombres
.
' | estado:'
.
$estado
);
$log
->
debug
(
'bid:'
.
$bid
.
' | email:'
.
$email
.
' | nombres:'
.
$nombres
.
' | estado:'
.
$estado
);
if
(
!
is_numeric
(
$b
us_
id
)
||
!
filter_var
(
$email
,
FILTER_VALIDATE_EMAIL
)
||
$nombres
==
''
||
!
is_numeric
(
$estado
)){
if
(
!
is_numeric
(
$bid
)
||
!
filter_var
(
$email
,
FILTER_VALIDATE_EMAIL
)
||
$nombres
==
''
||
!
is_numeric
(
$estado
)){
$log
->
err
(
'parametros invalidos..'
);
throw
$this
->
createNotFoundException
(
'parametros invalidos'
);
}
if
(
$this
->
verificarEmail
(
$email
,
$b
us_
id
)
==
true
){
if
(
$this
->
verificarEmail
(
$email
,
$bid
)
==
true
){
$this
->
get
(
'session'
)
->
getFlashBag
()
->
add
(
'error'
,
'Usuario ya esta registrado con el email:'
.
$email
);
return
$this
->
redirect
(
$this
->
generateUrl
(
'backend_backendusuario_editar'
,
array
(
'b
us_id'
=>
$bus_
id
)));
return
$this
->
redirect
(
$this
->
generateUrl
(
'backend_backendusuario_editar'
,
array
(
'b
id'
=>
$b
id
)));
}
$backendUsuario
=
BackendUsuarioQuery
::
create
()
->
filterByBusEliminado
(
0
)
->
findPk
(
$b
us_
id
);
$backendUsuario
=
BackendUsuarioQuery
::
create
()
->
filterByBusEliminado
(
0
)
->
findPk
(
$bid
);
if
(
$backendUsuario
==
null
){
throw
$this
->
createNotFoundException
(
'BackendUsuario no existe en base a b
us_id:'
.
$bus_
id
);
throw
$this
->
createNotFoundException
(
'BackendUsuario no existe en base a b
id:'
.
$b
id
);
}
$backendUsuario
->
setBusEmail
(
$email
);
...
...
@@ -188,13 +188,13 @@ class BackendUsuarioController extends Controller
'Usuario modificado exitosamente!'
);
return
$this
->
redirect
(
$this
->
generateUrl
(
'backend_backendusuario_editar'
,
array
(
'b
us_
id'
=>
$backendUsuario
->
getBusId
())));
return
$this
->
redirect
(
$this
->
generateUrl
(
'backend_backendusuario_editar'
,
array
(
'bid'
=>
$backendUsuario
->
getBusId
())));
}
public
function
eliminarAction
(
Request
$request
){
$busId
=
$this
->
getUser
()
->
getBusId
();
//$busId = ''
;
//$busId = $this->getUser()->getBusId();-> este era el problema
$busId
=
$request
->
get
(
'bid'
)
;
$log
=
Utiles
::
setLog
(
'BackendBundle\Controller\BackendUsuarioController:eliminarAction[BusId:'
.
$busId
.
']'
,
'backend/backend'
);
$log
->
debug
(
'Entrando.'
);
...
...
@@ -211,7 +211,7 @@ class BackendUsuarioController extends Controller
$backendUsuario
=
BackendUsuarioQuery
::
create
()
->
filterByBusEliminado
(
0
)
->
findPk
(
$busId
);
if
(
$backendUsuario
==
null
){
throw
$this
->
createNotFoundException
(
'BackendUsuario no existe en base a b
us_
id:'
.
$busId
);
throw
$this
->
createNotFoundException
(
'BackendUsuario no existe en base a bid:'
.
$busId
);
}
$backendUsuario
->
setBusEliminado
(
1
);
...
...
@@ -228,26 +228,26 @@ class BackendUsuarioController extends Controller
}
public
function
resetAction
(
Request
$request
){
$busId
=
$this
->
getUser
()
->
getBusId
();
//$busId = ''
;
//
$busId = $this->getUser()->getBusId();
$busId
=
$request
->
get
(
'bid'
)
;
$log
=
Utiles
::
setLog
(
'BackendBundle\Controller\BackendUsuarioController:resetAction[BusId:'
.
$busId
.
']'
,
'backend/backend'
);
$log
->
debug
(
'Entrando.'
);
$b
us_
id
=
$request
->
get
(
'bid'
);
$bid
=
$request
->
get
(
'bid'
);
$log
->
debug
(
'bid:'
.
$b
us_
id
);
$log
->
debug
(
'bid:'
.
$bid
);
if
(
!
is_numeric
(
$b
us_
id
)){
if
(
!
is_numeric
(
$bid
)){
$log
->
err
(
'reset| parametros invalidos..'
);
throw
$this
->
createNotFoundException
(
'parametros invalidos'
);
}
else
{
$backendUsuario
=
BackendUsuarioQuery
::
create
()
->
filterByBusEliminado
(
0
)
->
findPk
(
$b
us_
id
);
$backendUsuario
=
BackendUsuarioQuery
::
create
()
->
filterByBusEliminado
(
0
)
->
findPk
(
$bid
);
if
(
$backendUsuario
==
null
){
throw
$this
->
createNotFoundException
(
'BackendUsuario no existe en base a b
us_id:'
.
$bus_
id
);
throw
$this
->
createNotFoundException
(
'BackendUsuario no existe en base a b
id:'
.
$b
id
);
}
$encoder
=
$this
->
container
->
get
(
'security.password_encoder'
);
...
...
@@ -268,13 +268,13 @@ class BackendUsuarioController extends Controller
}
private
function
verificarEmail
(
$email
,
$b
us_
id
=
null
)
{
private
function
verificarEmail
(
$email
,
$bid
=
null
)
{
if
(
$b
us_
id
==
null
){
if
(
$bid
==
null
){
$count
=
BackendUsuarioQuery
::
create
()
->
filterByBusEliminado
(
0
)
->
filterByBusEmail
(
$email
)
->
count
();
}
else
{
$count
=
BackendUsuarioQuery
::
create
()
->
filterByBusEliminado
(
0
)
->
filterByBusEmail
(
$email
)
->
filterByBusId
(
array
(
$b
us_
id
),
\Criteria
::
NOT_IN
)
->
count
();
$count
=
BackendUsuarioQuery
::
create
()
->
filterByBusEliminado
(
0
)
->
filterByBusEmail
(
$email
)
->
filterByBusId
(
array
(
$bid
),
\Criteria
::
NOT_IN
)
->
count
();
}
if
(
$count
>
0
)
...
...
@@ -302,7 +302,7 @@ class BackendUsuarioController extends Controller
$log
->
debug
(
'Entrando.'
);
$log
->
debug
(
'b
us_
id:'
.
$busId
);
$log
->
debug
(
'bid:'
.
$busId
);
if
(
!
is_numeric
(
$busId
)){
...
...
@@ -314,7 +314,7 @@ class BackendUsuarioController extends Controller
$backendUsuario
=
BackendUsuarioQuery
::
create
()
->
filterByBusEliminado
(
0
)
->
findPk
(
$busId
);
if
(
$backendUsuario
==
null
){
throw
$this
->
createNotFoundException
(
'BackendUsuario no existe en base a b
us_
id:'
.
$busId
);
throw
$this
->
createNotFoundException
(
'BackendUsuario no existe en base a bid:'
.
$busId
);
}
return
$this
->
render
(
...
...
@@ -338,7 +338,7 @@ class BackendUsuarioController extends Controller
$log
->
debug
(
'Entrando.'
);
$log
->
debug
(
'b
us_
id:'
.
$busId
);
$log
->
debug
(
'bid:'
.
$busId
);
if
(
!
is_numeric
(
$busId
)){
...
...
@@ -350,7 +350,7 @@ class BackendUsuarioController extends Controller
$backendUsuario
=
BackendUsuarioQuery
::
create
()
->
filterByBusEliminado
(
0
)
->
findPk
(
$busId
);
if
(
$backendUsuario
==
null
){
throw
$this
->
createNotFoundException
(
'BackendUsuario no existe en base a b
us_
id:'
.
$busId
);
throw
$this
->
createNotFoundException
(
'BackendUsuario no existe en base a bid:'
.
$busId
);
}
$passActual
=
$request
->
get
(
'backendUsuarioPassActual'
,
null
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment