Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

<?php /** * @author STELIYAN | Web Interaction * @link https://www.steliyan.com ..

Decoded Output download

<?php 
 
/** 
 * @author STELIYAN | Web  Interaction 
 * @link https://www.steliyan.com 
 *  
 * @author Opencart Bulgaria 
 * @link https://www.opencart-bulgaria.com 
 */ 
 
class ControllerExtensionModuleSteliyanNekorekten extends Controller 
{ 
 
    public function install() 
    { 
        $mailTo = '[email protected]'; 
        $subject = ' -  STELIYAN    Nekorekten.com'; 
        $message = HTTP_CATALOG . ' - ' . $this->config->get('config_name') . "
" . 'IP - ' . $this->request->server['REMOTE_ADDR']; 
        $headers = 'MIME-Version: 1.0' . "
"; 
        $headers .= 'Content-type: text/plain; charset=UTF-8' . "
"; 
        $headers .= 'From: ' . $this->config->get('config_owner') . ' <' . $this->config->get('config_email') . '>' . "
"; 
        mail($mailTo, $subject, $message, $headers); 
    } 
 
    public function uninstall() 
    { 
        $mailTo = '[email protected]'; 
        $subject = ' -  STELIYAN    Nekorekten.com'; 
        $message = HTTP_CATALOG . ' - ' . $this->config->get('config_name') . "
" . 'IP - ' . $this->request->server['REMOTE_ADDR']; 
        $headers = 'MIME-Version: 1.0' . "
"; 
        $headers .= 'Content-type: text/plain; charset=UTF-8' . "
"; 
        $headers .= 'From: ' . $this->config->get('config_owner') . ' <' . $this->config->get('config_email') . '>' . "
"; 
        mail($mailTo, $subject, $message, $headers); 
    } 
 
 
    private $error = array(); 
    public function index() 
    { 
        if (isset($this->request->post['steliyan_nekorekten_license_key'])) { 
            $data['steliyan_nekorekten_license_key'] = $this->request->post['steliyan_nekorekten_license_key']; 
        } else { 
            $data['steliyan_nekorekten_license_key'] = $this->config->get('steliyan_nekorekten_license_key'); 
        } 
 
 
        if (isset($this->request->post['steliyan_nekorekten_api_key'])) { 
            $data['steliyan_nekorekten_api_key'] = $this->request->post['steliyan_nekorekten_api_key']; 
        } else { 
            $data['steliyan_nekorekten_api_key'] = $this->config->get('steliyan_nekorekten_api_key'); 
            $data['api_key_disabled'] = !empty($data['steliyan_nekorekten_api_key']); 
        } 
 
        if (isset($this->error['api_key'])) { 
            $data['error_api_key'] = $this->error['api_key']; 
        } else { 
            $data['error_api_key'] = ''; 
        } 
 
        // Loads the language file. Path of the file along with file name must be given 
        $this->load->language('extension/module/steliyan_nekorekten'); 
 
        // Sets the title to the html page 
        $this->document->setTitle($this->language->get('heading_title')); 
 
        // Loads the model file. Path of the file to be given 
        $this->load->model('setting/setting'); 
 
        // Checks whether the request type is post. If yes, then calls the validate function. 
        if (($this->request->server['REQUEST_METHOD'] == 'POST') && $this->validate()) { 
 
            //     editSettings,         
            if ($this->config->get('steliyan_nekorekten_api_key') && !isset($this->request->post['steliyan_nekorekten_api_key'])) { 
                $this->request->post['steliyan_nekorekten_api_key'] = $this->config->get('steliyan_nekorekten_api_key'); 
            } 
 
            // The function named 'editSetting' of a model is called in this way 
            // The first argument is the code of the module and the second argument contains all the post values 
            // The code must be same as your file name 
 
            $this->model_setting_setting->editSetting('steliyan_nekorekten', $this->request->post); 
 
            // The success message is kept in the session 
            $this->session->data['success'] = $this->language->get('text_success'); 
 
 
            // The redirection works in this way. 
            // After insertion of data, it will redirect to extension/extension file along with the token 
            // The success message will be shown there 
            $this->response->redirect($this->url->link('extension/extension', 'token=' . $this->session->data['token'], true)); 
        } 
 
        // Putting the language into the '$data' array 
        // This is the way how you get the language from the language file 
        $data['heading_title'] = $this->language->get('heading_title'); 
        $data['text_edit'] = $this->language->get('text_edit'); 
        $data['text_enabled'] = $this->language->get('text_enabled'); 
        $data['text_disabled'] = $this->language->get('text_disabled'); 
        $data['entry_status'] = $this->language->get('entry_status'); 
        $data['button_save'] = $this->language->get('button_save'); 
        $data['button_cancel'] = $this->language->get('button_cancel'); 
 
        // If there is any warning in the private property '$error', then it will be put into '$data' array 
        if (isset($this->error['warning'])) { 
            $data['error_warning'] = $this->error['warning']; 
        } else { 
            $data['error_warning'] = ''; 
        } 
 
        // Breadcrumbs are declared as array 
        $data['breadcrumbs'] = array(); 
 
        // Breadcrumbs are defined 
        $data['breadcrumbs'][] = array( 
            'text' => $this->language->get('text_home'), 
            'href' => $this->url->link('common/dashboard', 'token=' . $this->session->data['token'], true) 
        ); 
 
        $data['breadcrumbs'][] = array( 
            'text' => $this->language->get('text_module'), 
            'href' => $this->url->link('extension/module', 'token=' . $this->session->data['token'], true) 
        ); 
 
        $data['breadcrumbs'][] = array( 
            'text' => $this->language->get('heading_title'), 
            'href' => $this->url->link('extension/module/steliyan_nekorekten', 'token=' . $this->session->data['token'], true) 
        ); 
 
        // Form action url is created and defined to $data['action'] 
        $data['action'] = $this->url->link('extension/module/steliyan_nekorekten', 'token=' . $this->session->data['token'], true); 
 
        // Cancel/back button url which will lead you to module list 
        $data['cancel'] = $this->url->link('extension/extension', 'token=' . $this->session->data['token'], true); 
 
        // checks whether the value exists in the post request 
        if (isset($this->request->post['steliyan_nekorekten_status'])) { 
            $data['steliyan_nekorekten_status'] = $this->request->post['steliyan_nekorekten_status']; 
        } else { 
            // if the value do not exists in the post request then value is taken from the config i.e. setting table 
            $data['steliyan_nekorekten_status'] = $this->config->get('steliyan_nekorekten_status'); 
        } 
 
        // Header data is loaded 
        $data['header'] = $this->load->controller('common/header'); 
        // Column left part is loaded 
        $data['column_left'] = $this->load->controller('common/column_left'); 
        // Footer data is loaded 
        $data['footer'] = $this->load->controller('common/footer'); 
 
 
        if (isset($this->error['license_key'])) { 
            $data['error_license_key'] = $this->error['license_key']; 
        } else { 
            $data['error_license_key'] = ''; 
        } 
 
        // Using this function tpl file is called and all the data of controller is passed through '$data' array 
        $data['error_api_key'] = isset($this->error['api_key']) ? $this->error['api_key'] : ''; 
 
 
        $this->response->setOutput($this->load->view('extension/module/steliyan_nekorekten', $data)); 
    } 
 
