403Webshell
Server IP : 46.62.235.243  /  Your IP : 216.73.216.217
Web Server : Apache/2.4.58 (Ubuntu)
System : Linux Linkabili3Dicembre 6.8.0-100-generic #100-Ubuntu SMP PREEMPT_DYNAMIC Tue Jan 13 16:40:06 UTC 2026 x86_64
User : www-data ( 33)
PHP Version : 8.1.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /var/www/linkabili/wordpress_plugins/hpo_connector/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/linkabili/wordpress_plugins/hpo_connector/index.php
<?php

/**
 * The plugin bootstrap file.
 * @since             1.2.1
 *
 * @wordpress-plugin
 * Plugin Name:       HPO Connector
 * Plugin URI:        https://www.puntoeaccapo.com
 * Description:       HPO Connector
 * Version:           1.2.1
 * Text Domain:       hpo-connector
 */

/*
 EDIT THEME

 edit file template-parts/navigation/navigation-logo-menu.php

<div class="navigation-bar logo-menu-area  <?php mesmerize_header_main_class() ?>" <?php mesmerize_navigation_sticky_attrs() ?>>
    <div class="navigation-wrapper <?php mesmerize_navigation_wrapper_class() ?>">
        <div class="row basis-auto">
            <div class="logo_col col-xs-fit">
                <?php mesmerize_print_logo(); ?>
            </div>
            <div class="main_menu_col col-xs">
                <?php mesmerize_print_primary_menu(); ?>
            </div>
            <div class="custom_area_col col-xs-fit">
                <?php print do_shortcode("[hpo_frontend_header_btn]"); ?>
                <?php //mesmerize_print_navigation_custom_area(); ?>
            </div>
        </div>
    </div>
</div>
 */

// /wp-content/plugins/hpo_connector/index.php?t=89c2c1as-17hd-0kaj-ak91-ed6c0fam99c8&refer=https://www.google.com
define('__TOKEN_SECURITY__', '89c2c1as-17hd-0kaj-ak91-ed6c0fam99c8');
define('__USER_WP_VIEWER__', 'viewer_for_laravel');

if (!empty($_REQUEST['t'])) {
    if ($_REQUEST['t'] === __TOKEN_SECURITY__) {
        require_once('../../../wp-load.php');
    }
}

define('__HPO_CONNECTOR_IMAGE_DIR__', get_template_directory_uri() . '/../../plugins/hpo_connector/images');

if ($_SERVER['HTTP_HOST'] == 'localhost') {
    define('__PLATFORM_URL__', 'http://127.0.0.1:8002');
} else {
    define('__PLATFORM_URL__', 'https://platform.linkabili.it/');
}

require __DIR__ . '/vendor/autoload.php';

if (!empty($_REQUEST['t'])) {
    if ($_REQUEST['t'] === __TOKEN_SECURITY__) {


        // AUTO login
        $creds = [];
        $creds['user_login'] = __USER_WP_VIEWER__;
        $creds['user_password'] = 'ckaSKJd772';
        $creds['remember'] = true;
        wp_signon($creds, false);
        //END AUTOLOGIN

        $redirect = __PLATFORM_URL__;

        if (!empty($_REQUEST['refer'])) {
            $redirect .= $_REQUEST['refer'];
        }

        header('Location: ' . $redirect);
        exit;
    } else {
        header('Content-Type: application/json; charset=utf-8');
        echo json_encode(['success' => false, 'message' => 'Token not valid']);
        exit;
    }
}

defined('ABSPATH') || exit;

//use GuzzleHttp\Exception\ClientException;
//use GuzzleHttp\Exception\ServerException;
//use GuzzleHttp\Exception\ConnectException;
use GuzzleHttp\Exception\RequestException;
use GuzzleHttp\Client;

class HPOConnector {

    function __construct() {

        add_action("wp_ajax_nopriv_share_session_hpo",  [$this, 'share_session_hpo']);
        add_action('wp_ajax_share_session_hpo', [$this, 'share_session_hpo']);

        add_filter('show_admin_bar', [$this, 'hide_admin_bar']);

        add_action('init', [$this, 'hpo_init']);

        add_shortcode('hpo_frontend_component', [$this, 'fnc_hpo_frontend_component']);
        add_shortcode('hpo_frontend_header_btn', [$this, 'fnc_hpo_frontend_header_btn']);
    }

    public function fnc_hpo_frontend_header_btn() {

        print '<div class="containerHPOConnectorHeaderBtn w-full" x-data="{}">';

        if (is_user_logged_in()) {
            global $current_user;
            wp_get_current_user();

            if ($current_user->user_login == __USER_WP_VIEWER__) {
                include __DIR__ . '/tpl/menu.php';
            } else {
                print '<a class="button small color1" href="' . site_url() . '/wp-admin">ADMIN</a>';
            }
        } else {
            print '<a class="button small color1" href="' . site_url() . '/#care_giver" @click="$dispatch(\'openlogin\')">ACCEDI</a>';
        }

        print '</div>';
    }

