<commit_before><?php
namespace KitWebBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;
use KitWebBundle\Form\WebUserType;
use KitWebBundle\Entity\WebUser;

class UserController extends Controller
{

    public function indexAction()
    {
        return $this->render('KitWebBundle:User:index.html.twig');
    }

    public function registerAction(Request $request)
    {
        // Create a new blank user and process the form
        $user = new WebUser();
        $form = $this->createForm(WebUserType::class, $user);
        $form->handleRequest($request);
        
        if ($form->isSubmitted() && $form->isValid()) {
            // Encode the new users password
            $encoder = $this->get('security.password_encoder');
            $password = $encoder->encodePassword($user, $user->getPlainPassword());
            $user->setPassword($password);
            
            // Set their role
            $user->setRole('ROLE_USER');
            
            // Save
            $em = $this->getDoctrine()->getManager();
            $em->persist($user);
            $em->flush();
            
            return $this->redirectToRoute('kit_web_login');
        }
        <commit_msg>[MOD] get login info<commit_after><?php
namespace KitWebBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;
use KitWebBundle\Form\WebUserType;
use KitWebBundle\Entity\WebUser;

class UserController extends Controller
{

    public function indexAction()
    {
        $user = $this->getUser();
        return $this->render('KitWebBundle:User:index.html.twig');
    }

    public function registerAction(Request $request)
    {
        // Create a new blank user and process the form
        $user = new WebUser();
        $form = $this->createForm(WebUserType::class, $user);
        $form->handleRequest($request);
        
        if ($form->isSubmitted() && $form->isValid()) {
            // Encode the new users password
            $encoder = $this->get('security.password_encoder');
            $password = $encoder->encodePassword($user, $user->getPlainPassword());
            $user->setPassword($password);
            
            // Set their role
            $user->setRole('ROLE_USER');
            
            // Save
            $em = $this->getDoctrine()->getManager();
            $em->persist($user);
            $em->flush();
            
            return $this->redirectToRoute('kit_web_login');
        }
        
{'fraction_non_alphanumeric': 0.13183404420317954, 'fraction_numerical': 0.0, 'mean_word_length': 2.2658227848101267, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 34, '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': '5620564', 'n_tokens_mistral': 685, 'n_tokens_neox': 681, 'n_words': 135}