HEX
Server: Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.4.30
System: Linux iZj6c1151k3ad370bosnmsZ 3.10.0-1160.76.1.el7.x86_64 #1 SMP Wed Aug 10 16:21:17 UTC 2022 x86_64
User: root (0)
PHP: 7.4.30
Disabled: NONE
Upload Files
File: /var/www/html/www.winghung.com/wp-content/plugins/conversational-forms/classes/admin/resend.php
<?php


/**
 * Class Qcformbuilder_Forms_Admin_Resend
 */
class Qcformbuilder_Forms_Admin_Resend {

	/**
	 * Nonce action for resend links
	 *
	 * @since 1.5.2
	 *
	 * @var string
	 */
	protected static $nonce_action = '_wfb_resend';

	/**
	 * Generate nonce for resend links
	 *
	 * @since 1.5.2
	 *
	 * @return string
	 */
	public static function resend_nonce(){
		return wp_create_nonce( self::$nonce_action );
	}

	/**
	 * Verify the resend nonce
	 *
	 * @since 1.5.2
	 *
	 * @param string $nonce Nonce to check
	 *
	 * @return false|int
	 */
	public static function verify_nonce( $nonce ){
		return wp_verify_nonce( $nonce, self::$nonce_action );

	}

	/**
	 * Watch for resend requests and process if so and authorized, etc.
	 *
	 * @uses "init" action
	 *
	 * @since 1.5.2
	 *
	 */
	public static function watch_for_resend(){
		if( isset( $_GET[ '_wfb_resend' ], $_GET[ 'e' ], $_GET[ 'f' ] ) && self::verify_nonce($_GET[ '_wfb_resend' ]  ) ){
			if ( ! current_user_can( Qcformbuilder_Forms::get_manage_cap( 'resend-email' ) ) ) {
				return;
			}
			$form = Qcformbuilder_Forms_Forms::get_form( $_GET[ 'f' ] );
			if( is_array( $form ) ){
				$resender = new Qcformbuilder_Forms_Email_Resend( absint( $_GET[ 'e' ] ), $form  );

				$resender->resend();
				wfb_redirect( add_query_arg( 'message_resent', 'true', Qcformbuilder_Forms_Admin::main_admin_page_url()  ) );
				exit;

			}


		}

 	}


}