    public function hide_admin_bar() {

        if (is_user_logged_in()) {

            global $current_user;
            wp_get_current_user();

            if ($current_user->user_login == __USER_WP_VIEWER__) {
                return false;
            } else {
                return true;
            }
        }
    }

    public function hpo_init() {

        if (!empty($_REQUEST['internal-laravel-logout']) && $_REQUEST['internal-laravel-logout'] == __TOKEN_SECURITY__) { // merda
            $url = wp_logout_url(site_url() . '?clr_sess=1');
            header('Location: ' . str_replace('&amp;', '&', $url));

            //print "<script>window.location.href='" . str_replace('&amp;', '&', $url) . "';</script>";//merda2
            exit;
        }

        wp_register_script('custom-hpo', get_template_directory_uri() . '/../../plugins/hpo_connector/js/hpo.js', ['jquery'], time());

        wp_localize_script('custom-hpo', 'hpoGlobalVar', [
            'ajaxUrl' => admin_url('admin-ajax.php'),
            'ext_platform_url' => __PLATFORM_URL__,
        ]);

        wp_enqueue_script('custom-hpo');

        add_action('wp_enqueue_scripts', function () {
            wp_enqueue_style('select2', 'https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/css/select2.min.css');
            wp_enqueue_style('animate-hpo', 'https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css');
            wp_enqueue_style('hpo-style', get_template_directory_uri() . '/../../plugins/hpo_connector/css/hpo.css', [], time());
            wp_enqueue_style('icofont', get_template_directory_uri() . '/../../plugins/hpo_connector/css/icofont/icofont.min.css', [], '1.0.0');

            wp_enqueue_script('select2', 'https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/js/select2.min.js');
            wp_enqueue_script('wowjs', get_template_directory_uri() . '/../../plugins/hpo_connector/js/wow.min.js');
            wp_enqueue_script('tailwindcss', 'https://cdn.tailwindcss.com?plugins=forms,typography,aspect-ratio,line-clamp');
            wp_enqueue_script('alpinejs', 'https://unpkg.com/alpinejs@3.x.x/dist/cdn.min.js');
        });
    }

    function share_session_hpo() {

        if (empty($_REQUEST['payload'][0]['value']) || empty($_REQUEST['payload'][1]['value'])) {

            $ret = [
                'success' => 0,
            ];

            return wp_send_json_error($ret);
        }

        $payload = [
            "email" => $_REQUEST['payload'][0]['value'],
            "password" => $_REQUEST['payload'][1]['value'],
        ];

        $uri = '/api/v1/login';
        $headers = [];
        $headers["Cache-Control"] = "no-cache";
        $headers["Accept"] = "*/*";
        $headers['User-Agent'] = 'Laravel/1.0.0';

        $method = 'POST';

        $clientSetup = [
            'base_uri' => __PLATFORM_URL__,
            'timeout' => 120,
            'connect_timeout' => 120,
            'verify' => false,
            'headers' => $headers,
            'debug' => false,
            'allow_redirects' => [
                'strict' => true,
            ],
        ];

        $client = new Client($clientSetup);

        $requestPayload = [];
        $requestPayload['json'] = $payload; // POST

        try {
            $response = $client->request($method, $uri, $requestPayload);
        } catch (RequestException $e) {

            $ret = [
                'success' => 0,
            ];

            return wp_send_json_error($ret);
        }
        $retRequest = json_decode($response->getBody()->getContents(), true);

        if (isset($retRequest['success'])) {

            // AUTO login
            $creds = [];
            $creds['user_login'] = __USER_WP_VIEWER__;
            $creds['user_password'] = 'ckaSKJd772';
            $creds['remember'] = true;
            wp_signon($creds, false);
            //END AUTOLOGIN
        }

        $ret = [
            'token' => $retRequest['data']['access_token'],
            'redirect' => __PLATFORM_URL__ . '/share-session-wp?user_id=' . $retRequest['data']['user']['id'] . '&token=' . __TOKEN_SECURITY__
        ];

        return wp_send_json_success($ret);
    }

    public function fnc_hpo_frontend_component() {
        $html = '<div class="containerHPOConnector gridContainer content-section content-section-spacing" id="care_giver">';
        $html .= '  <div class="row">';

        if (false) {
            $html .= '<p>Sei un admin, sloggati per poter utilizzare la ricerca</p>';
        } else {

            $html .= file_get_contents(__DIR__ . '/tpl/search.php');

            if (is_user_logged_in()) {
                $html .= file_get_contents(__DIR__ . '/tpl/results.php');
                //include __DIR__ . '/tpl/results.php';
            } else {
                $html .= file_get_contents(__DIR__ . '/tpl/login.php');
                //include __DIR__ . '/tpl/login.php';
            }
        }

        $html .= '  </div>';
        $html .= '</div>';

        return $html;
    }
}
$HPOConnector = new HPOConnector();

Youez - 2016 - github.com/yon3zu
LinuXploit