<commit_before><?php

namespace Trolley\AgendaBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Component\HttpFoundation\Request;
use Trolley\AgendaBundle\Entity\User;

/**
 * @Security("has_role('ROLE_USER')");
 * @Route("/users")
 */
class UsersController extends Controller
{
    /**
     * @Route("/");
     * @Route("/list");
     */
    public function listAction()
    {
        $db = $this->getDoctrine()->getManager();
        $userDB = $db->getRepository("TrolleyAgendaBundle:User");

        return $this->render('TrolleyAgendaBundle:Users:list.html.twig',[
            'users' => $userDB->findAll()
        ]);
    }

    /**
     * @Route("/edit/{id}", requirements={"id" = "\d+"})
     * @Security("has_role('ROLE_ADMIN')");
     */
    public function editAction(User $user, Request $request)
    {
        list ($isSaveDB, $form) = $this->_userFromSave($user, $request);

        if ($isSaveDB) {
            $this->addFlash('success', 'page.user.saved_sussfully');
            return $this->redirectToRoute('trolley_agenda_users_list');
        }

        return $this->render('TrolleyAgendaBundle:Users:edit.html.twig', [
            'user' => $user,
            'user_form' => $form->createView(),
        ]);
     }

    /**
     * @Route("/new");
     * @Security("has_role('ROLE_ADMIN')");
     *
     * @param Request $request
     */
    public function newAction(Request $request)
    {
        $user = new User();
        list ($isSaveDB, $form) = $this->_userFromSave($user, $request);

        if ($isSaveDB) {
            $this->addFlash('success', 'page.user.saved_sussfully');
            return $this->redirectToRoute('trolley_agenda_users_edit', ['id' => $user->getId()]);
        }

        return $this->render('TrolleyAgendaBundle:Users:edit.html.twig', [
            'user' => $user,<commit_msg>User Standard Mässig Aktive<commit_after><?php

namespace Trolley\AgendaBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Component\HttpFoundation\Request;
use Trolley\AgendaBundle\Entity\User;

/**
 * @Security("has_role('ROLE_USER')");
 * @Route("/users")
 */
class UsersController extends Controller
{
    /**
     * @Route("/");
     * @Route("/list");
     */
    public function listAction()
    {
        $db = $this->getDoctrine()->getManager();
        $userDB = $db->getRepository("TrolleyAgendaBundle:User");

        return $this->render('TrolleyAgendaBundle:Users:list.html.twig',[
            'users' => $userDB->findAll()
        ]);
    }

    /**
     * @Route("/edit/{id}", requirements={"id" = "\d+"})
     * @Security("has_role('ROLE_ADMIN')");
     */
    public function editAction(User $user, Request $request)
    {
        list ($isSaveDB, $form) = $this->_userFromSave($user, $request);

        if ($isSaveDB) {
            $this->addFlash('success', 'page.user.saved_sussfully');
            return $this->redirectToRoute('trolley_agenda_users_list');
        }

        return $this->render('TrolleyAgendaBundle:Users:edit.html.twig', [
            'user' => $user,
            'user_form' => $form->createView(),
        ]);
     }

    /**
     * @Route("/new");
     * @Security("has_role('ROLE_ADMIN')");
     *
     * @param Request $request
     */
    public function newAction(Request $request)
    {
        $user = new User();
        $user->setEnabled('true');
        
        list ($isSaveDB, $form) = $this->_userFromSave($user, $request);

        if ($isSaveDB) {
            $this->addFlash('success', 'page.user.saved_sussfully');
            return $this->redirectToRoute('trolley_agenda_users_edit', ['id' => $user->getId()]);
        }

        return $this->render('TrolleyAgendaBundle:Users:edit.html.twig', [
            'user' => $user,
{'fraction_non_alphanumeric': 0.17539525691699603, 'fraction_numerical': 0.0, 'mean_word_length': 2.8746411483253587, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 44, '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': '4820019', 'n_tokens_mistral': 1279, 'n_tokens_neox': 1263, 'n_words': 179}