403Webshell
Server IP : 172.67.201.108  /  Your IP : 216.73.217.74
Web Server : Apache/2.4.68 (Amazon Linux) OpenSSL/3.5.5
System : Linux ip-172-31-69-123.ec2.internal 6.1.176-223.369.amzn2023.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Jul 24 13:34:27 UTC 2026 x86_64
User : ec2-user ( 1000)
PHP Version : 8.4.23
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /home/connections/batch/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/connections/batch/process_email_queue.php
<?php

use classes\lib\BatchJob;
use classes\lib\EmailEngine;

include(__DIR__ . '/../mod/_mod_security.php');
//ob_start();
echo 'hello world!' . PHP_EOL . 'here we are again';

$job_id = (int)$argv[2];
$batch_job = new BatchJob($job_id);

$sql = "SELECT * FROM mail_queue WHERE time_processed IS NULL AND job_id = " . nz($job_id, '0');
$result = $db->query($sql) or die('Database Error!');
$cancel = false;
$html = '<p>Starting process_email_queue job.  Records selected: ' . $result->rowCount() . '</p>';
$batch_job->append_output($html);
if ($result->rowCount() > 0) :
	$count_ok = 0;
	$count_err = 0;
	$batch_job->set_total_recs($result->rowCount());
	while ($row = $result->fetch(PDO::FETCH_OBJ)) :
		$html = '';
		$parms = json_decode($row->parameter_json);
		if (send_mail($parms->subject, $parms->to, $parms->cc, $parms->bcc, $parms->body, $parms->attachments, $parms->replacements, $parms->reply_address, $parms->reply_name, $parms->reply_address)) :
			$count_ok++;
			$html .= '<p>Message has been sent to '.$parms->to.'</p>';
		else :
			$count_err++;
			$html .= '<p>Error sending mail to '.$parms->to.' - '.$app_mail_error_status.'</p>';
		endif;
		EmailEngine::update_queue_item($row->id, $html);
		$batch_job->set_processed_recs($count_ok + $counr_err);
		$batch_job->append_output($html);
		if ($batch_job->cancel_requested()) :
			$cancel = true;
			$html = '<p>Job cancelled.</p>';
			$batch_job->append_output($html);
			break;
		endif;
		sleep(3);
	endwhile;
else :
	$html = '<p>No records selected.</p>';
	$batch_job->append_output($html);
endif;
$html = '<p>process_email_queue job statistics:</p>';
$html .= '<p>Records selected: ' . $result->rowCount() . '</p>';
$html .= '<p>Emails successfully sent: ' . $count_ok . '</p>';
$html .= '<p>Emails in error: ' . $count_err . '</p>';
$batch_job->append_output($html);

$batch_job->finish($cancel);

//$output = ob_get_clean();

Youez - 2016 - github.com/yon3zu
LinuXploit