<commit_before><?php

namespace PFCD\TourismBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use JMS\SecurityExtraBundle\Annotation\Secure;

use Symfony\Component\Security\Core\Encoder\MessageDigestPasswordEncoder;

use PFCD\TourismBundle\Constants;

use PFCD\TourismBundle\Entity\User;
use PFCD\TourismBundle\Form\UserType;

/**
 * User controller
 */
class UserController extends Controller
{
    
    /**************************************************************************
     ***** BACK AREA **********************************************************
     **************************************************************************/
    
    /**
     * Lists all User entities
     */
    public function backIndexAction()
    {
        $em = $this->getDoctrine()->getEntityManager();

        $users = $em->getRepository('PFCDTourismBundle:User')->findAll();

        return $this->render('PFCDTourismBundle:Back/User:index.html.twig', array(
            'users' => $users
        ));
    }
    <commit_msg>allow to the organizations to view only enabled users<commit_after><?php

namespace PFCD\TourismBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use JMS\SecurityExtraBundle\Annotation\Secure;

use Symfony\Component\Security\Core\Encoder\MessageDigestPasswordEncoder;

use PFCD\TourismBundle\Constants;

use PFCD\TourismBundle\Entity\User;
use PFCD\TourismBundle\Form\UserType;

/**
 * User controller
 */
class UserController extends Controller
{
    
    /**************************************************************************
     ***** BACK AREA **********************************************************
     **************************************************************************/
    
    /**
     * Lists all User entities
     */
    public function backIndexAction()
    {
        $em = $this->getDoctrine()->getEntityManager();

        if ($this->get('security.context')->isGranted('ROLE_ADMIN'))
        {
            $users = $em->getRepository('PFCDTourismBundle:User')->findAll();
        }
        else
        {
            $users = $em->getRepository('PFCDTourismBundle:User')->findByStatus(User::STATUS_ENABLED);
        }

        return $this->render('PFCDTourismBundle:Back/User:index.html.twig', array(
            'users' => $users
        ));
    }
    
{'fraction_non_alphanumeric': 0.2802034760491734, 'fraction_numerical': 0.0, 'mean_word_length': 3.8360655737704916, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5708080', 'n_tokens_mistral': 637, 'n_tokens_neox': 592, 'n_words': 91}