// demo mode
This commit is contained in:
@@ -347,15 +347,15 @@ class AdminEmployeesControllerCore extends AdminController
|
|||||||
|
|
||||||
public function postProcess()
|
public function postProcess()
|
||||||
{
|
{
|
||||||
if (Tools::isSubmit('deleteemployee') || Tools::isSubmit('status') || Tools::isSubmit('statusemployee'))
|
/* PrestaShop demo mode */
|
||||||
|
if ((Tools::isSubmit('deleteemployee') || Tools::isSubmit('status') || Tools::isSubmit('statusemployee') || Tools::isSubmit('submitAddemployee')) && _PS_MODE_DEMO_)
|
||||||
{
|
{
|
||||||
/* PrestaShop demo mode */
|
|
||||||
if (_PS_MODE_DEMO_ && $id_employee = Tools::getValue('id_employee') && (int)$id_employee == _PS_DEMO_MAIN_BO_ACCOUNT_)
|
|
||||||
{
|
|
||||||
$this->errors[] = Tools::displayError('This functionality has been disabled.');
|
$this->errors[] = Tools::displayError('This functionality has been disabled.');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (Tools::isSubmit('deleteemployee') || Tools::isSubmit('status') || Tools::isSubmit('statusemployee'))
|
||||||
|
{
|
||||||
if ($this->context->employee->id == Tools::getValue('id_employee'))
|
if ($this->context->employee->id == Tools::getValue('id_employee'))
|
||||||
{
|
{
|
||||||
$this->errors[] = Tools::displayError('You cannot disable or delete your own account.');
|
$this->errors[] = Tools::displayError('You cannot disable or delete your own account.');
|
||||||
|
|||||||
Reference in New Issue
Block a user