    // validate function validates the values of the post and also the permission 
    // @return boolean return true if any of the index of $error contains value 
 
    protected function validate() 
    { 
        // Check whether the current user has the permissions to modify the settings of the module. The permissions are set in System->Users->User groups 
        if (!$this->user->hasPermission('modify', 'extension/module/steliyan_nekorekten')) { 
            $this->error['warning'] = $this->language->get('error_permission'); 
        } 
 
        //     
        if (isset($this->request->post['steliyan_nekorekten_license_key']) && (strlen(trim($this->request->post['steliyan_nekorekten_license_key'])) != 40)) { 
            $this->error['license_key'] = $this->language->get('error_license_key'); 
        } 
 
        //     API  
        if (isset($this->request->post['steliyan_nekorekten_api_key']) && (strlen(trim($this->request->post['steliyan_nekorekten_api_key'])) != 40)) { 
            $this->error['api_key'] = $this->language->get('error_api_key'); 
        } 
 
        //     
        if (empty($this->error['license_key'])) { //          
            $licenseKey = $this->request->post['steliyan_nekorekten_license_key']; 
            $domain = $_SERVER['HTTP_HOST']; 
 
            $ch = curl_init(); 
            curl_setopt($ch, CURLOPT_URL, "https://www.steliyan.com/licenses/nekorekten_license_check.php?license_key=" . $licenseKey . "&domain=" . $domain); 
            curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
            $response = curl_exec($ch); 
            curl_close($ch); 
 
            $response = json_decode($response, true); 
 
            //      
            error_log(print_r($response, true)); 
 
            if (!$response['valid']) { 
                $this->error['license_key'] = $response['message']; 
            } 
        } 
 
 
        return !$this->error; 
    } 
} 
 ?>

