| @@ -19,17 +19,18 @@ | ||
| 19 | 19 | } |
| 20 | 20 | |
| 21 | 21 | public function activeAutomation(): void |
| 22 | 22 | { |
| 23 | + wp_verify_nonce(acym_getVar('cmd', '_wpnonce'), 'acymnonce') || die('Invalid Token'); | |
| 24 | + | |
| 23 | 25 | $automationClass = new AutomationClass(); |
| 24 | 26 | $automation = $automationClass->getOneById(acym_getVar('int', 'id')); |
| 25 | 27 | $automation->active = 1; |
| 26 | - $saved = $automationClass->save($automation); | |
| 27 | - if (!empty($saved)) { | |
| 28 | + $automationId = $automationClass->save($automation); | |
| 29 | + if (!empty($automationId)) { | |
| 28 | 30 | acym_enqueueMessage(acym_translation('ACYM_SUCCESSFULLY_SAVED')); |
| 29 | - $this->listing(); | |
| 30 | 31 | } else { |
| 31 | 32 | acym_enqueueMessage(acym_translation('ACYM_ERROR_SAVING'), 'error'); |
| 32 | - $this->listing(); | |
| 33 | 33 | } |
| 34 | + $this->listing(); | |
| 34 | 35 | } |
| 35 | 36 | } |