<commit_before><?php
namespace Acf\AdminBundle\Controller;

use Sasedev\Commons\SharedBundle\Controller\BaseController;
use Acf\DataBundle\Entity\User;

/**
 *
 * @author sasedev <<EMAIL>>
 *
 */
class DefaultController extends BaseController
{

    /**
     *
     * @var array
     */
    protected $gvars = array();

    /**
     * Constructor
     */
    public function __construct()
    {
        $this->gvars['menu_active'] = 'adminhome';
    }

    /**
     *
     * @return \Symfony\Component\HttpFoundation\Response
     */
    public function indexAction()
    {
        $em = $this->getEntityManager();
        $sc = $this->getSecurityTokenStorage();
        $ac = $this->getSecurityAuthorizationChecker();
        $user = $sc->getToken()->getUser();

        $minDate = new \DateTime('now');
        $minDate->modify('-7 days');

        if ($ac->isGranted('ROLE_SUPERADMIN', $user)) {
            $traces = $em->getRepository('AcfDataBundle:Trace')->getAll($minDate);
        } else {
            $traces = $em->getRepository('AcfDataBundle:Trace')->getAllByAdmin($user, $minDate);
        }
        $this->gvars['traces'] = array_reverse($traces);

        $activeUser = $em->getRepository('AcfDataBundle:User')->getAllActiveNow('30 minutes ago');
        $this->gvars['activeUsers'] = $activeUser;

        return $this->renderResponse('AcfAdminBundle:Default:index.html.twig', $this->gvars);
    }
}<commit_msg>from 7 -> 14 days traces query<commit_after><?php
namespace Acf\AdminBundle\Controller;

use Sasedev\Commons\SharedBundle\Controller\BaseController;
use Acf\DataBundle\Entity\User;

/**
 *
 * @author sasedev <<EMAIL>>
 */
class DefaultController extends BaseController
{

    /**
     *
     * @var array
     */
    protected $gvars = array();

    /**
     * Constructor
     */
    public function __construct()
    {
        $this->gvars['menu_active'] = 'adminhome';
    }

    /**
     *
     * @return \Symfony\Component\HttpFoundation\Response
     */
    public function indexAction()
    {
        $em = $this->getEntityManager();
        $sc = $this->getSecurityTokenStorage();
        $ac = $this->getSecurityAuthorizationChecker();
        $user = $sc->getToken()->getUser();

        $minDate = new \DateTime('now');
        $minDate->modify('-14 days');

        if ($ac->isGranted('ROLE_SUPERADMIN', $user)) {
            $traces = $em->getRepository('AcfDataBundle:Trace')->getAll($minDate);
        } else {
            $traces = $em->getRepository('AcfDataBundle:Trace')->getAllByAdmin($user, $minDate);
        }
        $this->gvars['traces'] = array_reverse($traces);

        $activeUser = $em->getRepository('AcfDataBundle:User')->getAllActiveNow('30 minutes ago');
        $this->gvars['activeUsers'] = $activeUser;

        return $this->renderResponse('AcfAdminBundle:Default:index.html.twig', $this->gvars);
    }
}
{'fraction_non_alphanumeric': 0.1668408220132358, 'fraction_numerical': 0.0034831069313827935, 'mean_word_length': 2.8293333333333335, 'pattern_counts': {'":': 0, '<': 9, '<?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': '1687271', 'n_tokens_mistral': 899, 'n_tokens_neox': 881, 'n_words': 131}