Skip to content

Commit

Permalink
Merge branch '4.0-dev' into fix#24235
Browse files Browse the repository at this point in the history
  • Loading branch information
bahl24 committed Apr 14, 2019
2 parents 221c79c + 34def69 commit ac40255
Show file tree
Hide file tree
Showing 609 changed files with 10,598 additions and 3,401 deletions.
3 changes: 1 addition & 2 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ There are other branches available which serve specific purposes.

| Branch | Purpose |
| ------ | ------- |
| staging | Current codebase. Branch for the next minor Joomla version. New backward compatible features go into this branch. |
| 3.9-dev | Branch for the next minor Joomla version. The 3.9.0 release will include the Privacy Tools Suite features. Commits to staging will be applied to this branch as well. |
| staging | Current codebase. Branch for the next minor Joomla version. New backward compatible features go into this branch. The 3.9.0 release will include the Privacy Tools Suite features. |
| 3.10-dev | Branch for the next minor Joomla version. The 3.10.0 release will only include compatibility features for 4.0. Commits to staging will be applied to this branch as well. |
| 4.0-dev | Branch for the next major Joomla version. New features go into this branch. Commits to staging will be applied to this branch as well. |
10 changes: 5 additions & 5 deletions .github/SUPPORT.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Where can you get support and help?
====================
* [The Joomla! Documentation](https://docs.joomla.org/Special:MyLanguage/Main_Page);
* [Frequently Asked Questions](https://docs.joomla.org/Special:MyLanguage/Category:FAQ) (FAQ);
* Find the [information you need](https://docs.joomla.org/Special:MyLanguage/Start_here);
* Find [help and other users](https://www.joomla.org/about-joomla/create-and-share.html);
* Post questions at [our forums](https://forum.joomla.org);
* [The Joomla! Documentation](https://docs.joomla.org/Special:MyLanguage/Main_Page).
* [Frequently Asked Questions](https://docs.joomla.org/Special:MyLanguage/Category:FAQ) (FAQ).
* Find the [information you need](https://docs.joomla.org/Special:MyLanguage/Start_here).
* Find [help and other users](https://www.joomla.org/about-joomla/create-and-share.html).
* Post questions at [our forums](https://forum.joomla.org).
* [Joomla Resources Directory](https://resources.joomla.org) (JRD).
10 changes: 0 additions & 10 deletions administrator/components/com_actionlogs/access.xml

This file was deleted.

6 changes: 3 additions & 3 deletions administrator/components/com_actionlogs/actionlogs.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@
* @package Joomla.Administrator
* @subpackage com_actionlogs
*
* @copyright Copyright (C) 2005 - 2016 Open Source Matters, Inc. All rights reserved.
* @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/

defined('_JEXEC') or die;

if (!JFactory::getUser()->authorise('core.manage', 'com_actionlogs'))
if (!JFactory::getUser()->authorise('core.admin'))
{
throw new JAccessExceptionNotallowed(JText::_('JERROR_ALERTNOAUTHOR'), 403);
}

$controller = JControllerLegacy::getInstance('Actionlogs');
$controller->execute(JFactory::getApplication()->input->get('task'));
$controller->redirect();
$controller->redirect();
4 changes: 2 additions & 2 deletions administrator/components/com_actionlogs/actionlogs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<license>GNU General Public License version 2 or later; see LICENSE.txt</license>
<authorEmail>admin@joomla.org</authorEmail>
<authorUrl>www.joomla.org</authorUrl>
<version>__DEPLOY_VERSION__</version>
<version>3.9.0</version>
<description>COM_ACTIONLOGS_XML_DESCRIPTION</description>
<administration>
<menu>COM_ACTIONLOGS</menu>
Expand All @@ -19,7 +19,7 @@
<folder>controllers</folder>
<folder>helpers</folder>
<folder>models</folder>
<folder>views</folder>
<folder>views</folder>
</files>
<languages folder="admin">
<language tag="en-GB">language/en-GB.com_actionlogs.ini</language>
Expand Down
25 changes: 5 additions & 20 deletions administrator/components/com_actionlogs/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,19 @@
<field
name="ip_logging"
type="radio"
label="COM_ACTIONLOGS_IP_LOGGING"
label="COM_ACTIONLOGS_IP_LOGGING_LABEL"
description="COM_ACTIONLOGS_IP_LOGGING_DESC"
class="btn-group btn-group-yesno"
default="0"
filter="integer"
>
<option value="1">JYES</option>
<option value="0">JNO</option>
</field>
<field
name="csv_delimiter"
type="list"
label="COM_ACTIONLOGS_CSV_DELIMITER"
label="COM_ACTIONLOGS_CSV_DELIMITER_LABEL"
description="COM_ACTIONLOGS_CSV_DELIMITER_DESC"
default=","
>
Expand All @@ -25,26 +26,10 @@
<field
name="loggable_extensions"
type="logtype"
label="COM_ACTIONLOGS_LOG_EXTENSIONS"
label="COM_ACTIONLOGS_LOG_EXTENSIONS_LABEL"
description="COM_ACTIONLOGS_LOG_EXTENSIONS_DESC"
multiple="true"
default="com_banners,com_cache,com_categories,com_config,com_contact,com_content,com_installer,com_media,com_menus,com_messages,com_modules,com_newsfeeds,com_plugins,com_redirect,com_tags,com_templates,com_users"
/>
</fieldset>
<fieldset
name="permissions"
label="JCONFIG_PERMISSIONS_LABEL"
description="JCONFIG_PERMISSIONS_DESC"
>
<field
name="rules"
type="rules"
label="JCONFIG_PERMISSIONS_LABEL"
class="inputbox"
validate="rules"
filter="rules"
component="com_actionlogs"
section="component"
/>
</fieldset>
</config>
</config>
28 changes: 1 addition & 27 deletions administrator/components/com_actionlogs/controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,34 +12,8 @@
/**
* Actionlogs Controller
*
* @since __DEPLOY_VERSION__
* @since 3.9.0
*/
class ActionlogsController extends JControllerLegacy
{
/**
* Method to display a view.
*
* @param boolean $cachable If true, the view output will be cached
* @param array $urlparams An array of safe URL parameters and their variable types, for valid values see {@link JFilterInput::clean()}.
*
* @return ActionlogsController This object to support chaining.
*
* @since __DEPLOY_VERSION__
*/
public function display($cachable = false, $urlparams = array())
{
$view = $this->input->get('view', 'actionlogs');

switch ($view)
{
case 'actionlogs':
if (!JFactory::getUser()->authorise('core.viewlogs', 'com_actionlogs'))
{
throw new JAccessExceptionNotallowed(JText::_('JERROR_ALERTNOAUTHOR'), 403);
}
break;
}

return parent::display();
}
}
80 changes: 45 additions & 35 deletions administrator/components/com_actionlogs/controllers/actionlogs.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,21 @@
* @package Joomla.Administrator
* @subpackage com_actionlogs
*
* @copyright Copyright (C) 2005 - 2016 Open Source Matters, Inc. All rights reserved.
* @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/

defined('_JEXEC') or die;
JLoader::register('ActionlogsHelper', JPATH_COMPONENT . '/helpers/actionlogs.php');

use Joomla\CMS\Component\ComponentHelper;
use Joomla\Utilities\ArrayHelper;

JLoader::register('ActionlogsHelper', JPATH_ADMINISTRATOR . '/components/com_actionlogs/helpers/actionlogs.php');

/**
* Actionlogs list controller class.
*
* @since __DEPLOY_VERSION__
* @since 3.9.0
*/
class ActionlogsControllerActionlogs extends JControllerAdmin
{
Expand All @@ -25,7 +26,7 @@ class ActionlogsControllerActionlogs extends JControllerAdmin
*
* @param array $config An optional associative array of configuration settings.
*
* @since __DEPLOY_VERSION__
* @since 3.9.0
*/
public function __construct(array $config = array())
{
Expand All @@ -43,12 +44,10 @@ public function __construct(array $config = array())
*
* @return object The model.
*
* @since __DEPLOY_VERSION__
* @since 3.9.0
*/
public function getModel($name = 'Actionlogs', $prefix = 'ActionlogsModel',
$config = array('ignore_request' => true))
public function getModel($name = 'Actionlogs', $prefix = 'ActionlogsModel', $config = array('ignore_request' => true))
{

// Return the model
return parent::getModel($name, $prefix, $config);
}
Expand All @@ -58,23 +57,50 @@ public function getModel($name = 'Actionlogs', $prefix = 'ActionlogsModel',
*
* @return void
*
* @since __DEPLOY_VERSION__
* @since 3.9.0
*/
public function exportLogs()
{
// Check for request forgeries.
JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
$this->checkToken();

$task = $this->getTask();

$pks = array();

// Get selected logs
$pks = ArrayHelper::toInteger($this->input->post->get('cid', array(), 'array'));
if ($task == 'exportSelectedLogs')
{
// Get selected logs
$pks = ArrayHelper::toInteger(explode(',', $this->input->post->getString('cids')));
}

/** @var ActionlogsModelActionlogs $model */
$model = $this->getModel();

// Get the logs data
$data = $this->getModel()->getLogsData($pks);
$data = $model->getLogDataAsIterator($pks);

if (count($data))
{
$rows = ActionlogsHelper::getCsvData($data);
$filename = "logs_" . JFactory::getDate();

try
{
$rows = ActionlogsHelper::getCsvData($data);
}
catch (InvalidArgumentException $exception)
{
$this->setMessage(JText::_('COM_ACTIONLOGS_ERROR_COULD_NOT_EXPORT_DATA'), 'error');
$this->setRedirect(JRoute::_('index.php?option=com_actionlogs&view=actionlogs', false));

return;
}

// Destroy the iterator now
unset($data);

$date = new JDate('now', new DateTimeZone('UTC'));
$filename = 'logs_' . $date->format('Y-m-d_His_T');

$csvDelimiter = ComponentHelper::getComponent('com_actionlogs')->getParams()->get('csv_delimiter', ',');

$app = JFactory::getApplication();
Expand All @@ -101,34 +127,18 @@ public function exportLogs()
}
}

/**
* Method to delete logs
*
* @return void
*
* @since __DEPLOY_VERSION__
*/
public function delete()
{
if (!JFactory::getUser()->authorise('core.delete', $this->option))
{
JError::raiseWarning(403, JText::_('JLIB_APPLICATION_ERROR_DELETE_NOT_PERMITTED'));

return;
}

parent::delete();
}

/**
* Clean out the logs
*
* @return void
*
* @since __DEPLOY_VERSION__
* @since 3.9.0
*/
public function purge()
{
// Check for request forgeries.
$this->checkToken();

$model = $this->getModel();

if ($model->purge())
Expand Down

0 comments on commit ac40255

Please sign in to comment.