Jump to content

Hack sur les inscriptions


Recommended Posts

Remplacez ce bloc dans le fichier /controllers/front/AuthController.php :

    public function postProcess()
    {
        if(Tools::isSubmit('SubmitCreate')) {
            $this->processSubmitCreate();
        }

        if(Tools::isSubmit('submitAccount') || Tools::isSubmit('submitGuestAccount')) {
            $this->processSubmitAccount();
        }

        if(Tools::isSubmit('SubmitLogin')) {
            $this->processSubmitLogin();
        }
    }

Par:

    public function postProcess()
    {
        if(Tools::isSubmit('SubmitCreate')) {
            return false;
            //$this->processSubmitCreate();
        }

        if(Tools::isSubmit('submitAccount') || Tools::isSubmit('submitGuestAccount')) {
            return false;
            //$this->processSubmitAccount();
        }

        if(Tools::isSubmit('SubmitLogin')) {
            $this->processSubmitLogin();
        }
    }

l'ideal serait de faire un override de AuthController.

  • Like 1
Link to comment
Share on other sites

14 hours ago, Eolia said:

 

 

    public function postProcess()
    {
        if(Tools::isSubmit('SubmitCreate')) {
            return false;
            //$this->processSubmitCreate();
        }

        if(Tools::isSubmit('submitAccount') || Tools::isSubmit('submitGuestAccount')) {
            return false;
            //$this->processSubmitAccount();
        }

        if(Tools::isSubmit('SubmitLogin')) {
            $this->processSubmitLogin();
        }
    }

 

Impeccable, juste a commenter 2 lignes

Un grand Merci

Link to comment
Share on other sites

public function initContent()
    {
        $should_redirect = false;

        if (Tools::isSubmit('submitCreate') || Tools::isSubmit('create_account')) {
            $register_form = $this
                ->makeCustomerForm()
                ->setGuestAllowed(false)
                ->fillWith(Tools::getAllValues());

            if (Tools::isSubmit('submitCreate')) {
                $hookResult = array_reduce(
                    Hook::exec('actionSubmitAccountBefore', [], null, true),
                    function ($carry, $item) {
                        return $carry && $item;
                    },
                    true
                );
                if ($hookResult && $register_form->submit()) {
                    $should_redirect = true;
                }
            }

            $this->context->smarty->assign([
                'register_form' => $register_form->getProxy(),
                'hook_create_account_top' => Hook::exec('displayCustomerAccountFormTop'),
            ]);
            $this->setTemplate('customer/registration');
        } else {
            $login_form = $this->makeLoginForm()->fillWith(
                Tools::getAllValues()
            );

            if (Tools::isSubmit('submitLogin')) {
                if ($login_form->submit()) {
                    $should_redirect = true;
                }
            }

            $this->context->smarty->assign([
                'login_form' => $login_form->getProxy(),
            ]);
            $this->setTemplate('customer/authentication');
        }

Je reviens vers vous car je n ai pas le même code, veuillez me pardonner mon ignorance en la matière

La version Prestahop dont je dispose est la 1.7.7.7

Quelle est la ligne ou quelles sont les lignes à mettre en commentaires ?

 

 

 

Link to comment
Share on other sites

        if (Tools::isSubmit('submitCreate') || Tools::isSubmit('create_account')) {
            return;
            $register_form = $this
                ->makeCustomerForm()
                ->setGuestAllowed(false)
                ->fillWith(Tools::getAllValues());

            if (Tools::isSubmit('submitCreate')) {
                $hookResult = array_reduce(
                    Hook::exec('actionSubmitAccountBefore', [], null, true),
                    function ($carry, $item) {
                        return $carry && $item;
                    },
                    true
                );
                if ($hookResult && $register_form->submit()) {
                    $should_redirect = true;
                }
            }

            $this->context->smarty->assign([
                'register_form' => $register_form->getProxy(),
                'hook_create_account_top' => Hook::exec('displayCustomerAccountFormTop'),
            ]);
            $this->setTemplate('customer/registration');

Ajoutez uniquement le return; après la ligne 

if (Tools::isSubmit('submitCreate') || Tools::isSubmit('create_account')) {

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...