<commit_before><?php

namespace Imerir\NoyauBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken;

class DefaultController extends Controller
{
    public function indexAction()
    {
    	
        return $this->render('ImerirNoyauBundle:Default:index.html.twig');
    }
    
    public function authentificationAction()
    {
    	return $this->render('ImerirNoyauBundle:Default:authentification.html.twig');
    }
    
    public function testAction()
    {
    	return $this->render('ImerirNoyauBundle:Default:test.html.twig');
    }
    
    public function getindexAction()
    {
    	$query = $this->getRequest();
    	$nom = $query->get('utilisateur');
    	$mot_de_passe = $query->get('mot_de_passe');
    	
    	$client = new \SoapClient('http://localhost/serveur/web/app_dev.php/soap');
    	
	    try {
	    	$result = $client->__soapCall('login', array('username'=>$nom, 'passwd'=>$<PASSWORD>));
		} catch (Exception $e) {
			echo '<script type="text/javascript">window.alert("'.$e.'");</script>';
		}
		$result_json = json_decode($result,true);
		$role[0] = $result_json['role'];
		
		$token = new UsernamePasswordToken($nom, $mot_de_passe,'main', $role);
		$context = $this->container->get('security.context');
		$context->setToken($token);
		
		
    	return $this->render('ImerirNoyauBundle:Default:index.html.twig',array('utilisateur' => $result_json['username'],'groupe' => $result_json['role']));
    }<commit_msg>ajout pour la session d'une variable token $this->container->get('request')->set('token',$session_token)<commit_after><?php

namespace Imerir\NoyauBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken;

class DefaultController extends Controller
{
    public function indexAction()
    {
    	
        return $this->render('ImerirNoyauBundle:Default:index.html.twig');
    }
    
    public function authentificationAction()
    {
    	return $this->render('ImerirNoyauBundle:Default:authentification.html.twig');
    }
    
    public function testAction()
    {
    	return $this->render('ImerirNoyauBundle:Default:test.html.twig');
    }
    
    public function getindexAction()
    {
    	$query = $this->getRequest();
    	$nom = $query->get('utilisateur');
    	$mot_de_passe = $query->get('mot_de_passe');
    	
    	$client = new \SoapClient('http://localhost/serveur/web/app_dev.php/soap');
    	
	    try {
	    	$result = $client->__soapCall('login', array('username'=>$nom, 'passwd'=>$<PASSWORD>));
			$session_token = uniqid();
			$this->container->get('request')->getSession()->set('token',$session_token);
			$client->__setCookie('PHPSESSID',$session_token);
		} catch (Exception $e) {
			echo '<script type="text/javascript">window.alert("'.$e.'");</script>';
		}
		$result_json = json_decode($result,true);
		$role[0] = $result_json['role'];
		
		$token = new UsernamePasswordToken($nom, $mot_de_passe,'main', $role);
		$context = $this->container->get('security.context');
		$context->setToken($token);
		
		
    	return $this->render('ImerirNoyauBundle:Default:index.html.twig',array('utilisateur' => $result_json['username'],'groupe' => $result_json['role']));
    }
{'fraction_non_alphanumeric': 0.17107636800962117, 'fraction_numerical': 0.0006013229104028864, 'mean_word_length': 4.331730769230769, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 47, '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': '2977449', 'n_tokens_mistral': 1127, 'n_tokens_neox': 1090, 'n_words': 141}