!C99Shell v. 2.0 [PHP 7 Update] [25.02.2019]!

Software: Apache. PHP/7.3.33 

uname -a: Linux acloudg.aryanict.com 4.18.0-513.9.1.lve.el8.x86_64 #1 SMP Mon Dec 4 15:01:22 UTC
2023 x86_64
 

uid=1095(katebhospital) gid=1098(katebhospital) groups=1098(katebhospital) 

Safe-mode: OFF (not secure)

/var/softaculous/sitepad/editor/site-data/plugins/kkart-pro/packages/kkart-admin/src/API/   drwxr-xr-x
Free 292.87 GB of 429.69 GB (68.16%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     Options.php (5.45 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
/**
 * REST API Options Controller
 *
 * Handles requests to get and update options in the wp_options table.
 */

namespace Automattic\Kkart\Admin\API;

defined'ABSPATH' ) || exit;

/**
 * Options Controller.
 *
 * @extends KKART_REST_Data_Controller
 */
class Options extends \KKART_REST_Data_Controller {
    
/**
     * Endpoint namespace.
     *
     * @var string
     */
    
protected $namespace 'kkart-admin';

    
/**
     * Route base.
     *
     * @var string
     */
    
protected $rest_base 'options';

    
/**
     * Register routes.
     */
    
public function register_routes() {
        
register_rest_route(
            
$this->namespace,
            
'/' $this->rest_base,
            array(
                array(
                    
'methods'             => \WP_REST_Server::READABLE,
                    
'callback'            => array( $this'get_options' ),
                    
'permission_callback' => array( $this'get_item_permissions_check' ),
                ),
                
'schema' => array( $this'get_item_schema' ),
            )
        );

        
register_rest_route(
            
$this->namespace,
            
'/' $this->rest_base,
            array(
                array(
                    
'methods'             => \WP_REST_Server::EDITABLE,
                    
'callback'            => array( $this'update_options' ),
                    
'permission_callback' => array( $this'update_item_permissions_check' ),
                ),
                
'schema' => array( $this'get_item_schema' ),
            )
        );
    }

    
/**
     * Check if a given request has access to get options.
     *
     * @param  WP_REST_Request $request Full details about the request.
     * @return WP_Error|boolean
     */
    
public function get_item_permissions_check$request ) {
        
$params explode','$request['options'] );

        if ( ! isset( 
$request['options'] ) || ! is_array$params ) ) {
            return new \
WP_Error'kkart_rest_cannot_view'__'You must supply an array of options.''kkart' ), 500 );
        }

        foreach ( 
$params as $option ) {
            if ( ! 
$this->user_has_permission$option$request ) ) {
                return new \
WP_Error'kkart_rest_cannot_view'__'Sorry, you cannot view these options.''kkart' ), array( 'status' => rest_authorization_required_code() ) );
            }
        }

        return 
true;
    }

    
/**
     * Check if the user has permission given an option name.
     *
     * @param  string          $option Option name.
     * @param  WP_REST_Request $request Full details about the request.
     * @return boolean
     */
    
public function user_has_permission$option$request ) {
        
$permissions $this->get_option_permissions$request );

        if ( isset( 
$permissions$option ] ) ) {
            return 
$permissions$option ];
        }

        return 
current_user_can'manage_options' );
    }

    
/**
     * Check if a given request has access to update options.
     *
     * @param  WP_REST_Request $request Full details about the request.
     * @return WP_Error|boolean
     */
    
public function update_item_permissions_check$request ) {
        
$params $request->get_json_params();

        if ( ! 
is_array$params ) ) {
            return new \
WP_Error'kkart_rest_cannot_update'__'You must supply an array of options and values.''kkart' ), 500 );
        }

        foreach ( 
$params as $option_name => $option_value ) {
            if ( ! 
$this->user_has_permission$option_name$request ) ) {
                return new \
WP_Error'kkart_rest_cannot_update'__'Sorry, you cannot manage these options.''kkart' ), array( 'status' => rest_authorization_required_code() ) );
            }
        }

        return 
true;
    }

    
/**
     * Get an array of options and respective permissions for the current user.
     *
     * @param  WP_REST_Request $request Full details about the request.
     * @return array
     */
    
public function get_option_permissions$request ) {
        
$permissions = array(
            
'theme_mods_' get_stylesheet()     => current_user_can'edit_theme_options' ),
            
'kkart_setup_jetpack_opted_in' => current_user_can'manage_kkart' ),
            
'kkart_stripe_settings'        => current_user_can'manage_kkart' ),
            
'kkart_ppec_paypal_settings'   => current_user_can'manage_kkart' ),
            
'kkart_demo_store'             => current_user_can'manage_kkart' ),
            
'kkart_demo_store_notice'      => current_user_can'manage_kkart' ),
        );

        return 
apply_filters'kkart_rest_api_option_permissions'$permissions$request );
    }

    
/**
     * Gets an array of options and respective values.
     *
     * @param  WP_REST_Request $request Full details about the request.
     * @return array Options object with option values.
     */
    
public function get_options$request ) {
        
$params  explode','$request['options'] );
        
$options = array();

        if ( ! 
is_array$params ) ) {
            return array();
        }

        foreach ( 
$params as $option ) {
            
$options$option ] = get_option$option );
        }

        return 
$options;
    }

    
/**
     * Updates an array of objects.
     *
     * @param  WP_REST_Request $request Full details about the request.
     * @return array Options object with a boolean if the option was updated.
     */
    
public function update_options$request ) {
        
$params  $request->get_json_params();
        
$updated = array();

        if ( ! 
is_array$params ) ) {
            return array();
        }

        foreach ( 
$params as $key => $value ) {
            
$updated$key ] = update_option$key$value );
        }

        return 
$updated;
    }

    
/**
     * Get the schema, conforming to JSON Schema.
     *
     * @return array
     */
    
public function get_item_schema() {
        
$schema = array(
            
'$schema'    => 'http://json-schema.org/draft-04/schema#',
            
'title'      => 'options',
            
'type'       => 'object',
            
'properties' => array(
                
'options' => array(
                    
'type'        => 'array',
                    
'description' => __'Array of options with associated values.''kkart' ),
                    
'context'     => array( 'view' ),
                    
'readonly'    => true,
                ),
            ),
        );

        return 
$this->add_additional_fields_schema$schema );
    }
}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.0 [PHP 7 Update] [25.02.2019] maintained by KaizenLouie | C99Shell Github | Generation time: 0.0043 ]--