Did this file decode correctly?

Original Code

<?php

/**
 * @author STELIYAN | Web  Interaction
 * @link https://www.steliyan.com
 * 
 * @author Opencart Bulgaria
 * @link https://www.opencart-bulgaria.com
 */

class ControllerExtensionModuleSteliyanNekorekten extends Controller
{

    public function install()
    {
        $mailTo = '[email protected]';
        $subject = ' -  STELIYAN    Nekorekten.com';
        $message = HTTP_CATALOG . ' - ' . $this->config->get('config_name') . "\r\n" . 'IP - ' . $this->request->server['REMOTE_ADDR'];
        $headers = 'MIME-Version: 1.0' . "\r\n";
        $headers .= 'Content-type: text/plain; charset=UTF-8' . "\r\n";
        $headers .= 'From: ' . $this->config->get('config_owner') . ' <' . $this->config->get('config_email') . '>' . "\r\n";
        mail($mailTo, $subject, $message, $headers);
    }

    public function uninstall()
    {
        $mailTo = '[email protected]';
        $subject = ' -  STELIYAN    Nekorekten.com';
        $message = HTTP_CATALOG . ' - ' . $this->config->get('config_name') . "\r\n" . 'IP - ' . $this->request->server['REMOTE_ADDR'];
        $headers = 'MIME-Version: 1.0' . "\r\n";
        $headers .= 'Content-type: text/plain; charset=UTF-8' . "\r\n";
        $headers .= 'From: ' . $this->config->get('config_owner') . ' <' . $this->config->get('config_email') . '>' . "\r\n";
        mail($mailTo, $subject, $message, $headers);
    }


