Spamworldpro Mini Shell
Spamworldpro


Server : Apache
System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64
User : corals ( 1002)
PHP Version : 7.4.33
Disable Function : exec,passthru,shell_exec,system
Directory :  /home/corals/old/vendor/wyomind/framework/Block/Adminhtml/System/Config/Form/Field/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/corals/old/vendor/wyomind/framework/Block/Adminhtml/System/Config/Form/Field/Encrypted.php
<?php

/**
 * Copyright © 2017 Wyomind. All rights reserved.
 * See LICENSE.txt for license details.
 */

/**
 * Copyright © 2020 Wyomind. All rights reserved.
 * See LICENSE.txt for license details.
 */

namespace Wyomind\Framework\Block\Adminhtml\System\Config\Form\Field;

/**
 * Class Encrypted
 * @package Wyomind\Framework\Block\Adminhtml\System\Config\Form\Field
 */
class Encrypted extends \Magento\Config\Block\System\Config\Form\Field
{
    public $frameworkHelper;


    /**
     * @var \Magento\Framework\Encryption\EncryptorInterface
     */
    protected $_encryptor = null;

    /**
     * Encrypted constructor.
     * @param \Magento\Backend\Block\Template\Context $context
     * @param \Wyomind\Framework\Helper\Module $frameworkHelper
     * @param \Magento\Framework\Encryption\EncryptorInterface $encryptor
     * @param array $data
     */
    public function __construct(
        \Magento\Backend\Block\Template\Context $context,
        \Wyomind\Framework\Helper\Module $frameworkHelper,
        \Magento\Framework\Encryption\EncryptorInterface $encryptor,
        array $data = []
    ) {
    
        parent::__construct($context, $data);
        $this->frameworkHelper = $frameworkHelper;
        $this->_encryptor = $encryptor;
    }

    /**
     * @param \Magento\Framework\Data\Form\Element\AbstractElement $element
     * @return string
     */
    protected function _getElementHtml(\Magento\Framework\Data\Form\Element\AbstractElement $element)
    {
        if (version_compare("2.2.1", $this->frameworkHelper->getMagentoVersion()) <= 0) {
            $element->setValue($this->_encryptor->decrypt($element->getValue()));
        }
        return parent::_getElementHtml($element);
    }
}

Spamworldpro Mini