!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.84 GB of 429.69 GB (68.15%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     NoteActions.php (4.51 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
/**
 * REST API Admin Note Action controller
 *
 * Handles requests to the admin note action endpoint.
 */

namespace Automattic\Kkart\Admin\API;

defined'ABSPATH' ) || exit;

use 
Automattic\Kkart\Admin\Notes\Note;
use \
Automattic\Kkart\Admin\Notes\Notes as NotesFactory;

/**
 * REST API Admin Note Action controller class.
 *
 * @extends KKART_REST_CRUD_Controller
 */
class NoteActions extends Notes {

    
/**
     * Register the routes for admin notes.
     */
    
public function register_routes() {
        
register_rest_route(
            
$this->namespace,
            
'/' $this->rest_base '/(?P<note_id>[\d-]+)/action/(?P<action_id>[\d-]+)',
            array(
                
'args'   => array(
                    
'note_id'   => array(
                        
'description' => __'Unique ID for the Note.''kkart' ),
                        
'type'        => 'integer',
                    ),
                    
'action_id' => array(
                        
'description' => __'Unique ID for the Note Action.''kkart' ),
                        
'type'        => 'integer',
                    ),
                ),
                array(
                    
'methods'             => \WP_REST_Server::EDITABLE,
                    
'callback'            => array( $this'trigger_note_action' ),
                    
// @todo - double check these permissions for taking note actions.
                    
'permission_callback' => array( $this'get_item_permissions_check' ),
                ),
                
'schema' => array( $this'get_public_item_schema' ),
            )
        );
    }

    
/**
     * Trigger a note action.
     *
     * @param WP_REST_Request $request Full details about the request.
     * @return WP_REST_Request|WP_Error
     */
    
public function trigger_note_action$request ) {
        
$note NotesFactory::get_note$request->get_param'note_id' ) );

        if ( ! 
$note ) {
            return new \
WP_Error(
                
'kkart_note_invalid_id',
                
__'Sorry, there is no resource with that ID.''kkart' ),
                array( 
'status' => 404 )
            );
        }

        
// Find note action by ID.
        
$action_id        $request->get_param'action_id' );
        
$actions          $note->get_actions'edit' );
        
$triggered_action false;

        foreach ( 
$actions as $action ) {
            if ( 
$action->id === $action_id ) {
                
$triggered_action $action;
            }
        }

        if ( ! 
$triggered_action ) {
            return new \
WP_Error(
                
'kkart_note_action_invalid_id',
                
__'Sorry, there is no resource with that ID.''kkart' ),
                array( 
'status' => 404 )
            );
        }

        
/**
         * Fires when an admin note action is taken.
         *
         * @param string $name The triggered action name.
         * @param Note   $note The corresponding Note.
         */
        
do_action'kkart_note_action'$triggered_action->name$note );

        
/**
         * Fires when an admin note action is taken.
         * For more specific targeting of note actions.
         *
         * @param Note $note The corresponding Note.
         */
        
do_action'kkart_note_action_' $triggered_action->name$note );

        
// Update the note with the status for this action.
        
if ( ! empty( $triggered_action->status ) ) {
            
$note->set_status$triggered_action->status );
        }

        
$note->save();

        if ( 
in_array$note->get_type(), array( 'error''update' ) ) ) {
            
$tracks_event 'wcadmin_store_alert_action';
        } else {
            
$tracks_event 'wcadmin_inbox_action_click';
        }

        
kkart_admin_record_tracks_event(
            
$tracks_event,
            array(
                
'note_name'    => $note->get_name(),
                
'note_type'    => $note->get_type(),
                
'note_title'   => $note->get_title(),
                
'note_content' => $note->get_content(),
                
'action_name'  => $triggered_action->name,
                
'action_label' => $triggered_action->label,
                
'screen'       => $this->get_screen_name(),
            )
        );

        
$data $note->get_data();
        
$data $this->prepare_item_for_response$data$request );
        
$data $this->prepare_response_for_collection$data );

        return 
rest_ensure_response$data );
    }

    
/**
     * Get screen name.
     *
     * @return string The screen name.
     */
    
public function get_screen_name() {
        
$screen_name '';

        if ( isset( 
$_SERVER['HTTP_REFERER'] ) ) {
            
parse_strwp_parse_url$_SERVER['HTTP_REFERER'], PHP_URL_QUERY ), $queries ); // phpcs:ignore sanitization ok.
        
}
        if ( isset( 
$queries ) ) {
            
$page      = isset( $queries['page'] ) ? $queries['page'] : null;
            
$path      = isset( $queries['path'] ) ? $queries['path'] : null;
            
$post_type = isset( $queries['post_type'] ) ? $queries['post_type'] : null;
            
$post      = isset( $queries['post'] ) ? get_post_type$queries['post'] ) : null;
        }

        if ( isset( 
$page ) ) {
            
$current_page 'kkart-admin' === $page 'home_screen' $page;
            
$screen_name  = isset( $path ) ? substrstr_replace'/''_'$path ), ) : $current_page;
        } elseif ( isset( 
$post_type ) ) {
            
$screen_name $post_type;
        } elseif ( isset( 
$post ) ) {
            
$screen_name $post;
        }
        return 
$screen_name;
    }
}

:: 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.0949 ]--