One Hat Cyber Team
Your IP :
216.73.217.131
Server IP :
185.33.55.30
Server :
Linux cl30.webspacecontrol.com 5.14.0-611.38.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Mar 10 17:21:28 EDT 2026 x86_64
Server Software :
Apache
PHP Version :
8.1.34
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
opt
/
cxs2
/
app
/
libs
/
CXS
/
Edit File:
Email.php
<?php /** * Email, Send E-mail to customer * * @copyright Copyright (c) 2007 DotRoll Kft. (http://www.dotroll.com) * @author Zoltán Istvanovszki <zoltan.istvanovszki@dotroll.com> * @since 2017.06.13. * @package CXS_2.0 */ namespace CXS; use Phalcon\Mvc\View; class Email extends CommonComponent { /** * Init Alert E-mail */ public function onConstruct() { } /** * Send Alert e-mail to customer * * @param string $hash Username * @param string $LOG CXS result * @param string $until Until */ public function send(string $reason, string $hash, string $LOG, string $until = '') { $this->log("Send $reason Email to $hash"); $config = $this->di->get('config'); /* @var $contacts \CXS\Contacts */ $contacts = $this->di->get('contacts'); $recipients = $contacts->get($hash); unset($logFile); if (\strlen($LOG) > 100000) { $logFile = \tempnam(\sys_get_temp_dir(), 'cxs') . '.zip'; $zip = new \ZipArchive(); $zip->open($logFile, \ZipArchive::CREATE); $zip->addFromString('cxs.log', $LOG); $zip->close(); $LOG = ''; } $view = new View(); $view->setViewsDir(\APP_PATH . 'template'); // notice $text = $view->setVars([ 'until' => $until, 'LOG' => $LOG, ])->start()->render('text', $reason)->finish()->getContent(); $text = $view->setVar('content', $text)->start()->render('text', $config->application->enviroment)->finish()->getContent(); $html = $view->setVars([ 'until' => $until, 'LOG' => \nl2br(\wordwrap($LOG, 75, \PHP_EOL, true)), ])->start()->render('html', $reason)->finish()->getContent(); $html = $view->setVar('content', $html)->start()->render('html', $config->application->enviroment)->finish()->getContent(); // Send e-mail $mail = new \PHPMailer(); $mail->IsSMTP(); $mail->Host = $config->smtp->host; $mail->Port = 25; $mail->SMTPAuth = true; $mail->Username = $config->smtp->user; $mail->Password = $config->smtp->password; $mail->CharSet = 'UTF-8'; $mail->SetFrom($config->sender->email, $config->sender->name); $mail->Subject = $config->subject->$reason . ':' . $hash; foreach ($recipients as $recipient) { $mail->AddAddress($recipient); } if ($reason == 'suspend') { $mail->AddCC($config->sender->email, $config->sender->name); } $mail->MsgHTML($html, \APP_PATH . 'template/html/images'); $mail->AltBody = $text; $this->push("$reason e-mail send to " . \implode(', ', $recipients)); if (isset($logFile)) { $mail->AddAttachment($logFile); } if (!$mail->Send()) { $this->push("Mailer Error: " . $mail->ErrorInfo, true); } $recipient = null; unset($recipient); $recipients = null; unset($recipients); $html = null; unset($html); $text = null; unset($text); $mail = null; unset($mail); // Save a messages $messages = new \Messages(); $messages->hash = $hash; $messages->hostname = \gethostname(); $messages->reason = $reason; $messages->save(); $messages = null; unset($messages); } }
Simpan