<commit_before><?php

class compteActions extends sfCredentialActions {

    public function executeAjout(sfWebRequest $request) {
        $this->societe = $this->getRoute()->getSociete();
        $this->compte = CompteClient::getInstance()->createCompteFromSociete($this->societe);
        $this->applyRights();
        if(!$this->modification && !$this->reduct_rights){

            return $this->forward('acVinCompte','forbidden');
        }
        $this->processFormCompte($request);
        $this->setTemplate('modification');
    }

    public function executeModification(sfWebRequest $request) {
        $this->compte = $this->getRoute()->getCompte();
        $this->societe = $this->compte->getSociete();
        $this->applyRights();
        if(!$this->modification && !$this->reduct_rights){

            return $this->forward('acVinCompte','forbidden');
        }
        $this->processFormCompte($request);
    }

    protected function processFormCompte(sfWebRequest $request) {
        $this->compteForm = new InterlocuteurForm($this->compte);
        if (!$request->isMethod(sfWebRequest::POST)) {
            return;
        }

        $this->compteForm->bind($request->getParameter($this->compteForm->getName()));<commit_msg>on controle les actions de compte pour les droits en ecriture<commit_after><?php

class compteActions extends sfCredentialActions {

    private static $checkSaveContactEntityActions = array('ajout', 'modification', 'switchStatus', 'GenerateCodeCreation', 'addtag', 'removetag');

    public function preExecute()
    {
        $defaults = $this->getRoute()->getDefaults();
        if (isset($defaults['action']) && in_array($defaults['action'], self::$checkSaveContactEntityActions)) {
            $this->checkSaveContactEntity();
        }
    }

    public function executeAjout(sfWebRequest $request) {
        $this->societe = $this->getRoute()->getSociete();
        $this->compte = CompteClient::getInstance()->createCompteFromSociete($this->societe);
        $this->applyRights();
        if(!$this->modification && !$this->reduct_rights){

            return $this->forward('acVinCompte','forbidden');
        }
        $this->processFormCompte($request);
        $this->setTemplate('modification');
    }

    public function executeModification(sfWebRequest $request) {
        $this->compte = $this->getRoute()->getCompte();
        $this->societe = $this->compte->getSociete();
        $this->applyRights();
        if(!$this->modification && !$this->reduct_rights){

            return $this->forward('acVinCompte','forbidden');
        }
        $this->processFormCompte($request);
    }

    protected function processFormCompte(sfWebRequest $request) {
        $this->compteForm = new InterlocuteurForm($this->compte);
        if (!$request->isMethod(sfWebRequest::POST)) {
            return;
        }

        $this->compteForm->bind($request->getParameter($this->compteForm->getName()));
{'fraction_non_alphanumeric': 0.16056910569105692, 'fraction_numerical': 0.0, 'mean_word_length': 3.3683431952662723, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 68, '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': '3022672', 'n_tokens_mistral': 862, 'n_tokens_neox': 849, 'n_words': 118}