403Webshell
Server IP : 192.64.118.117  /  Your IP : 18.119.108.165
Web Server : LiteSpeed
System : Linux premium56.web-hosting.com 4.18.0-513.24.1.lve.1.el8.x86_64 #1 SMP Thu May 9 15:10:09 UTC 2024 x86_64
User : thecgapy ( 1160)
PHP Version : 7.4.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/thecgapy/mobilecreationz.com/wp-content/plugins/wordfence/lib/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/thecgapy/mobilecreationz.com/wp-content/plugins/wordfence/lib/wfNotification.php
<?php
class wfNotification {
	const PRIORITY_LOW = 1500;
	const PRIORITY_DEFAULT = 1000;
	const PRIORITY_HIGH = 500;
	
	protected $_id;
	protected $_category;
	protected $_priority;
	protected $_ctime;
	protected $_html;
	protected $_links;
	
	public static function notifications($since = 0) {
		global $wpdb;
		$rawNotifications = $wpdb->get_results($wpdb->prepare("SELECT * FROM {$wpdb->prefix}wfNotifications WHERE `new` = 1 AND `ctime` > %d ORDER BY `priority` ASC, `ctime` DESC", $since), ARRAY_A); 
		$notifications = array();
		foreach ($rawNotifications as $raw) {
			$notifications[] = new wfNotification($raw['id'], $raw['priority'], $raw['html'], $raw['category'], $raw['ctime'], json_decode($raw['links'], true), true);
		}
		return $notifications;
	}
	
	public static function getNotificationForID($id) {
		global $wpdb;
		$rawNotifications = $wpdb->get_results($wpdb->prepare("SELECT * FROM {$wpdb->prefix}wfNotifications WHERE `id` = %s ORDER BY `priority` ASC, `ctime` DESC", $id), ARRAY_A);
		if (count($rawNotifications) == 1) {
			$raw = $rawNotifications[0];
			return new wfNotification($raw['id'], $raw['priority'], $raw['html'], $raw['category'], $raw['ctime'], json_decode($raw['links'], true), true);
		}
		return null;
	}
	
	public static function getNotificationForCategory($category, $requireNew = true) {
		global $wpdb;
		$rawNotifications = $wpdb->get_results($wpdb->prepare("SELECT * FROM {$wpdb->prefix}wfNotifications WHERE " . ($requireNew ? '`new` = 1 AND ' : '') . "`category` = %s ORDER BY `priority` ASC, `ctime` DESC LIMIT 1", $category), ARRAY_A);
		if (count($rawNotifications) == 1) {
			$raw = $rawNotifications[0];
			return new wfNotification($raw['id'], $raw['priority'], $raw['html'], $raw['category'], $raw['ctime'], json_decode($raw['links'], true), true);
		}
		return null;
	}
	
	public function __construct($id, $priority, $html, $category = null, $ctime = null, $links = null, $memoryOnly = false) {
		if ($id === null) {
			$id = 'site-' . wfUtils::base32_encode(pack('I', wfConfig::atomicInc('lastNotificationID')));
		}
		
		if ($category === null) {
			$category = '';
		}
		
		if ($ctime === null) {
			$ctime = time();
		} 
		
		if (!is_array($links)) {
			$links = array();
		}
		
		$this->_id = $id;
		$this->_category = $category;
		$this->_priority = $priority;
		$this->_ctime = $ctime;
		$this->_html = $html;
		$this->_links = $links;
		
		global $wpdb;
		if (!$memoryOnly) {
			$linksJSON = json_encode($links);
			
			if (!empty($category)) {
				$existing = self::getNotificationForCategory($category);
				if ($existing) {
					$wpdb->query($wpdb->prepare("UPDATE {$wpdb->prefix}wfNotifications SET priority = %d, ctime = %d, html = %s, links = %s WHERE id = %s", $priority, $ctime, $html, $linksJSON, $existing->id));
					return;
				}
			}
			
			$wpdb->query($wpdb->prepare("INSERT IGNORE INTO {$wpdb->prefix}wfNotifications (id, category, priority, ctime, html, links) VALUES (%s, %s, %d, %d, %s, %s)", $id, $category, $priority, $ctime, $html, $linksJSON));
		}
	}
	
	public function __get($key){
		if ($key == 'id') { return $this->_id; }
		else if ($key == 'category') { return $this->_category; }
		else if ($key == 'priority') { return $this->_priority; }
		else if ($key == 'ctime') { return $this->_ctime; }
		else if ($key == 'html') { return $this->_html; }
		else if ($key == 'links') { return $this->_links; }
		throw new InvalidArgumentException();
	}
	
	public function markAsRead() {
		global $wpdb;
		$wpdb->query($wpdb->prepare("UPDATE {$wpdb->prefix}wfNotifications SET `new` = 0 WHERE `id` = %s", $this->_id));
	}
}

Youez - 2016 - github.com/yon3zu
LinuXploit