%PDF-1.5 %���� ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµùÕ5sLOšuY
Server IP : 49.231.201.246 / Your IP : 216.73.216.248 Web Server : Apache/2.4.18 (Ubuntu) System : Linux 246 4.4.0-210-generic #242-Ubuntu SMP Fri Apr 16 09:57:56 UTC 2021 x86_64 User : root ( 0) PHP Version : 7.0.33-0ubuntu0.16.04.16 Disable Function : 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_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority, MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /var/www/html/old/components/com_phocadownload/controllers/ |
Upload File : |
<?php /* @package Joomla * @copyright Copyright (C) Open Source Matters. All rights reserved. * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php * @extension Phoca Extension * @copyright Copyright (C) Jan Pavelka www.phoca.cz * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL */ defined('_JEXEC') or die(); class PhocaDownloadControllerUser extends PhocaDownloadController { public $loginUrl; public $loginString; public $url; public $itemId; function __construct() { parent::__construct(); $this->registerTask( 'unpublish', 'unpublish' ); $app = JFactory::getApplication(); $this->itemId = $app->input->get( 'Itemid', 0, 'int' ); $this->loginUrl = JRoute::_('index.php?option=com_users&view=login', false); $this->loginString = JText::_('COM_PHOCADOWNLOAD_NOT_AUTHORISED_ACTION'); $this->url = 'index.php?option=com_phocadownload&view=user&Itemid='. $this->itemId; } /* function display() { if ( ! JRequest::getCmd( 'view' ) ) { $this->input->set('view', 'user' ); } parent::display(); }*/ function unpublish() { $app = JFactory::getApplication(); $post['id'] = $app->input->get( 'actionid', '', 'int', 0 ); $post['limitstart'] = $app->input->get( 'limitstart', '', 'int', 0 ); $model = $this->getModel('user'); //$isOwnerCategory = 1;//$model->isOwnerCategoryImage((int)$this->_user->id, (int)$id); // USER RIGHT - Delete - - - - - - - - - - - // 2, 2 means that user access will be ignored in function getUserRight for display Delete button $user = JFactory::getUser(); $rightDisplayDelete = 0; $catAccess = PhocaDownloadAccess::getCategoryAccessByFileId((int)$post['id']); if (!empty($catAccess)) { $rightDisplayDelete = PhocaDownloadAccess::getUserRight('deleteuserid', $catAccess->deleteuserid, 2, $user->getAuthorisedViewLevels(), $user->get('id', 0), 0); } // - - - - - - - - - - - - - - - - - - - - - - if ($rightDisplayDelete) { if(!$model->publish((int)$post['id'], 0)) { $msg = JText::_('COM_PHOCADOWNLOAD_ERROR_UNPUBLISHING_ITEM'); } else { $msg = JText::_('COM_PHOCADOWNLOAD_SUCCESS_UNPUBLISHING_ITEM'); } } else { $app->redirect($this->loginUrl, $this->loginString); exit; } $lSO = ''; if ($post['limitstart'] != '') { $lSO = '&limitstart='.(int)$post['limitstart']; } $this->setRedirect( JRoute::_($this->url. $lSO, false), $msg ); } function publish() { $app = JFactory::getApplication(); $post['id'] = $app->input->get( 'actionid', '', 'int', 0 ); $post['limitstart'] = $app->input->get( 'limitstart', '', 'int', 0 ); $model = $this->getModel('user'); //$isOwnerCategory = 1;//$model->isOwnerCategoryImage((int)$this->_user->id, (int)$id); // USER RIGHT - Delete - - - - - - - - - - - // 2, 2 means that user access will be ignored in function getUserRight for display Delete button $user = JFactory::getUser(); $rightDisplayDelete = 0; $catAccess = PhocaDownloadAccess::getCategoryAccessByFileId((int)$post['id']); if (!empty($catAccess)) { $rightDisplayDelete = PhocaDownloadAccess::getUserRight('deleteuserid', $catAccess->deleteuserid, 2, $user->getAuthorisedViewLevels(), $user->get('id', 0), 0); } // - - - - - - - - - - - - - - - - - - - - - - if ($rightDisplayDelete) { if(!$model->publish((int)$post['id'], 1)) { $msg = JText::_('COM_PHOCADOWNLOAD_ERROR_PUBLISHING_ITEM'); } else { $msg = JText::_('COM_PHOCADOWNLOAD_SUCCESS_PUBLISHING_ITEM'); } } else { $app->redirect($this->loginUrl, $this->loginString); exit; } $lSO = ''; if ($post['limitstart'] != '') { $lSO = '&limitstart='.(int)$post['limitstart']; } $this->setRedirect( JRoute::_($this->url. $lSO, false), $msg ); } function delete() { $app = JFactory::getApplication(); $post['id'] = $app->input->get( 'actionid', '', 'int', 0 ); $post['limitstart'] = $app->input->get( 'limitstart', '', 'int', 0 ); $model = $this->getModel('user'); //$isOwnerCategory = 1;//$model->isOwnerCategoryImage((int)$this->_user->id, (int)$id); // USER RIGHT - Delete - - - - - - - - - - - // 2, 2 means that user access will be ignored in function getUserRight for display Delete button $user = JFactory::getUser(); $rightDisplayDelete = 0; $catAccess = PhocaDownloadAccess::getCategoryAccessByFileId((int)$post['id']); if (!empty($catAccess)) { $rightDisplayDelete = PhocaDownloadAccess::getUserRight('deleteuserid', $catAccess->deleteuserid, 2, $user->getAuthorisedViewLevels(), $user->get('id', 0), 0); } // - - - - - - - - - - - - - - - - - - - - - - if ($rightDisplayDelete) { if(!$model->delete((int)$post['id'])) { $msg = JText::_('COM_PHOCADOWNLOAD_ERROR_DELETING_ITEM'); } else { $msg = JText::_('COM_PHOCADOWNLOAD_SUCCESS_DELETING_ITEM'); } } else { $app->redirect($this->loginUrl, $this->loginString); exit; } $lSO = ''; if ($post['limitstart'] != '') { $lSO = '&limitstart='.(int)$post['limitstart']; } $this->setRedirect( JRoute::_($this->url. $lSO, false), $msg ); } } ?>