forked from joomla/joomla-cms
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch '4.0-dev' of https://github.com/joomla/joomla-cms into f…
…ix#24235
- Loading branch information
Showing
680 changed files
with
18,217 additions
and
4,750 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 |
---|---|---|
@@ -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). |
8 changes: 4 additions & 4 deletions
8
...ator/components/com_userlogs/userlogs.php → .../components/com_actionlogs/actionlogs.php
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,19 +1,19 @@ | ||
<?php | ||
/** | ||
* @package Joomla.Administrator | ||
* @subpackage com_userlogs | ||
* @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_userlogs')) | ||
if (!JFactory::getUser()->authorise('core.admin')) | ||
{ | ||
throw new JAccessExceptionNotallowed(JText::_('JERROR_ALERTNOAUTHOR'), 403); | ||
} | ||
|
||
$controller = JControllerLegacy::getInstance('Userlogs'); | ||
$controller = JControllerLegacy::getInstance('Actionlogs'); | ||
$controller->execute(JFactory::getApplication()->input->get('task')); | ||
$controller->redirect(); |
16 changes: 8 additions & 8 deletions
16
...ator/components/com_userlogs/userlogs.xml → .../components/com_actionlogs/actionlogs.xml
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,29 +1,29 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<extension version="3.9" type="component" method="upgrade"> | ||
<name>com_userlogs</name> | ||
<name>com_actionlogs</name> | ||
<author>Joomla! Project</author> | ||
<creationDate>May 2018</creationDate> | ||
<copyright>Copyright (C) 2005 - 2018 Open Source Matters. All rights reserved.</copyright> | ||
<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> | ||
<description>COM_USERLOGS_XML_DESCRIPTION</description> | ||
<version>3.9.0</version> | ||
<description>COM_ACTIONLOGS_XML_DESCRIPTION</description> | ||
<administration> | ||
<menu>COM_USERLOGS</menu> | ||
<menu>COM_ACTIONLOGS</menu> | ||
<files folder="admin"> | ||
<file>userlogs.php</file> | ||
<file>actionlogs.php</file> | ||
<file>config.xml</file> | ||
<file>access.xml</file> | ||
<file>controller.php</file> | ||
<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_userlogs.ini</language> | ||
<language tag="en-GB">language/en-GB.com_userlogs.sys.ini</language> | ||
<language tag="en-GB">language/en-GB.com_actionlogs.ini</language> | ||
<language tag="en-GB">language/en-GB.com_actionlogs.sys.ini</language> | ||
</languages> | ||
</administration> | ||
</extension> |
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,35 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<config> | ||
<fieldset name="actionlogs" label="COM_ACTIONLOGS_OPTIONS" addfieldpath="/administrator/components/com_actionlogs/models/fields"> | ||
<field | ||
name="ip_logging" | ||
type="radio" | ||
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" | ||
description="COM_ACTIONLOGS_CSV_DELIMITER_DESC" | ||
default="," | ||
> | ||
<option value=",">COM_ACTIONLOGS_COMMA</option> | ||
<option value=";">COM_ACTIONLOGS_SEMICOLON</option> | ||
</field> | ||
<field | ||
name="loggable_extensions" | ||
type="logtype" | ||
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> | ||
</config> |
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,19 @@ | ||
<?php | ||
/** | ||
* @package Joomla.Administrator | ||
* @subpackage com_actionlogs | ||
* | ||
* @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; | ||
|
||
/** | ||
* Actionlogs Controller | ||
* | ||
* @since 3.9.0 | ||
*/ | ||
class ActionlogsController extends JControllerLegacy | ||
{ | ||
} |
155 changes: 155 additions & 0 deletions
155
administrator/components/com_actionlogs/controllers/actionlogs.php
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,155 @@ | ||
<?php | ||
/** | ||
* @package Joomla.Administrator | ||
* @subpackage com_actionlogs | ||
* | ||
* @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; | ||
|
||
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 3.9.0 | ||
*/ | ||
class ActionlogsControllerActionlogs extends JControllerAdmin | ||
{ | ||
/** | ||
* Constructor. | ||
* | ||
* @param array $config An optional associative array of configuration settings. | ||
* | ||
* @since 3.9.0 | ||
*/ | ||
public function __construct(array $config = array()) | ||
{ | ||
parent::__construct($config); | ||
|
||
$this->registerTask('exportSelectedLogs', 'exportLogs'); | ||
} | ||
|
||
/** | ||
* Method to get a model object, loading it if required. | ||
* | ||
* @param string $name The model name. Optional. | ||
* @param string $prefix The class prefix. Optional. | ||
* @param array $config Configuration array for model. Optional. | ||
* | ||
* @return object The model. | ||
* | ||
* @since 3.9.0 | ||
*/ | ||
public function getModel($name = 'Actionlogs', $prefix = 'ActionlogsModel', $config = array('ignore_request' => true)) | ||
{ | ||
// Return the model | ||
return parent::getModel($name, $prefix, $config); | ||
} | ||
|
||
/** | ||
* Method to export logs | ||
* | ||
* @return void | ||
* | ||
* @since 3.9.0 | ||
*/ | ||
public function exportLogs() | ||
{ | ||
// Check for request forgeries. | ||
$this->checkToken(); | ||
|
||
$task = $this->getTask(); | ||
|
||
$pks = 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 = $model->getLogDataAsIterator($pks); | ||
|
||
if (count($data)) | ||
{ | ||
|
||
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(); | ||
$app->setHeader('Content-Type', 'application/csv', true) | ||
->setHeader('Content-Disposition', 'attachment; filename="' . $filename . '.csv"', true) | ||
->setHeader('Cache-Control', 'must-revalidate', true) | ||
->sendHeaders(); | ||
|
||
$output = fopen("php://output", "w"); | ||
|
||
foreach ($rows as $row) | ||
{ | ||
fputcsv($output, $row, $csvDelimiter); | ||
} | ||
|
||
fclose($output); | ||
|
||
$app->close(); | ||
} | ||
else | ||
{ | ||
$this->setMessage(JText::_('COM_ACTIONLOGS_NO_LOGS_TO_EXPORT')); | ||
$this->setRedirect(JRoute::_('index.php?option=com_actionlogs&view=actionlogs', false)); | ||
} | ||
} | ||
|
||
/** | ||
* Clean out the logs | ||
* | ||
* @return void | ||
* | ||
* @since 3.9.0 | ||
*/ | ||
public function purge() | ||
{ | ||
// Check for request forgeries. | ||
$this->checkToken(); | ||
|
||
$model = $this->getModel(); | ||
|
||
if ($model->purge()) | ||
{ | ||
$message = JText::_('COM_ACTIONLOGS_PURGE_SUCCESS'); | ||
} | ||
else | ||
{ | ||
$message = JText::_('COM_ACTIONLOGS_PURGE_FAIL'); | ||
} | ||
|
||
$this->setRedirect(JRoute::_('index.php?option=com_actionlogs&view=actionlogs', false), $message); | ||
} | ||
} |
Oops, something went wrong.