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/rospirotorg.ru/bitrix/modules/letme.watchman/admin/settings/drivers/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /home/bitrix/ext_www/rospirotorg.ru/bitrix/modules/letme.watchman/admin/settings/drivers/mail.php
<?php
// phpcs:ignoreFile
use Letme\Watchman\Settings\Action\GetSettingsByDriver;

global $APPLICATION;

$params = (new GetSettingsByDriver())
    ->execute(\Letme\Watchman\Drivers\Mail\Mail::class);

$eventObject = \Letme\Watchman\Drivers\Mail\ReportEvent::getEventMessageObject();

$formFields = [
    'EVENT' => [
        'name' => GetMessage('LETME_WATCHMAN_RU_PAGE_SETTINGS_MAIL_EVENT_TEXT'),
        'type' => 'string',
        'value' => $eventObject
            ? '<a href="/bitrix/admin/message_edit.php?ID=' . $eventObject->getId() .'">' . str_replace(
                    '#ID#',
                    $eventObject->getId(),
                    GetMessage('LETME_WATCHMAN_RU_PAGE_SETTINGS_MAIL_EVENT_VALUE')
            ) . '</a>'
            : GetMessage('LETME_WATCHMAN_RU_PAGE_SETTINGS_MAIL_EVENT_VALUE_NOT_FOUND'),
    ],
    \Letme\Watchman\Drivers\Mail\AddMailSettingsRequest::ACTIVE => [
        'name' => GetMessage('LETME_WATCHMAN_RU_PAGE_SETTINGS_MAIL_PROP_ACTIVE'),
        'value' => 'Y',
        'required' => false,
        'type' => 'checkbox',
        'checked' => $params->get(\Letme\Watchman\Drivers\Mail\SettingsEnum::active()->value, 'N') === 'Y',
    ],
    \Letme\Watchman\Drivers\Mail\AddMailSettingsRequest::DEFAULT_SITE => [
        'name' => GetMessage('LETME_WATCHMAN_RU_PAGE_SETTINGS_MAIL_PROP_DEFAULT_SITE'),
        'value' => $defaultSite = $params->get(\Letme\Watchman\Drivers\Mail\SettingsEnum::defaultSite()->value, ''),
        'required' => true,
        'type' => 'select',
        'options' => siteList($defaultSite),
        'checked' => $params->get(\Letme\Watchman\Drivers\Mail\SettingsEnum::active()->value, 'N') === 'Y',
    ]
];

?>
    <?php foreach ($formFields as $code => $name) :?>
    <tr class="<?php if ($formFields[$code]['required']) :
        ?>adm-detail-required-field<?php
               endif;?>">
        <td style="width: 40%;"><?=$formFields[$code]['name']?>:</td>
        <td style="width: 60%;">
            <?php if ($formFields[$code]['type'] === 'string') :?>
            <?=$formFields[$code]['value']?>
            <?php endif;?>
            <?php if ($formFields[$code]['type'] === 'select') :?>
            <select name="<?=$code?>" style="width:220px">
                <?php foreach ($formFields[$code]['options'] as $arSite) :?>
                    <option
                            value="<?=$arSite['value']?>"
                            <?php if ($arSite['selected']) :
                                ?>selected<?php
                            endif;?>
                    >
                        <?=$arSite['name']?>
                    </option>
                <?php endforeach;?>
            </select>
            <?php endif;?>

            <?php if (in_array($formFields[$code]['type'], ['text', 'checkbox'])) :?>
            <input
                    type="<?=$formFields[$code]['type']?>"
                    name="<?=$code?>"
                    value="<?=$formFields[$code]['value']?>"
                    size="50"
                    min="0"
                    <?php if ($formFields[$code]['checked'] ?? false) :
                        ?>checked<?php
                    endif;?>
            >
            <?php endif;?>
        </td>
    </tr>
    <?php endforeach;?>
<?php

require __DIR__ . '/../request_handler.php';

function siteList(string $currentVal = '') {
    $siteList[] = [
        'name' => 'Не выбрано',
        'value' => '',
        'selected' => true,
    ];
    $dbSites    = CSite::GetList("", "");
    while ($res = $dbSites->Fetch()) {
        $siteList[] = [
            'name' => "[{$res['SITE_ID']}] {$res['NAME']}",
            'value' => $res['SITE_ID'],
            'selected' => $currentVal === $res['SITE_ID'],
        ];
    }

    return $siteList;
}



Youez - 2016 - github.com/yon3zu
LinuXploit