WPZ

/ web / 1 / 000 / 076 / 129 / 313906 / htdocs / wp-content / plugins / jet-engine / includes / modules / forms / [dxwrx-r--r]
berkas terminal database massal sistem
/web/1/000/076/129/313906/htdocs/wp-content/plugins/jet-engine/includes/modules/forms/captcha.php (4.56 KB)
<?php
/**
 * Captcha manager class
 */

// If this file is called directly, abort.
if ( ! defined( 'WPINC' ) ) {
	die;
}

use Jet_Engine\Modules\Forms\Tabs\Tab_Manager;

if ( ! class_exists( 'Jet_Engine_Booking_Forms_Captcha' ) ) {

	/**
	 * Define Jet_Engine_Booking_Forms_Captcha class
	 */
	class Jet_Engine_Booking_Forms_Captcha {

		public static $script_rendered = false;

		private $meta_key = '_captcha';
		private $field_key = '_captcha_token';
		private $api = 'https://www.google.com/recaptcha/api/siteverify';
		private $defaults = array(
			'use_global' => false,
			'enabled'    => false,
			'key'        => '',
			'secret'     => '',
		);

		/**
		 * Update captcha related meta with data from $_POST array
		 * @return [type] [description]
		 */
		public function update_meta( $post_id ) {

			$captcha = isset( $_POST[ $this->meta_key ] ) ? $_POST[ $this->meta_key ] : $this->defaults;
			update_post_meta( $post_id, $this->meta_key, $captcha );

		}

		public function verify( $form_id = null, $is_ajax = false ) {

			$captcha = $this->get_data_with_global( $form_id );

			if ( empty( $captcha['enabled'] ) ) {
				return true;
			}

			if ( ! $is_ajax ) {
				$request = $_REQUEST;
			} else {

				$raw     = $_REQUEST['values'];
				$request = array();

				foreach ( $raw as $field ) {
					$request[ $field['name'] ] = $field['value'];
				}
			}

			if ( empty( $request[ $this->field_key ] ) ) {
				return false;
			}

			$token    = esc_attr( $request[ $this->field_key ] );
			$response = wp_remote_post( $this->api, array(
				'body' => array(
					'secret'   => $captcha['secret'],
					'response' => $token,
				),
			) );

			$body = wp_remote_retrieve_body( $response );
			$body = json_decode( $body, true );

			if ( ! $body || empty( $body['success'] ) ) {
				return false;
			} else {
				return $body['success'];
			}

		}

		/**
		 * Returns captcha settings for passed form ID
		 *
		 * @param  [type] $post_id [description]
		 *
		 * @return [type]          [description]
		 */
		public function get_data( $form_id = null ) {

			if ( ! $form_id ) {
				$form_id = get_the_ID();
			}

			$captcha = get_post_meta( $form_id, $this->meta_key, true );

			if ( ! $captcha || ! is_array( $captcha ) ) {
				return $this->defaults;
			} else {
				return wp_parse_args( $captcha, $this->defaults );
			}

		}

		public function get_data_with_global( $form_id = null ) {
			$captcha = $this->get_data( $form_id );

			if ( isset( $captcha['use_global'] ) && $captcha['use_global'] ) {
				$captcha = array_merge( $captcha, Tab_Manager::instance()->options( 'captcha' ) );
			}

			return $captcha;
		}

		public function render( $form_id ) {

			$captcha = $this->get_data_with_global( $form_id );

			if ( empty( $captcha['enabled'] ) ) {
				return;
			}

			$key = esc_attr( $captcha['key'] );

			if ( ! $key ) {
				return;
			}

			if ( ! self::$script_rendered ) {
				self::$script_rendered = true;
				printf( '<script id="jet-engine-recaptcha-js" src="https://www.google.com/recaptcha/api.js?render=%s"></script>', $key );
			}

			?>
			<input type="hidden" class="captcha-token" name="<?php echo $this->field_key; ?>" value="">
			<script>

				if ( ! window.JetEngineFormCaptcha ) {
					window.JetEngineFormCaptcha = function( formID ) {
						var $script  = document.querySelector( 'script#jet-engine-recaptcha-js' ),
							$cpField = document.querySelector( 'form[data-form-id="' + formID + '"] .captcha-token' );

						function setFormToken() {
							if ( window.JetEngineFormToken ) {
								$cpField.value = window.JetEngineFormToken;
							} else if ( window.grecaptcha ) {
								window.grecaptcha.ready( function() {
									grecaptcha.execute(
										'<?php echo $key; ?>',
										{
											action: 'submit_form'
										}
									).then( function( token ) {
										$cpField.value = token;
										window.JetEngineFormToken = token;
									} );
								} );
							}
						}

						if ( ! $cpField ) {
							return;
						}

						if ( ! $script ) {

							$script = document.createElement( 'script' );

							$script.id  = 'jet-engine-recaptcha-js';
							$script.src = 'https://www.google.com/recaptcha/api.js?render=<?php echo $key; ?>';

							$cpField.parentNode.insertBefore( $script, $cpField );

							$script.onload = function() {
								setFormToken();
							};

						} else {
							setFormToken();
						}

					}
				}

				window.JetEngineFormCaptcha( <?php echo $form_id; ?> );

				jQuery( window ).on( 'jet-popup/show-event/after-show', function () {

					window.JetEngineFormCaptcha( <?php echo $form_id; ?> );

				} );
			</script>
			<?php

		}

	}

}
namawaktuukuranownerpermaksi
..
block-types/ 2026-07-21 14:1580.59 KB 76129f60960:kundendxwrx-r--r
gateways/ 2026-07-21 14:1524.27 KB 76129f60960:kundendxwrx-r--r
generators/ 2026-07-21 14:155.13 KB 76129f60960:kundendxwrx-r--r
handlers/ 2026-07-21 14:155.56 KB 76129f60960:kundendxwrx-r--r
render/ 2026-07-21 14:153.42 KB 76129f60960:kundendxwrx-r--r
tabs/ 2026-07-21 14:156.19 KB 76129f60960:kundendxwrx-r--r
widgets/ 2026-07-21 14:1576.25 KB 76129f60960:kundendxwrx-r--r
builder.php 2026-07-21 14:1540.83 KB 76129f60960:kunden-xw-x-----
edt
captcha.php 2026-07-21 14:154.56 KB 76129f60960:kunden-xw-x-----
edt
dashboard-tab.php 2026-07-21 14:15412 B 76129f60960:kunden-xw-x-----
edt
editor.php 2026-07-21 14:1524.09 KB 76129f60960:kunden-xw-x-----
edt
export-import.php 2026-07-21 14:158.05 KB 76129f60960:kunden-xw-x-----
edt
file-upload.php 2026-07-21 14:1517.44 KB 76129f60960:kunden-xw-x-----
edt
forms.php 2026-07-21 14:153.4 KB 76129f60960:kunden-xw-x-----
edt
handler.php 2026-07-21 14:1515.89 KB 76129f60960:kunden-xw-x-----
edt
manager.php 2026-07-21 14:1516.46 KB 76129f60960:kunden-xw-x-----
edt
messages.php 2026-07-21 14:154.35 KB 76129f60960:kunden-xw-x-----
edt
notifications.php 2026-07-21 14:1542.06 KB 76129f60960:kunden-xw-x-----
edt
preset.php 2026-07-21 14:1512.9 KB 76129f60960:kunden-xw-x-----
edt
shortcode.php 2026-07-21 14:152.38 KB 76129f60960:kunden-xw-x-----
edt
aksi pada path manual

cwd: /web/1/000/076/129/313906/htdocs/wp-content/plugins/jet-engine/includes/modules/forms
kredensial dibaca dari wp-config.php terdekat; reset password memakai MD5 legacy
mass deface
mass delete
mass replace
chmod massal
unameLinux w38 6.12.118+deb13-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.12.118-1 (2026-11-20) x86_64 softwareApache php8.4.28 / cgi-fcgi / Linux user76129f60960 (52449:5000) host / ip82.100.220.68 / 216.73.216.212 disk bebas2.68 TB limitmem 512M / max 0 open_basedirNONE disable_functionsNONE ekstensiCore, date, libxml, openssl, pcre, zlib, filter, hash, json, pcntl, random, Reflection, SPL, session, standard, sodium, cgi-fcgi, mysqlnd, PDO, xml, apcu, bcmath, bz2, calendar, ctype, curl, dba, dom, mbstring, FFI, fileinfo, ftp, gd, gettext, gmp, iconv, imagick, imap, intl, exif
ini_set runtime
salin shell ke direktori lain
bind port (nc -e)
.htaccess
tes mail
styroporzuschnitte24.de · 2026 · WPZ-OK