Commit 652b19351555f4edb9c302e8c40a8627550e3051
1 parent
b60b9176
Exists in
master
and in
1 other branch
ocultando esttatisticas para usuário comum
Showing
1 changed file
with
5 additions
and
1 deletions
Show diff stats
src/Cacic/CommonBundle/Controller/DefaultController.php
... | ... | @@ -13,6 +13,9 @@ class DefaultController extends Controller |
13 | 13 | */ |
14 | 14 | public function indexAction() |
15 | 15 | { |
16 | + $usuario = $this->getUser()->getIdUsuario(); | |
17 | + $nivel = $this->getDoctrine()->getRepository('CacicCommonBundle:Usuario' )->nivel($usuario); | |
18 | + | |
16 | 19 | $estatisticas = array( |
17 | 20 | 'totalCompMonitorados' => $this->getDoctrine()->getRepository('CacicCommonBundle:Computador')->countAll(), |
18 | 21 | 'totalInsucessosInstalacao' => $this->getDoctrine()->getRepository('CacicCommonBundle:InsucessoInstalacao')->countAll(), |
... | ... | @@ -25,7 +28,8 @@ class DefaultController extends Controller |
25 | 28 | return $this->render( |
26 | 29 | 'CacicCommonBundle:Default:index.html.twig', |
27 | 30 | array( |
28 | - 'estatisticas' => $estatisticas | |
31 | + 'estatisticas' => $estatisticas, | |
32 | + 'nivel' => $nivel[0] | |
29 | 33 | ) |
30 | 34 | ); |
31 | 35 | } | ... | ... |