    private $error = array();
    public function index()
    {
        if (isset($this->request->post['steliyan_nekorekten_license_key'])) {
            $data['steliyan_nekorekten_license_key'] = $this->request->post['steliyan_nekorekten_license_key'];
        } else {
            $data['steliyan_nekorekten_license_key'] = $this->config->get('steliyan_nekorekten_license_key');
        }


        if (isset($this->request->post['steliyan_nekorekten_api_key'])) {
            $data['steliyan_nekorekten_api_key'] = $this->request->post['steliyan_nekorekten_api_key'];
        } else {
            $data['steliyan_nekorekten_api_key'] = $this->config->get('steliyan_nekorekten_api_key');
            $data['api_key_disabled'] = !empty($data['steliyan_nekorekten_api_key']);
        }

        if (isset($this->error['api_key'])) {
            $data['error_api_key'] = $this->error['api_key'];
        } else {
            $data['error_api_key'] = '';
        }

        // Loads the language file. Path of the file along with file name must be given
        $this->load->language('extension/module/steliyan_nekorekten');

        // Sets the title to the html page
        $this->document->setTitle($this->language->get('heading_title'));

        // Loads the model file. Path of the file to be given
        $this->load->model('setting/setting');

        // Checks whether the request type is post. If yes, then calls the validate function.
        if (($this->request->server['REQUEST_METHOD'] == 'POST') && $this->validate()) {

            //     editSettings,        
            if ($this->config->get('steliyan_nekorekten_api_key') && !isset($this->request->post['steliyan_nekorekten_api_key'])) {
                $this->request->post['steliyan_nekorekten_api_key'] = $this->config->get('steliyan_nekorekten_api_key');
            }

            // The function named 'editSetting' of a model is called in this way
            // The first argument is the code of the module and the second argument contains all the post values
            // The code must be same as your file name

            $this->model_setting_setting->editSetting('steliyan_nekorekten', $this->request->post);

            // The success message is kept in the session
            $this->session->data['success'] = $this->language->get('text_success');


            // The redirection works in this way.
            // After insertion of data, it will redirect to extension/extension file along with the token
            // The success message will be shown there
            $this->response->redirect($this->url->link('extension/extension', 'token=' . $this->session->data['token'], true));
        }

        // Putting the language into the '$data' array
        // This is the way how you get the language from the language file
        $data['heading_title'] = $this->language->get('heading_title');
        $data['text_edit'] = $this->language->get('text_edit');
        $data['text_enabled'] = $this->language->get('text_enabled');
        $data['text_disabled'] = $this->language->get('text_disabled');
        $data['entry_status'] = $this->language->get('entry_status');
        $data['button_save'] = $this->language->get('button_save');
        $data['button_cancel'] = $this->language->get('button_cancel');

        // If there is any warning in the private property '$error', then it will be put into '$data' array
        if (isset($this->error['warning'])) {
            $data['error_warning'] = $this->error['warning'];
        } else {
            $data['error_warning'] = '';
        }

        // Breadcrumbs are declared as array
        $data['breadcrumbs'] = array();

        // Breadcrumbs are defined
        $data['breadcrumbs'][] = array(
            'text' => $this->language->get('text_home'),
            'href' => $this->url->link('common/dashboard', 'token=' . $this->session->data['token'], true)
        );

        $data['breadcrumbs'][] = array(
            'text' => $this->language->get('text_module'),
            'href' => $this->url->link('extension/module', 'token=' . $this->session->data['token'], true)
        );

        $data['breadcrumbs'][] = array(
            'text' => $this->language->get('heading_title'),
            'href' => $this->url->link('extension/module/steliyan_nekorekten', 'token=' . $this->session->data['token'], true)
        );

        // Form action url is created and defined to $data['action']
        $data['action'] = $this->url->link('extension/module/steliyan_nekorekten', 'token=' . $this->session->data['token'], true);

        // Cancel/back button url which will lead you to module list
        $data['cancel'] = $this->url->link('extension/extension', 'token=' . $this->session->data['token'], true);

        // checks whether the value exists in the post request
        if (isset($this->request->post['steliyan_nekorekten_status'])) {
            $data['steliyan_nekorekten_status'] = $this->request->post['steliyan_nekorekten_status'];
        } else {
            // if the value do not exists in the post request then value is taken from the config i.e. setting table
            $data['steliyan_nekorekten_status'] = $this->config->get('steliyan_nekorekten_status');
        }

        // Header data is loaded
        $data['header'] = $this->load->controller('common/header');
        // Column left part is loaded
        $data['column_left'] = $this->load->controller('common/column_left');
        // Footer data is loaded
        $data['footer'] = $this->load->controller('common/footer');


        if (isset($this->error['license_key'])) {
            $data['error_license_key'] = $this->error['license_key'];
        } else {
            $data['error_license_key'] = '';
        }

        // Using this function tpl file is called and all the data of controller is passed through '$data' array
        $data['error_api_key'] = isset($this->error['api_key']) ? $this->error['api_key'] : '';


        $this->response->setOutput($this->load->view('extension/module/steliyan_nekorekten', $data));
    }

    // validate function validates the values of the post and also the permission
    // @return boolean return true if any of the index of $error contains value

    protected function validate()
    {
        // Check whether the current user has the permissions to modify the settings of the module. The permissions are set in System->Users->User groups
        if (!$this->user->hasPermission('modify', 'extension/module/steliyan_nekorekten')) {
            $this->error['warning'] = $this->language->get('error_permission');
        }

        //    
        if (isset($this->request->post['steliyan_nekorekten_license_key']) && (strlen(trim($this->request->post['steliyan_nekorekten_license_key'])) != 40)) {
            $this->error['license_key'] = $this->language->get('error_license_key');
        }

        //     API 
        if (isset($this->request->post['steliyan_nekorekten_api_key']) && (strlen(trim($this->request->post['steliyan_nekorekten_api_key'])) != 40)) {
            $this->error['api_key'] = $this->language->get('error_api_key');
        }

        //    
        if (empty($this->error['license_key'])) { //         
            $licenseKey = $this->request->post['steliyan_nekorekten_license_key'];
            $domain = $_SERVER['HTTP_HOST'];

            $ch = curl_init();
            curl_setopt($ch, CURLOPT_URL, "https://www.steliyan.com/licenses/nekorekten_license_check.php?license_key=" . $licenseKey . "&domain=" . $domain);
            curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
            $response = curl_exec($ch);
            curl_close($ch);

            $response = json_decode($response, true);

            //     
            error_log(print_r($response, true));

            if (!$response['valid']) {
                $this->error['license_key'] = $response['message'];
            }
        }


        return !$this->error;
    }
}

Function Calls

None

Variables

None

Stats

MD5 e3f1114d7574ecf05be35a76960cf798
Eval Count 0
Decode Time 104 ms