| @@ -30,9 +30,13 @@ | ||
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | public function continuesend(): void |
| 33 | 33 | { |
| 34 | - if ($this->config->get('queue_type') == 'onlyauto') { | |
| 34 | + wp_verify_nonce(acym_getVar('cmd', '_wpnonce'), 'acymnonce') || die('Invalid Token'); | |
| 35 | + | |
| 36 | + //Are we configured to use the automatic send process only? | |
| 37 | + //If so, we don't allow the user to access this feature! | |
| 38 | + if ($this->config->get('queue_type') === 'onlyauto') { | |
| 35 | 39 | acym_setNoTemplate(); |
| 36 | 40 | acym_display(acym_translation('ACYM_ONLYAUTOPROCESS'), 'warning'); |
| 37 | 41 | |
| 38 | 42 | exit; |
| @@ -37,8 +41,9 @@ | ||
| 37 | 41 | |
| 38 | 42 | exit; |
| 39 | 43 | } |
| 40 | 44 | |
| 45 | + //we move the next cron task so that we won't have problem with double send process | |
| 41 | 46 | $newCronTime = time() + 120; |
| 42 | 47 | if ($this->config->get('cron_next') < $newCronTime) { |
| 43 | 48 | $this->config->saveConfig(['cron_next' => $newCronTime]); |
| 44 | 49 | } |
| @@ -63,11 +68,13 @@ | ||
| 63 | 68 | $queueHelper->report = true; |
| 64 | 69 | $queueHelper->total = (int)$totalSend; |
| 65 | 70 | $queueHelper->start = $alreadySent; |
| 66 | 71 | $queueHelper->pause = (int)$this->config->get('queue_pause', 0); |
| 72 | + // ->Process will exit the current page if it needs to be continued | |
| 67 | 73 | $queueHelper->fromManual = true; |
| 68 | 74 | $queueHelper->process(); |
| 69 | 75 | |
| 76 | + //We should never be there... but if the user tries to resume the send process and the messages are not ready to be sent then it will land here... | |
| 70 | 77 | acym_setNoTemplate(); |
| 71 | 78 | exit; |
| 72 | 79 | } |
| 73 | 80 | } |