HEX
Server:
System: Linux aac286ea486c 5.14.0-687.15.1.el9_8.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Jun 11 08:51:45 EDT 2026 x86_64
User: root (0)
PHP: 8.2.30
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,disk_free_space,diskfreespace
Upload Files
File: /dom877180/wp-content/plugins/indeed-membership-pro/classes/Cheat_Off.class.php
<?php
if (!class_exists('Cheat_Off')):
	
class Cheat_Off{
	
	public function __construct(){
		/*
		 * @param none
		 * @return none
		 */
		 add_action('init', array($this, 'init_check'));
	}
	
	public function init_check(){
		/*
		 * @param none
		 * @return none
		 */
		 global $current_user;
		 if (empty($current_user) || empty($current_user->ID)){
		 	return; /// Not available for visitors
		 }
		 if (current_user_can("manage_options")){
		 	return;
		 }
		 if (ihc_get_user_type()=='admin'){
		 	return; /// not available for admin
		 }
		 $cheat_off_enabled = get_option('ihc_cheat_off_enable');
		 if (empty($cheat_off_enabled)){
		 	return; /// Module is disabled
		 }
		 
		 /// user has cookie??
		 if (!empty($_COOKIE['ihc_cheat_off'])){
		 	 $hash_from_cookie = sanitize_text_field($_COOKIE['ihc_cheat_off']);
			 $hash_from_db = Ihc_Db::cheat_off_get_hash($current_user->ID);
			 if ($hash_from_cookie && $hash_from_db && $hash_from_cookie!=$hash_from_db){
			 	/// logout and redirect home
				///unset cookie
				setcookie('ihc_cheat_off', '', time()-3600, '/');
				///and then logout
				$this->logout();
			 }
		 } else {
			$hash = $current_user->ID . '_' . ihc_random_str(8);
			$inserted = Ihc_Db::cheat_off_set_hash($current_user->ID, $hash);
			if ($inserted){
				$num_of_days = 365;
				$num_of_days_option = get_option('ihc_cheat_off_cookie_time');
				if (!empty($num_of_days_option)){
					$num_of_days = $num_of_days_option;
				}
				$cookie_time = time() + $num_of_days * 24 * 60 * 60;//one year
			 	setcookie('ihc_cheat_off', $hash, $cookie_time, '/');				
			}
		 }
		 
	}

	private function logout(){
		/*
		 * @param none
		 * @return none
		 */
		$url = get_option('ihc_cheat_off_redirect');
		if ($url && $url!=-1){
			$link = get_permalink($url);
			if (!$link){
				$link = ihc_get_redirect_link_by_label($url);
			}
		}
		if (empty($link)){
			
			$link = IHC_PROTOCOL . sanitize_text_field($_SERVER['HTTP_HOST']) . sanitize_text_field($_SERVER['REQUEST_URI']);
		}			
		
		wp_clear_auth_cookie();
		do_action('wp_logout');
		nocache_headers();
		wp_redirect($link);
		exit();		 
	}
	
}
	
endif;