403Webshell
Server IP : 104.21.84.107  /  Your IP : 104.23.197.208
Web Server : Apache/2.4.63 (Ubuntu)
System : Linux adminpruebas-Virtual-Machine 6.14.0-37-generic #37-Ubuntu SMP PREEMPT_DYNAMIC Fri Nov 14 22:10:32 UTC 2025 x86_64
User : www-data ( 33)
PHP Version : 8.4.5
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /var/www/html/fcs/administrator/components/com_phocadownload/libraries/phocadownload/stat/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/html/fcs/administrator/components/com_phocadownload/libraries/phocadownload/stat/stat.php
<?php
/*
 * @package Joomla 1.5
 * @copyright Copyright (C) 2005 Open Source Matters. All rights reserved.
 * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
 *
 * @component Phoca Component
 * @copyright Copyright (C) Jan Pavelka www.phoca.cz
 * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
 */

// Check to ensure this file is included in Joomla!
defined('_JEXEC') or die();
use Joomla\CMS\Factory;
jimport('joomla.application.component.model');

class PhocaDownloadStat
{
	public static function createUserStatEntry($downloadId) {
		$db 		= Factory::getDBO();
		$user		= Factory::getUser();


		$query =  ' SELECT * FROM '.$db->quoteName('#__phocadownload_user_stat')
				 .' WHERE '. $db->quoteName('userid')
				 .' = '
				 .$db->Quote((int)$user->id)
				 .' AND '. $db->quoteName('fileid')
				 .' = '
				 .$db->Quote((int)$downloadId);

		$db->setQuery($query);
		$results = $db->loadObjectList();

		$date = gmdate('Y-m-d H:i:s');
		if ($results) {
			// Update count
			$query = 'UPDATE '.$db->quoteName('#__phocadownload_user_stat')
					.' SET count = (count + 1),'
					.' date = '.$db->Quote($date)
					.' WHERE userid = '.$db->Quote((int)$user->id)
					.' AND fileid = '.$db->Quote((int)$downloadId);

			$db->setQuery($query);
			$db->execute();
		} else {

			$query = 'INSERT INTO '.$db->quoteName('#__phocadownload_user_stat')
					.' ('.$db->quoteName('count').','
					.' '.$db->quoteName('userid').','
					.' '.$db->quoteName('fileid').','
					.' '.$db->quoteName('date').')'
					.' VALUES ('.$db->Quote(1).','
					.' '.$db->Quote((int)$user->id).','
					.' '.$db->Quote((int)$downloadId).','
					.' '.$db->Quote($date).')';
			$db->setQuery($query);
			$db->execute();
		}
		return true;
	}

	public static function getCountFilePerUser($downloadId) {
		$db 		= Factory::getDBO();
		$user		= Factory::getUser();

		$query =  ' SELECT count FROM '.$db->quoteName('#__phocadownload_user_stat')
				 .' WHERE '. $db->quoteName('userid')
				 .' = '
				 .$db->Quote((int)$user->id)
				 .' AND '. $db->quoteName('fileid')
				 .' = '
				 .$db->Quote((int)$downloadId)
				 .' LIMIT 0, 1';

		$db->setQuery($query);
		$count = $db->loadObject();
		if (isset($count->count)) {
			return (int)$count->count;
		} else {
			return 0;
		}
	}
}
?>

Youez - 2016 - github.com/yon3zu
LinuXploit