TrogloGeek / prestashop-tggatos-module

TggAtos Module for Prestashop (1.4 to 1.7), ATOS SIPS 6xx payment gateway
61 stars 34 forks source link

Interoperability trouble when call outside FO/BO #41

Closed e-gaulue closed 8 years ago

e-gaulue commented 8 years ago

Dear developers,

We have external applications (SAGE) that automatically request status change from a module.

In some case, this leads to Module::getInstanceByName($order->module); being called from changeIdOrderState. At end TggAtos construct is called and get to:

        if ($this->context->employee instanceof Employee
                && $this->context->employee->isLoggedBack()
                && ($this->context->controller instanceof AdminModulesController)
                && !in_array($this->name, explode('|', Tools::getValue('configure', ''))))
        {
            $this->autoCheck();
        }

where isLoggedBack looks for password in the cookie...

But our scripts are launched through curl style mechanisms, leading to having no password as we have no cookie.

Could you consider, this code in next version:

        if ($this->context->employee instanceof Employee
                && ($this->context->controller instanceof AdminModulesController)
                && $this->context->employee->isLoggedBack()
                && !in_array($this->name, explode('|', Tools::getValue('configure', ''))))
        {
            $this->autoCheck();
        }

Or even put all the employee tests at the end.

Best regards, EG

TrogloGeek commented 8 years ago

Do you have the problem with the RC_4.0.0 version?

https://github.com/TrogloGeek/prestashop-tggatos-module/blob/RC_4.0.0/tggatos.php#L235

TrogloGeek commented 8 years ago

there will probably be no more 3.x version update