| Current Path : /home/purehotels/public_html/administrator/components/com_easyfolderlistingpro/controllers/ |
| Current File : /home/purehotels/public_html/administrator/components/com_easyfolderlistingpro/controllers/logs.php |
<?php
/**
* @version 3.2
* @author Michael A. Gilkes (michael@valorapps.com)
* @copyright Michael Albert Gilkes
* @license GNU/GPLv3
Easy Folder Listing Pro Component for Joomla!
Copyright (C) 2012-2016 Michael Albert Gilkes (Valor Apps)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
//No direct access to this file
defined('_JEXEC') or die('Restricted access');
/**
* EasyFolderListingPro Logs Controller
*/
class EasyFolderListingProControllerLogs extends JControllerAdmin
{
public function getModel($name = 'Logs', $prefix = 'EasyFolderListingProModel', $config = array())
{
//set ignore_request to true, since we aren't going to populate the model state
$model = parent::getModel($name, $prefix, array('ignore_request' => true));
return $model;
}
/**
* Method to purge all logs from the database.
*
* @return boolean True on success.
*/
public function purge()
{
JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
// Remove the script time limit.
@set_time_limit(0);
$model = $this->getModel();
// Attempt to purge the log.
$return = $model->purge();
if (!$return)
{
$message = JText::_($model->getError());
$this->setRedirect('index.php?option=com_easyfolderlistingpro&view=logs', $message);
return false;
}
else
{
$message = JText::_('COM_EFLP_LOGS_PURGE_SUCCESS');
$this->setRedirect('index.php?option=com_easyfolderlistingpro&view=logs', $message);
return true;
}
}
}