-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
171 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
<?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 Gallery | ||
* @copyright Copyright (C) Jan Pavelka www.phoca.cz | ||
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL | ||
*/ | ||
|
||
defined('_JEXEC') or die(); | ||
|
||
use Joomla\CMS\MVC\Controller\FormController; | ||
use Joomla\CMS\Factory; | ||
use Joomla\CMS\Router\Route; | ||
use Joomla\CMS\Session\Session; | ||
use Joomla\CMS\Filesystem\File; | ||
use Joomla\CMS\Language\Text; | ||
|
||
jimport('joomla.application.component.controllerform'); | ||
|
||
class PhocaDownloadCpControllerPhocaDownloadManager extends FormController | ||
{ | ||
protected $option = 'com_phocadownload'; | ||
protected $view_list = 'phocadownloadmanager'; | ||
protected $layout = 'edit'; | ||
|
||
function __construct() { | ||
parent::__construct(); | ||
$this->layout = 'edit'; | ||
} | ||
|
||
protected function allowAdd($data = array()) { | ||
$user = Factory::getUser(); | ||
$allow = null; | ||
$allow = $user->authorise('core.create', 'com_phocadownload'); | ||
if ($allow === null) { | ||
return parent::allowAdd($data); | ||
} else { | ||
return $allow; | ||
} | ||
} | ||
|
||
protected function allowEdit($data = array(), $key = 'id') { | ||
$user = Factory::getUser(); | ||
$allow = null; | ||
$allow = $user->authorise('core.edit', 'com_phocadownload'); | ||
if ($allow === null) { | ||
return parent::allowEdit($data, $key); | ||
} else { | ||
return $allow; | ||
} | ||
} | ||
|
||
function edit($key = NULL, $urlVar = NULL) { | ||
$this->setRedirect(Route::_('index.php?option='.$this->option.'&view='.$this->view_list.'&layout='.$this->layout.'&manager=filemultiple', false)); | ||
} | ||
|
||
function cancel($key = NULL) { | ||
$this->setRedirect( 'index.php?option=com_phocadownload&view=phocadownloadfiles' ); | ||
} | ||
|
||
function delete($key = null, $urlVar = null) { | ||
|
||
Session::checkToken() or jexit(Text::_('JINVALID_TOKEN')); | ||
|
||
$cid = Factory::getApplication()->input->get('cid', array(), '', 'array'); | ||
$returnUrl = Factory::getApplication()->input->get( 'return-url', null, 'post', 'base64' );//includes field | ||
|
||
if ($cid[0] != '') { | ||
|
||
$filePath = PhocaDownloadPath::getPathSet('file'); | ||
$fileToRemove = $filePath['orig_abs_ds']. $cid[0]; | ||
|
||
if (File::exists($fileToRemove)) { | ||
|
||
$db = Factory::getDBO(); | ||
|
||
$query = 'SELECT a.filename' | ||
.' FROM #__phocadownload AS a' | ||
.' WHERE a.filename = '.$db->quote($cid[0]) | ||
.' ORDER BY a.id'; | ||
$db->setQuery($query, 0, 1); | ||
$filename = $db->loadObject(); | ||
|
||
if (isset($filename->filename) && $filename->filename != '') { | ||
$this->app->enqueueMessage(Text::_('COM_PHOCADOWNLOAD_WARNING_FILE_EXISTS_IN_SYSTEM'), 'warning'); | ||
$this->setRedirect(Route::_(base64_decode($returnUrl), false)); | ||
return false; | ||
} | ||
|
||
if (File::delete($fileToRemove)) { | ||
|
||
$this->app->enqueueMessage(Text::_('COM_PHOCADOWNLOAD_FILE_SUCCESSFULLY_DELETED'), 'success'); | ||
} else { | ||
$this->app->enqueueMessage(Text::_('COM_PHOCADOWNLOAD_FILE_SUCCESSFULLY_DELETED'), 'error'); | ||
} | ||
|
||
} | ||
|
||
} | ||
|
||
$this->setRedirect(Route::_(base64_decode($returnUrl), false)); | ||
return true; | ||
|
||
} | ||
} | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{"com_phocadownload_v5.0.0Beta.zip":{"key":"com_phocadownload_v5.0.0Beta.zip","extname":"com_phocadownload","version":"5.0.0Beta","checksum":"60224eaec714795c831ccf2145be6272561bf62cb831a5f28ce2b738d894e3d9d24c2e3805e2d769e36d50cdb21ead28572a76f80de58271a2ad31cd9915c43d"},"com_phocadownload_v4.0.7.zip":{"key":"com_phocadownload_v4.0.7.zip","extname":"com_phocadownload","version":"4.0.7","checksum":"85092b0c0de78f23abb348f1083bd6de10e46f0cecfa50aa984fd84a67a9a2255cd6fcc30467b75a3ea545d81959520a9d11d86299c5f0a306ace8821d8c8e50"},"com_phocadownload_v5.0.0Beta2.zip":{"key":"com_phocadownload_v5.0.0Beta2.zip","extname":"com_phocadownload","version":"5.0.0Beta2","checksum":"833044110c7d55ca3fb245611868ba985c5ff4eae8b06355be4aef08072f9a76a3f8ff14af5c7fdbbebcb201dd7ddb48df6b54714f805393ff2bf8b629c560cd"},"com_phocadownload_v4.0.8.zip":{"key":"com_phocadownload_v4.0.8.zip","extname":"com_phocadownload","version":"4.0.8","checksum":"64fef93f6b61078f5c0e6596c02d6f30d0164a9eb849b112663619c53953ccb424977a00bbfb80e1648370e52c39640902f462ce214c24337d1c8a1cd73f8e56"},"com_phocadownload_v5.0.0Beta3.zip":{"key":"com_phocadownload_v5.0.0Beta3.zip","extname":"com_phocadownload","version":"5.0.0Beta3","checksum":"7dc10421dac2b7d282ca7bbca8bf84f6edf8c181969658b854e921205b434bf13c7b100c6b95146107134d2c3c3c7b7699d6514c36122a403e134ce7b8bfe1d9"},"com_phocadownload_v4.0.9.zip":{"key":"com_phocadownload_v4.0.9.zip","extname":"com_phocadownload","version":"4.0.9","checksum":"505a376b9508fcde09202ef2541d3a01da2cc596de9a0464f0acf5f35fe8fa00fc3348ccfffa03f56e5ba17f9bb5c7e91661816d5a1a4fdd58403a8dce4d2d49"},"com_phocadownload_v5.0.0Beta4.zip":{"key":"com_phocadownload_v5.0.0Beta4.zip","extname":"com_phocadownload","version":"5.0.0Beta4","checksum":"47b180bd30190f062658f5db7cabe7e4d6cda9a087ae154c91a109b14c4edfd9699c9dc40265725f0f466cc014e7590625a1f36807faf395befe06e361c3daab"},"com_phocadownload_v5.0.0Beta5.zip":{"key":"com_phocadownload_v5.0.0Beta5.zip","extname":"com_phocadownload","version":"5.0.0Beta5","checksum":"f64596ead1ef5edeca9360fd30d0ad005b008d7c12b059aeeef63e0e85c98303ca37ea090137e17442a4bb426d52c554aac391396ce03607cf027c4d0bf61cd8"},"com_phocadownload_v5.0.0Beta6.zip":{"key":"com_phocadownload_v5.0.0Beta6.zip","extname":"com_phocadownload","version":"5.0.0Beta6","checksum":"613bff446c16ddb3348a087f7ca34dd9f9d6280200b5a6a839f05375d14d115d6ee7b30486bea9d0938d19d6252503cd1767e504f0f4688d24d9114b7675e3b7"},"com_phocadownload_v4.0.10Beta.zip":{"key":"com_phocadownload_v4.0.10Beta.zip","extname":"com_phocadownload","version":"4.0.10Beta","checksum":"1049b5b2b9cd00d5ac5fa9ff1d00380c2fec8abdd33100205023c0c8d05746c157b140351f5f28ca2ad2a58a585a86384335388cea94d09dc58fe9f5aeca3e19"},"com_phocadownload_v5.0.0Beta7.zip":{"key":"com_phocadownload_v5.0.0Beta7.zip","extname":"com_phocadownload","version":"5.0.0Beta7","checksum":"bb7c0a28286b520d3d6896065d64dab11a2fecdd45050b1bb50b6867614bccab08f73cf5dba6c91228b36d0c5abaa11fbe8f23cbebad3c22661e38d00553e40c"},"com_phocadownload_v5.0.0.zip":{"key":"com_phocadownload_v5.0.0.zip","extname":"com_phocadownload","version":"5.0.0","checksum":"7495f79d9bb0711aa03f1f48ad835472451b2829070a94ed0b844df924ca26573c9d8bca34e9cdc9703168ac1f0b93b8a0529f814ecc4f8eb4c1f5de67b4553d"},"com_phocadownload_v5.0.1.zip":{"key":"com_phocadownload_v5.0.1.zip","extname":"com_phocadownload","version":"5.0.1","checksum":"db3921291c66ae5a2969eda7ec5cdb31c4453953928581282614efec15b30b7f55343bbb2163d34778279264e68f31b9946fc300522ca0dec58477ff000dcc7c"},"com_phocadownload_v5.0.2.zip":{"key":"com_phocadownload_v5.0.2.zip","extname":"com_phocadownload","version":"5.0.2","checksum":"ff00e0114a1f2fa83f0f3699bb2e23bee2011d9fb38aa690f20b0d6e07bb0cf7def82e33ea6ac3038bee635befad0cf7cdf80d20d6f2a6de41e20a693869e95a"}} | ||
{"com_phocadownload_v5.0.0Beta.zip":{"key":"com_phocadownload_v5.0.0Beta.zip","extname":"com_phocadownload","version":"5.0.0Beta","checksum":"60224eaec714795c831ccf2145be6272561bf62cb831a5f28ce2b738d894e3d9d24c2e3805e2d769e36d50cdb21ead28572a76f80de58271a2ad31cd9915c43d"},"com_phocadownload_v4.0.7.zip":{"key":"com_phocadownload_v4.0.7.zip","extname":"com_phocadownload","version":"4.0.7","checksum":"85092b0c0de78f23abb348f1083bd6de10e46f0cecfa50aa984fd84a67a9a2255cd6fcc30467b75a3ea545d81959520a9d11d86299c5f0a306ace8821d8c8e50"},"com_phocadownload_v5.0.0Beta2.zip":{"key":"com_phocadownload_v5.0.0Beta2.zip","extname":"com_phocadownload","version":"5.0.0Beta2","checksum":"833044110c7d55ca3fb245611868ba985c5ff4eae8b06355be4aef08072f9a76a3f8ff14af5c7fdbbebcb201dd7ddb48df6b54714f805393ff2bf8b629c560cd"},"com_phocadownload_v4.0.8.zip":{"key":"com_phocadownload_v4.0.8.zip","extname":"com_phocadownload","version":"4.0.8","checksum":"64fef93f6b61078f5c0e6596c02d6f30d0164a9eb849b112663619c53953ccb424977a00bbfb80e1648370e52c39640902f462ce214c24337d1c8a1cd73f8e56"},"com_phocadownload_v5.0.0Beta3.zip":{"key":"com_phocadownload_v5.0.0Beta3.zip","extname":"com_phocadownload","version":"5.0.0Beta3","checksum":"7dc10421dac2b7d282ca7bbca8bf84f6edf8c181969658b854e921205b434bf13c7b100c6b95146107134d2c3c3c7b7699d6514c36122a403e134ce7b8bfe1d9"},"com_phocadownload_v4.0.9.zip":{"key":"com_phocadownload_v4.0.9.zip","extname":"com_phocadownload","version":"4.0.9","checksum":"505a376b9508fcde09202ef2541d3a01da2cc596de9a0464f0acf5f35fe8fa00fc3348ccfffa03f56e5ba17f9bb5c7e91661816d5a1a4fdd58403a8dce4d2d49"},"com_phocadownload_v5.0.0Beta4.zip":{"key":"com_phocadownload_v5.0.0Beta4.zip","extname":"com_phocadownload","version":"5.0.0Beta4","checksum":"47b180bd30190f062658f5db7cabe7e4d6cda9a087ae154c91a109b14c4edfd9699c9dc40265725f0f466cc014e7590625a1f36807faf395befe06e361c3daab"},"com_phocadownload_v5.0.0Beta5.zip":{"key":"com_phocadownload_v5.0.0Beta5.zip","extname":"com_phocadownload","version":"5.0.0Beta5","checksum":"f64596ead1ef5edeca9360fd30d0ad005b008d7c12b059aeeef63e0e85c98303ca37ea090137e17442a4bb426d52c554aac391396ce03607cf027c4d0bf61cd8"},"com_phocadownload_v5.0.0Beta6.zip":{"key":"com_phocadownload_v5.0.0Beta6.zip","extname":"com_phocadownload","version":"5.0.0Beta6","checksum":"613bff446c16ddb3348a087f7ca34dd9f9d6280200b5a6a839f05375d14d115d6ee7b30486bea9d0938d19d6252503cd1767e504f0f4688d24d9114b7675e3b7"},"com_phocadownload_v4.0.10Beta.zip":{"key":"com_phocadownload_v4.0.10Beta.zip","extname":"com_phocadownload","version":"4.0.10Beta","checksum":"1049b5b2b9cd00d5ac5fa9ff1d00380c2fec8abdd33100205023c0c8d05746c157b140351f5f28ca2ad2a58a585a86384335388cea94d09dc58fe9f5aeca3e19"},"com_phocadownload_v5.0.0Beta7.zip":{"key":"com_phocadownload_v5.0.0Beta7.zip","extname":"com_phocadownload","version":"5.0.0Beta7","checksum":"bb7c0a28286b520d3d6896065d64dab11a2fecdd45050b1bb50b6867614bccab08f73cf5dba6c91228b36d0c5abaa11fbe8f23cbebad3c22661e38d00553e40c"},"com_phocadownload_v5.0.0.zip":{"key":"com_phocadownload_v5.0.0.zip","extname":"com_phocadownload","version":"5.0.0","checksum":"7495f79d9bb0711aa03f1f48ad835472451b2829070a94ed0b844df924ca26573c9d8bca34e9cdc9703168ac1f0b93b8a0529f814ecc4f8eb4c1f5de67b4553d"},"com_phocadownload_v5.0.1.zip":{"key":"com_phocadownload_v5.0.1.zip","extname":"com_phocadownload","version":"5.0.1","checksum":"db3921291c66ae5a2969eda7ec5cdb31c4453953928581282614efec15b30b7f55343bbb2163d34778279264e68f31b9946fc300522ca0dec58477ff000dcc7c"},"com_phocadownload_v5.0.2.zip":{"key":"com_phocadownload_v5.0.2.zip","extname":"com_phocadownload","version":"5.0.2","checksum":"ff00e0114a1f2fa83f0f3699bb2e23bee2011d9fb38aa690f20b0d6e07bb0cf7def82e33ea6ac3038bee635befad0cf7cdf80d20d6f2a6de41e20a693869e95a"},"com_phocadownload_v5.0.3.zip":{"key":"com_phocadownload_v5.0.3.zip","extname":"com_phocadownload","version":"5.0.3","checksum":"8d9af7089d335c0caba5c3ff99f146908c893af8d91bdceb5a0f2583bb946cb222e66de89a6cc7bb35ae27adccbfadff180a3bfb7ca11841294fe13901070554"}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.