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/services/Ihc_Pushover.class.php
<?php
if (!class_exists('Ihc_Pushover')):

class Ihc_Pushover{
	private static $notification_templates = array();

	/*
	 * @param none
	 * @return none
	 */
	public function __construct(){
		require_once IHC_PATH . 'classes/services/Pushover.class.php';
	}


	/*
	 * @param int, int, string, boolean
	 * @return boolean
	 */
	public function send_notification($uid=0, $lid=-1, $notification_type='', $send_to_admin=FALSE){
		if ($notification_type){
			if (empty($notification_templates[$lid])){
				self::$notification_templates[$lid] = $this->get_notification_data($notification_type, $lid);
			}
			$notification_data = self::$notification_templates[$lid];

			if ($notification_data && !empty($notification_data['pushover_status']) && !empty($notification_data['pushover_message'])){
				$meta = ihc_return_meta_arr('pushover');
				$message = stripslashes($notification_data['pushover_message']);
				$message = ihc_replace_constants($message, $uid, $lid, $lid);
				$title = $notification_data['subject'];
				$title = ihc_replace_constants($title, $uid, $lid, $lid);

				$push = new Pushover();
				$app_token = get_option('ihc_pushover_app_token');
				if ($uid && !$send_to_admin){
					$user_token = get_user_meta($uid, 'ihc_pushover_token', TRUE);	/// USER
				} else {
					$user_token = $meta['ihc_pushover_admin_token'];  /// ADMIN
				}
				$sound = get_option('ihc_pushover_sound');
				$sound = empty($meta['ihc_pushover_sound']) ? 'bike' : $meta['ihc_pushover_sound'];
				$url = empty($meta['ihc_pushover_url']) ? '' : $meta['ihc_pushover_url'];
				$url_title = empty($meta['ihc_pushover_url_title']) ? '' : $meta['ihc_pushover_url_title'];

				$push->setToken($app_token);
				$push->setUser($user_token);
				$push->setTitle($title);
				$push->setMessage($message);
				$push->setUrl($url);
				$push->setUrlTitle($url_title);
				$push->setPriority(2); /// 0 || 1 || 2
				$push->setRetry(300); /// five minutes
				$push->setExpire(3600); /// one hour
				$push->setTimestamp(time());
				$push->setDebug(FALSE);
				$push->setSound($sound);
				return $push->send();
			}
		}
		return FALSE;
	}


	/*
	 * @param string
	 * @return array
	 */
	private function get_notification_data($type='', $lid=-1){
		global $wpdb;
		$table = $wpdb->prefix . "ihc_notifications";
		$q = $wpdb->prepare("SELECT id,notification_type,level_id,subject,message,pushover_message,pushover_status,status FROM $table
									WHERE
									notification_type=%s
									AND level_id=%d
									ORDER BY id DESC LIMIT 1;", $type, $lid);
		$data = $wpdb->get_row($q);
		if (empty($data)){
			$q = $wpdb->prepare("SELECT id,notification_type,level_id,subject,message,pushover_message,pushover_status,status FROM $table
										WHERE
										notification_type=%s
										AND level_id=-1
										ORDER BY id DESC LIMIT 1;", $type);
			$data = $wpdb->get_row($q);
		}
		return (array)$data;
	}

}

endif;