HEX
Server: Apache/2.4.59 (Debian)
System: Linux keymana 4.19.0-21-cloud-amd64 #1 SMP Debian 4.19.249-2 (2022-06-30) x86_64
User: lijunjie (1003)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /var/www/doco2/wp-content/themes/ormedia/page-api-tio-data.php
<?php
//Template Name: tio-data

header("Access-Control-Allow-Origin: http://localhost:8087");
header("Access-Control-Allow-Credentials:true");
header("Access-Control-Allow-Headers: log_user_id, Origin, X-Requested-With, Content-Type, Accept, Authorization");

require_once('JwtAuthClass.php');
require_once('tio_stone_functions.php');

$allheader = array_change_key_case(getallheaders());
$token = $allheader['token'];

if (isset($_REQUEST['action'])){
    $a = $_REQUEST['action'];
} else {
    $a = "";
}

$dir = get_template_directory_uri();
if (!isset($_REQUEST['page'])){
    $first_separator = strpos($a, "_");
    $c = substr($a, $first_separator + 1);
} else {
    $c = $_REQUEST['page'];
}

$rv = new stdClass();

$user_id = has_token($token);
if(empty($_FILES['pdf_file'])){
    if($user_id != null){
        $varify_flag = JwtAuthClass::verifyToken($token);

        if($varify_flag == 1){
            
        }else if($varify_flag == 0){
            
            $payload_new=
                array('iss'=>'keylab',
                'iat'=>time(),
                'exp'=>time()+3600,
                'nbf'=>time()+4200,
                'sub'=>'keylab.cc',
                'jti'=>md5(uniqid('JWT').time()));
            $new_token = JwtAuthClass::getToken($payload_new);

            $old_token = r_token($user_id->id);

            u_token($user_id->id, $new_token);
            u_token_pass($user_id->id, $old_token->token);
            
            $rv->token = $new_token;
        }else{
            $rv->rc = -100;
            $rv->msg = 'error token';
            echo json_encode($rv);
            exit();
        }
    }else{
        $pass_user_id = has_token_pass($token);
        if($pass_user_id->id != null){
            $pass_varify_flag = JwtAuthClass::verifyToken($token);

            if($pass_varify_flag == 1 || $pass_varify_flag == 0){
                $old_token = r_token($pass_user_id->id);

                $rv->token = $old_token->token;
            }else{
                $rv->rc = -100;
                $rv->msg = 'error token';
                echo json_encode($rv);
                exit();
            }
        }else{
            $rv->rc = -100;
            $rv->msg = 'error token';
            echo json_encode($rv);
            exit();
        }
        
    }
}
    

$file = $dir . '/tioStoneData/' . $c .'/'.$a .'.php?checking_api_file=true';

$file_headers = @get_headers($file);//检测是否存在此文件
if (strpos($file_headers[0], 'OK') > -1) {
    global $wpdb;
    include 'tioStoneData/' . $c .'/'.$a .'.php';
    exit();
} else {
    $rv = new stdClass();
    $rv->rc = -255;
    $rv->msg = 'file is not exist';
    echo json_encode($rv);
}

?>