<commit_before><?php
/**
 * Litus is a project by a group of students from the KU Leuven. The goal is to create
 * various applications to support the IT needs of student unions.
 *
 * @author <NAME> <<EMAIL>>
 * @author <NAME> <<EMAIL>>
 * @author <NAME> <<EMAIL>>
 * @author <NAME> <<EMAIL>>
 * @author <NAME> <<EMAIL>>
 * @author <NAME> <<EMAIL>>
 * @author <NAME> <<EMAIL>>
 * @author <NAME> <<EMAIL>>
 * @author <NAME> <<EMAIL>>
 *
 * @license http://litus.cc/LICENSE
 */

namespace FormBundle\Controller\Manage;

use FormBundle\Entity\Node\Form,
    Zend\Mail\Message,
    Zend\View\Model\ViewModel;

/**
 * MailController
 *
 * @author <NAME> <<EMAIL>>
 */
class MailController extends \FormBundle\Component\Controller\FormController
{
    public function sendAction()
    {
        $this->initAjax();

        if (!($formSpecification = $this->getFormEntity())) {
            return new ViewModel();
        }

        if (!$formSpecification->canBeEditedBy($this->getAuthentication()->getPersonObject())) {
            $this->flashMessenger()->error(
                'Error',
                'You are not authorized to edit this form!'
            );

            $this->redirect()->toRoute(
                'form_admin_form',
                array(
                    'action' => 'manage',
                )
            );

            return new ViewModel();
        }
        $defaultFromAddress = "";
        if ($formSpecification->getMail()) {
            $defaultFromAddress = $formSpecification->getMail()->getFrom();
        }

        $form = $this->getForm('form_manage_mail_send', array(
            'defaultFromAddress' => $defaultFromAddress,
        ));

        if ($this->getRequest()->isPost()) {
            $formData = $this->getRequest()->getPost();
            $form->setData($formData);

            if ($form->isValid()) {
                $formData = $form->getData();

                $mailAddress = $formData['from'];

                $entries = $this->getEntityManager()
                    ->getRepository('FormBundle\Entity\Node\Entry')<commit_msg>Fix double quotes string<commit_after><?php
/**
 * Litus is a project by a group of students from the KU Leuven. The goal is to create
 * various applications to support the IT needs of student unions.
 *
 * @author <NAME> <<EMAIL>>
 * @author <NAME> <<EMAIL>>
 * @author <NAME> <<EMAIL>>
 * @author <NAME> <<EMAIL>>
 * @author <NAME> <<EMAIL>>
 * @author <NAME> <<EMAIL>>
 * @author <NAME> <<EMAIL>>
 * @author <NAME> <<EMAIL>>
 * @author <NAME> <<EMAIL>>
 *
 * @license http://litus.cc/LICENSE
 */

namespace FormBundle\Controller\Manage;

use FormBundle\Entity\Node\Form,
    Zend\Mail\Message,
    Zend\View\Model\ViewModel;

/**
 * MailController
 *
 * @author <NAME> <<EMAIL>>
 */
class MailController extends \FormBundle\Component\Controller\FormController
{
    public function sendAction()
    {
        $this->initAjax();

        if (!($formSpecification = $this->getFormEntity())) {
            return new ViewModel();
        }

        if (!$formSpecification->canBeEditedBy($this->getAuthentication()->getPersonObject())) {
            $this->flashMessenger()->error(
                'Error',
                'You are not authorized to edit this form!'
            );

            $this->redirect()->toRoute(
                'form_admin_form',
                array(
                    'action' => 'manage',
                )
            );

            return new ViewModel();
        }
        $defaultFromAddress = '';
        if ($formSpecification->getMail()) {
            $defaultFromAddress = $formSpecification->getMail()->getFrom();
        }

        $form = $this->getForm('form_manage_mail_send', array(
            'defaultFromAddress' => $defaultFromAddress,
        ));

        if ($this->getRequest()->isPost()) {
            $formData = $this->getRequest()->getPost();
            $form->setData($formData);

            if ($form->isValid()) {
                $formData = $form->getData();

                $mailAddress = $formData['from'];

                $entries = $this->getEntityManager()
                    ->getRepository('FormBundle\Entity\Node\Entry')
{'fraction_non_alphanumeric': 0.15818399044205494, 'fraction_numerical': 0.0, 'mean_word_length': 2.1856925418569255, 'pattern_counts': {'":': 0, '<': 65, '<?xml version=': 0, '>': 111, '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': '4225753', 'n_tokens_mistral': 1198, 'n_tokens_neox': 1159, 'n_words': 254}