<commit_before><?php
namespace PROCERGS\LoginCidadao\CoreBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\Routing\Annotation\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFoundation\Response;
use PROCERGS\LoginCidadao\CoreBundle\Form\Type\ContactFormType;
use PROCERGS\LoginCidadao\CoreBundle\Entity\SentEmail;
use PROCERGS\LoginCidadao\CoreBundle\Entity\Uf;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
use PROCERGS\LoginCidadao\CoreBundle\Exception\NfgException;
use FOS\UserBundle\Event\FormEvent;
use FOS\UserBundle\FOSUserEvents;
use FOS\UserBundle\Event\FilterUserResponseEvent;
use FOS\UserBundle\Event\GetResponseUserEvent;
use PROCERGS\LoginCidadao\CoreBundle\Entity\NfgProfile;
use PROCERGS\LoginCidadao\CoreBundle\Entity\Notification;

/**
 * @Route("/nfg")
 */
class NfgController extends Controller
{

    protected function toNfg($url, $callback, $useSession = false)
    {
        $nfg = $this->get('procergs_logincidadao.nfgws');
        $parm['accessid'] = $nfg->obterAccessID();
        if ($useSession) {
            $this->getRequest()
                ->getSession()
                ->set('ticketacessologin', $parm['accessid']);
        }
        $parm['urlretorno'] = $this->generateUrl($callback, array(), UrlGeneratorInterface::ABSOLUTE_URL);
        // $url = $this->container->getParameter('nfg_url_auth') . '?' . http_build_query($parm);
        $url = $this->container->getParameter($url) . '?accessid=' . $parm['accessid'] . '&urlretorno=' . $parm['urlretorno'];
        return $this->redirect($url);
    }

    protected function checkAccessToken()
    {
        $request = $this->getRequest();
        $paccessid = $request->get('paccessid');
        if (! $paccessid) {
            throw new NfgException('nfg.missing.token');
        }
        $nfg = $this->get('procergs_logincidadao.nfgws');
        $nfg->setAccessToken($paccessid);
        $result1 = $nfg->consultaCadastro();
        if ($result1['CodSitRetorno'] != 1) {<commit_msg>force referer for IE<commit_after><?php
namespace PROCERGS\LoginCidadao\CoreBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\Routing\Annotation\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFoundation\Response;
use PROCERGS\LoginCidadao\CoreBundle\Form\Type\ContactFormType;
use PROCERGS\LoginCidadao\CoreBundle\Entity\SentEmail;
use PROCERGS\LoginCidadao\CoreBundle\Entity\Uf;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
use PROCERGS\LoginCidadao\CoreBundle\Exception\NfgException;
use FOS\UserBundle\Event\FormEvent;
use FOS\UserBundle\FOSUserEvents;
use FOS\UserBundle\Event\FilterUserResponseEvent;
use FOS\UserBundle\Event\GetResponseUserEvent;
use PROCERGS\LoginCidadao\CoreBundle\Entity\NfgProfile;
use PROCERGS\LoginCidadao\CoreBundle\Entity\Notification;

/**
 * @Route("/nfg")
 */
class NfgController extends Controller
{

    protected function toNfg($url, $callback, $useSession = false)
    {
        $nfg = $this->get('procergs_logincidadao.nfgws');
        $parm['accessid'] = $nfg->obterAccessID();
        if ($useSession) {
            $this->getRequest()
                ->getSession()
                ->set('ticketacessologin', $parm['accessid']);
        }
        $parm['urlretorno'] = $this->generateUrl($callback, array(), UrlGeneratorInterface::ABSOLUTE_URL);
        // $url = $this->container->getParameter('nfg_url_auth') . '?' . http_build_query($parm);
        $url = $this->container->getParameter($url) . '?accessid=' . $parm['accessid'] . '&urlretorno=' . $parm['urlretorno'];
        return new RedirectResponse($url, 302, array('referer'=> $this->getRequest()->getUri()));
    }

    protected function checkAccessToken()
    {
        $request = $this->getRequest();
        $paccessid = $request->get('paccessid');
        if (! $paccessid) {
            throw new NfgException('nfg.missing.token');
        }
        $nfg = $this->get('procergs_logincidadao.nfgws');
        $nfg->setAccessToken($paccessid);
        $result1 = $nfg->consultaCadastro();
        if ($result1['CodSitRetorno'] != 1) {
{'fraction_non_alphanumeric': 0.14295347269049224, 'fraction_numerical': 0.0020229265003371545, 'mean_word_length': 4.132641291810842, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 37, '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': '5325386', 'n_tokens_mistral': 1446, 'n_tokens_neox': 1419, 'n_words': 193}