Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 05e42726 authored by NINASSI Benjamin's avatar NINASSI Benjamin
Browse files

adding login check for people and meeting

parent 9f2fe586
No related branches found
No related tags found
No related merge requests found
......@@ -17,13 +17,17 @@ class MeetingController extends Controller
*/
public function indexAction(Request $request)
{
$em = $this->getDoctrine()->getManager();
if($this->get('security.authorization_checker')->isGranted('ROLE_USER')){
$em = $this->getDoctrine()->getManager();
$meeting = $em->getRepository('ClassCodeBundle:Meeting')->findAll();
$meetingWithGeoloc = $em->getRepository('ClassCodeBundle:Meeting')->findAllWithGeoLoc();
return $this->render('@ClassCode/Meeting/list.html.twig', array(
'meeting' => $meeting,
'meetingWithGeoloc' => $meetingWithGeoloc,
));
$meeting = $em->getRepository('ClassCodeBundle:Meeting')->findAll();
$meetingWithGeoloc = $em->getRepository('ClassCodeBundle:Meeting')->findAllWithGeoLoc();
return $this->render('@ClassCode/Meeting/list.html.twig', array(
'meeting' => $meeting,
'meetingWithGeoloc' => $meetingWithGeoloc,
));
}else{
return $this->render('@ClassCode/error_auth.html.twig');
}
}
}
......@@ -17,21 +17,25 @@ class PeopleController extends Controller
*/
public function indexAction(Request $request)
{
//$emp = $this->getDoctrine()->getManager('pixees');
$em = $this->getDoctrine()->getManager();
// $ninassi = $emp->getRepository('PixeesBundle:People')->findWithGeoLocBy(265);
//$ninassi = $emp->getRepository('PixeesBundle:People')->find(265);
// $geoloc = $ninassi->getGeoLoc();
// var_dump($ninassi);
//$people = $emp->getRepository('PixeesBundle:People')->findAllWithGeoLoc();
$people = $em->getRepository('ClassCodeBundle:People')->findAll();
$peopleWithGeoloc = $em->getRepository('ClassCodeBundle:People')->findAllWithGeoLoc();
return $this->render('@ClassCode/People/list.html.twig', array(
'people' => $people,
'peopleWithGeoloc' => $peopleWithGeoloc,
));
}
if($this->get('security.authorization_checker')->isGranted('ROLE_USER')){
//$emp = $this->getDoctrine()->getManager('pixees');
$em = $this->getDoctrine()->getManager();
// $ninassi = $emp->getRepository('PixeesBundle:People')->findWithGeoLocBy(265);
//$ninassi = $emp->getRepository('PixeesBundle:People')->find(265);
// $geoloc = $ninassi->getGeoLoc();
// var_dump($ninassi);
//$people = $emp->getRepository('PixeesBundle:People')->findAllWithGeoLoc();
$people = $em->getRepository('ClassCodeBundle:People')->findAll();
$peopleWithGeoloc = $em->getRepository('ClassCodeBundle:People')->findAllWithGeoLoc();
return $this->render('@ClassCode/People/list.html.twig', array(
'people' => $people,
'peopleWithGeoloc' => $peopleWithGeoloc,
));
}else{
return $this->render('@ClassCode/error_auth.html.twig');
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment