Skip to content

Commit

Permalink
Merge pull request #24375 from wilsonge/390-merge6
Browse files Browse the repository at this point in the history
Joomla 3.9.0 Part #6
  • Loading branch information
wilsonge committed Mar 28, 2019
2 parents f2454ff + e07e3a5 commit 81ed3dd
Show file tree
Hide file tree
Showing 100 changed files with 2,578 additions and 329 deletions.
10 changes: 0 additions & 10 deletions administrator/components/com_actionlogs/access.xml

This file was deleted.

18 changes: 1 addition & 17 deletions administrator/components/com_actionlogs/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,20 +31,4 @@
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>
12 changes: 0 additions & 12 deletions administrator/components/com_actionlogs/controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,6 @@ class ActionlogsController extends JControllerLegacy
*/
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();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -110,13 +110,6 @@ public function exportLogs()
*/
public function delete()
{
if (!JFactory::getUser()->authorise('core.delete', $this->option))
{
JError::raiseWarning(403, JText::_('JLIB_APPLICATION_ERROR_DELETE_NOT_PERMITTED'));

return;
}

parent::delete();
}

Expand Down
70 changes: 70 additions & 0 deletions administrator/components/com_actionlogs/helpers/actionlogs.php
Original file line number Diff line number Diff line change
Expand Up @@ -189,4 +189,74 @@ public static function getContentTypeLink($component, $contentType, $id, $urlVar
// Return default link to avoid having to implement getContentTypeLink in most of our components
return 'index.php?option=' . $component . '&task=' . $contentType . '.edit&' . $urlVar . '=' . $id;
}

/**
* Load both enabled and disabled actionlog plugins language file. It is used to make sure actions log is
* displayed properly instead of only language items displayed when a plugin is disabled
*
* @return void
*
* @since __DEPLOY_VERSION__
*/
public static function loadActionLogPluginsLanguage()
{
$lang = JFactory::getLanguage();
$db = JFactory::getDbo();

// Get all (both enabled and disabled) actionlog plugins
$query = $db->getQuery(true)
->select(
$db->quoteName(
array(
'folder',
'element',
'params',
'extension_id'
),
array(
'type',
'name',
'params',
'id'
)
)
)
->from('#__extensions')
->where('type = ' . $db->quote('plugin'))
->where('folder = ' . $db->quote('actionlog'))
->where('state IN (0,1)')
->order('ordering');
$db->setQuery($query);

try
{
$rows = $db->loadObjectList();
}
catch (RuntimeException $e)
{
$rows = array();
}

if (empty($rows))
{
return;
}

foreach ($rows as $row)
{
$name = $row->name;
$type = $row->type;
$extension = 'Plg_' . $type . '_' . $name;
$extension = strtolower($extension);

// If language already loaded, don't load it again.
if ($lang->getPaths($extension))
{
continue;
}

$lang->load($extension, JPATH_ADMINISTRATOR, null, false, true)
|| $lang->load($extension, JPATH_PLUGINS . '/' . $type . '/' . $name, null, false, true);
}
}
}
30 changes: 15 additions & 15 deletions administrator/components/com_actionlogs/layouts/logstable.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
JFactory::getLanguage()->load("com_actionlogs", JPATH_ADMINISTRATOR, null, false, true);

$messages = $displayData['messages'];
$showIpColumn = $displayData['showIpColumn'];
?>
<h1>
<?php echo JText::_('COM_ACTIONLOGS_EMAIL_SUBJECT'); ?>
Expand All @@ -25,22 +26,21 @@
<th><?php echo JText::_('COM_ACTIONLOGS_DATE'); ?></th>
<th><?php echo JText::_('COM_ACTIONLOGS_EXTENSION'); ?></th>
<th><?php echo JText::_('COM_ACTIONLOGS_NAME'); ?></th>
<th><?php echo JText::_('COM_ACTIONLOGS_IP_ADDRESS'); ?></th>
<?php if ($showIpColumn) : ?>
<th><?php echo JText::_('COM_ACTIONLOGS_IP_ADDRESS'); ?></th>
<?php endif; ?>
</thead>
<tbody>
<?php
foreach ($messages as $message)
{
?>
<tr>
<td><?php echo $message->message; ?></td>
<td><?php echo $message->log_date; ?></td>
<td><?php echo $message->extension; ?></td>
<td><?php echo $displayData['username']; ?></td>
<td><?php echo $message->ip_address; ?></td>
</tr>
<?php
}
?>
<?php foreach ($messages as $message) : ?>
<tr>
<td><?php echo $message->message; ?></td>
<td><?php echo $message->log_date; ?></td>
<td><?php echo $message->extension; ?></td>
<td><?php echo $displayData['username']; ?></td>
<?php if ($showIpColumn) : ?>
<td><?php echo JText::_($message->ip_address); ?></td>
<?php endif; ?>
</tr>
<?php endforeach; ?>
</tbody>
</table>
11 changes: 7 additions & 4 deletions administrator/components/com_actionlogs/models/actionlog.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,10 @@ public function addLogsToDb($messages, $messageLanguageKey, $context, $userId =
*/
protected function sendNotificationEmails($messages, $username, $context)
{
$db = $this->getDbo();
$query = $db->getQuery(true);
$db = $this->getDbo();
$query = $db->getQuery(true);
$params = ComponentHelper::getParams('com_actionlogs');
$showIpColumn = (bool) $params->get('ip_logging', 0);

$query->select($db->quoteName(array('email', 'params')))
->from($db->quoteName('#__users'))
Expand Down Expand Up @@ -138,8 +140,9 @@ protected function sendNotificationEmails($messages, $username, $context)
}

$displayData = array(
'messages' => $messages,
'username' => $username,
'messages' => $messages,
'username' => $username,
'showIpColumn' => $showIpColumn,
);

$body = $layout->render($displayData);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
<th>
<?php echo JHtml::_('searchtools.sort', 'COM_ACTIONLOGS_NAME', 'a.user_id', $listDirn, $listOrder); ?>
</th>
<?php if ($this->ip) : ?>
<?php if ($this->showIpColumn) : ?>
<th>
<?php echo JHtml::_('searchtools.sort', 'COM_ACTIONLOGS_IP_ADDRESS', 'a.ip_address', $listDirn, $listOrder); ?>
</th>
Expand Down Expand Up @@ -96,7 +96,7 @@
<td>
<?php echo $item->name; ?>
</td>
<?php if ($this->ip) : ?>
<?php if ($this->showIpColumn) : ?>
<td>
<?php echo JText::_($this->escape($item->ip_address)); ?>
</td>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

defined('_JEXEC') or die;

use Joomla\CMS\Component\ComponentHelper;
use Joomla\Registry\Registry;
use Joomla\CMS\Plugin\PluginHelper;

Expand Down Expand Up @@ -66,17 +67,14 @@ class ActionlogsViewActionlogs extends JViewLegacy
*/
public function display($tpl = null)
{
if (PluginHelper::isEnabled('system', 'actionlogs'))
{
$params = new Registry(PluginHelper::getPlugin('system', 'actionlogs')->params);
$this->ip = (bool) $params->get('ip_logging', 0);
}
$params = ComponentHelper::getParams('com_actionlogs');

$this->items = $this->get('Items');
$this->state = $this->get('State');
$this->filterForm = $this->get('FilterForm');
$this->activeFilters = $this->get('ActiveFilters');
$this->pagination = $this->get('Pagination');
$this->showIpColumn = (bool) $params->get('ip_logging', 0);

if (count($errors = $this->get('Errors')))
{
Expand All @@ -87,6 +85,9 @@ public function display($tpl = null)

$this->addToolBar();

// Load all actionlog plugins language files
ActionlogsHelper::loadActionLogPluginsLanguage();

parent::display($tpl);
}

Expand All @@ -101,18 +102,11 @@ protected function addToolbar()
{
JToolbarHelper::title(JText::_('COM_ACTIONLOGS_MANAGER_USERLOGS'));

if (JFactory::getUser()->authorise('core.delete', 'com_actionlogs'))
{
JToolbarHelper::deleteList('JGLOBAL_CONFIRM_DELETE', 'actionlogs.delete');
$bar = JToolbar::getInstance('toolbar');
$bar->appendButton('Confirm', 'COM_ACTIONLOGS_PURGE_CONFIRM', 'delete', 'COM_ACTIONLOGS_TOOLBAR_PURGE', 'actionlogs.purge', false);
}

if (JFactory::getUser()->authorise('core.admin', 'com_actionlogs') || JFactory::getUser()->authorise('core.options', 'com_actionlogs'))
{
JToolbarHelper::preferences('com_actionlogs');
}

JToolbarHelper::deleteList('JGLOBAL_CONFIRM_DELETE', 'actionlogs.delete');
$bar = JToolbar::getInstance('toolbar');
$bar->appendButton('Confirm', 'COM_ACTIONLOGS_PURGE_CONFIRM', 'delete', 'COM_ACTIONLOGS_TOOLBAR_PURGE', 'actionlogs.purge', false);
JToolbarHelper::preferences('com_actionlogs');
JToolbarHelper::help('JHELP_COMPONENTS_ACTIONLOGS');
JToolBarHelper::custom('actionlogs.exportSelectedLogs', 'download', '', 'COM_ACTIONLOGS_EXPORT_CSV', true);
JToolBarHelper::custom('actionlogs.exportLogs', 'download', '', 'COM_ACTIONLOGS_EXPORT_ALL_CSV', false);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ CREATE TABLE IF NOT EXISTS `#__privacy_consents` (
`created` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`subject` varchar(25) NOT NULL DEFAULT '',
`body` text NOT NULL,
`remind` tinyint(4) NOT NULL DEFAULT '0',
`token` varchar(100) NOT NULL DEFAULT '',
PRIMARY KEY (`id`),
KEY `idx_user_id` (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci;
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci;
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
INSERT INTO `#__extensions` (`extension_id`, `package_id`, `name`, `type`, `element`, `folder`, `client_id`, `enabled`, `access`, `protected`, `manifest_cache`, `params`, `custom_data`, `system_data`, `checked_out`, `checked_out_time`, `ordering`, `state`) VALUES
(488, 0, 'plg_quickicon_privacycheck', 'plugin', 'privacycheck', 'quickicon', 0, 1, 1, 0, '', '', '', '', 0, '0000-00-00 00:00:00', 0, 0);
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
INSERT INTO `#__extensions` (`extension_id`, `package_id`, `name`, `type`, `element`, `folder`, `client_id`, `enabled`, `access`, `protected`, `manifest_cache`, `params`, `custom_data`, `system_data`, `checked_out`, `checked_out_time`, `ordering`, `state`) VALUES
(489, 0, 'plg_user_terms', 'plugin', 'terms', 'user', 0, 1, 1, 0, '', '', '', '', 0, '0000-00-00 00:00:00', 0, 0),
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
INSERT INTO "#__extensions" ("extension_id", "package_id", "name", "type", "element", "folder", "client_id", "enabled", "access", "protected", "manifest_cache", "params", "custom_data", "system_data", "checked_out", "checked_out_time", "ordering", "state") VALUES
(481, 0, 'plg_content_confirmconsent', 'plugin', 'confirmconsent', 'content', 0, 0, 1, 0, '', '', '', '', 0, '1970-01-01 00:00:00', 0, 0);
(482, 0, 'plg_content_confirmconsent', 'plugin', 'confirmconsent', 'content', 0, 0, 1, 0, '', '', '', '', 0, '1970-01-01 00:00:00', 0, 0);
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
INSERT INTO "#__extensions" ("extension_id", "package_id", "name", "type", "element", "folder", "client_id", "enabled", "access", "protected", "manifest_cache", "params", "custom_data", "system_data", "checked_out", "checked_out_time", "ordering", "state") VALUES
(482, 0, 'plg_fields_repeatable', 'plugin', 'repeatable', 'fields', 0, 1, 1, 0, '', '', '', '', 0, '1970-01-01 00:00:00', 0, 0);
(481, 0, 'plg_fields_repeatable', 'plugin', 'repeatable', 'fields', 0, 1, 1, 0, '', '', '', '', 0, '1970-01-01 00:00:00', 0, 0);
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ CREATE TABLE "#__privacy_consents" (
"created" timestamp without time zone DEFAULT '1970-01-01 00:00:00' NOT NULL,
"subjext" varchar(255) DEFAULT '' NOT NULL,
"body" text NOT NULL,
"remind" smallint DEFAULT 0 NOT NULL,
"token" varchar(100) DEFAULT '' NOT NULL,
PRIMARY KEY ("id")
);
CREATE INDEX "#__privacy_consents_idx_user_id" ON "#__privacy_consents" ("user_id");
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
INSERT INTO "#__extensions" ("extension_id", "package_id", "name", "type", "element", "folder", "client_id", "enabled", "access", "protected", "manifest_cache", "params", "custom_data", "system_data", "checked_out", "checked_out_time", "ordering", "state")
VALUES
(320, 0, 'mod_privacy_dashboard', 'module', 'mod_privacy_dashboard', '', 1, 0, 1, 0, '', '{}', '', '', 0, '1900-01-01 00:00:00', 0, 0);
INSERT INTO "#__extensions" ("extension_id", "package_id", "name", "type", "element", "folder", "client_id", "enabled", "access", "protected", "manifest_cache", "params", "custom_data", "system_data", "checked_out", "checked_out_time", "ordering", "state") VALUES
(488, 0, 'plg_quickicon_privacycheck', 'plugin', 'privacycheck', 'quickicon', 0, 1, 1, 0, '', '', '', '', 0, '1970-01-01 00:00:00', 0, 0);
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
INSERT INTO `#__extensions` (`extension_id`, `package_id`, `name`, `type`, `element`, `folder`, `client_id`, `enabled`, `access`, `protected`, `manifest_cache`, `params`, `custom_data`, `system_data`, `checked_out`, `checked_out_time`, `ordering`, `state`) VALUES
(489, 0, 'plg_user_terms', 'plugin', 'terms', 'user', 0, 1, 1, 0, '', '', '', '', 0, '1970-01-01 00:00:00', 0, 0),

This file was deleted.

23 changes: 0 additions & 23 deletions administrator/components/com_installer/Model/InstallModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -183,29 +183,6 @@ public function install()
}
}

// Check the package
$children = $installer->manifest->updateservers->children();

foreach ($children as $child)
{
$check = InstallerHelper::isChecksumValid($package['packagefile'], (string) $child);

switch ($check)
{
case 0:
$app->enqueueMessage(Text::_('COM_INSTALLER_INSTALL_CHECKSUM_WRONG'), 'warning');
break;

case 1:
$app->enqueueMessage(Text::_('COM_INSTALLER_INSTALL_CHECKSUM_CORRECT'), 'message');
break;

case 2:
$app->enqueueMessage(Text::_('COM_INSTALLER_INSTALL_CHECKSUM_NOT_FOUND'), 'notice');
break;
}
}

// Was the package unpacked?
if (!$package || !$package['type'])
{
Expand Down

0 comments on commit 81ed3dd

Please sign in to comment.