Skip to content

Commit

Permalink
Merge branch 'self-signed-cert' of github.com:rickyosser/joomla-cms i…
Browse files Browse the repository at this point in the history
…nto self-signed-cert
  • Loading branch information
ricky committed Mar 8, 2019
2 parents 4754bc0 + 920712e commit 64cf8b3
Show file tree
Hide file tree
Showing 13 changed files with 202 additions and 46 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ public function exportLogs()
}

fclose($output);

$app->triggerEvent('onAfterLogExport', array());
$app->close();
}
else
Expand Down
12 changes: 8 additions & 4 deletions administrator/components/com_actionlogs/models/actionlogs.php
Original file line number Diff line number Diff line change
Expand Up @@ -330,15 +330,17 @@ public function delete(&$pks)
try
{
$db->execute();

return true;
}
catch (RuntimeException $e)
{
$this->setError($e->getMessage());

return false;
}

Factory::getApplication()->triggerEvent('onAfterLogPurge', array());

return true;
}

/**
Expand All @@ -353,13 +355,15 @@ public function purge()
try
{
$this->getDbo()->truncateTable('#__action_logs');

return true;
}
catch (Exception $e)
{
return false;
}

Factory::getApplication()->triggerEvent('onAfterLogPurge', array());

return true;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ CREATE TABLE IF NOT EXISTS `#__privacy_requests` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`email` varchar(100) NOT NULL DEFAULT '',
`requested_at` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`status` tinyint(4) NOT NULL DEFAULT '0',
`status` tinyint(4) NOT NULL DEFAULT 0,
`request_type` varchar(25) NOT NULL DEFAULT '',
`confirm_token` varchar(100) NOT NULL DEFAULT '',
`confirm_token_created_at` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`checked_out` int(11) NOT NULL DEFAULT '0',
`checked_out` int(11) NOT NULL DEFAULT 0,
`checked_out_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
PRIMARY KEY (`id`),
KEY `idx_checkout` (`checked_out`)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ INSERT INTO `#__extensions` (`extension_id`, `package_id`, `name`, `type`, `elem

CREATE TABLE IF NOT EXISTS `#__privacy_consents` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`user_id` int(10) unsigned NOT NULL DEFAULT '0',
`user_id` int(10) unsigned NOT NULL DEFAULT 0,
`created` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`subject` varchar(255) NOT NULL DEFAULT '',
`body` text NOT NULL,
`remind` tinyint(4) NOT NULL DEFAULT '0',
`remind` tinyint(4) NOT NULL DEFAULT 0,
`token` varchar(100) NOT NULL DEFAULT '',
PRIMARY KEY (`id`),
KEY `idx_user_id` (`user_id`)
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ALTER TABLE `#__privacy_consents` ADD COLUMN `state` INT(10) NOT NULL DEFAULT '1' AFTER `user_id`;
ALTER TABLE `#__privacy_consents` ADD COLUMN `state` INT(10) NOT NULL DEFAULT 1 AFTER `user_id`;
1 change: 1 addition & 0 deletions administrator/components/com_cache/controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ public function deleteAll()
$app->enqueueMessage(JText::_('COM_CACHE_MSG_SOME_CACHE_GROUPS_CLEARED'), 'warning');
}

$app->triggerEvent('onAfterPurge', array());
$this->setRedirect('index.php?option=com_cache&view=cache');
}

Expand Down
13 changes: 11 additions & 2 deletions administrator/components/com_cache/models/cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

defined('_JEXEC') or die;

use Joomla\CMS\Factory;
use Joomla\Utilities\ArrayHelper;

/**
Expand Down Expand Up @@ -251,7 +252,7 @@ public function clean($group = '')
{
try
{
return $this->getCache()->clean($group);
$this->getCache()->clean($group);
}
catch (JCacheExceptionConnecting $exception)
{
Expand All @@ -261,6 +262,10 @@ public function clean($group = '')
{
return false;
}

Factory::getApplication()->triggerEvent('onAfterPurge', array($group));

return true;
}

/**
Expand Down Expand Up @@ -294,7 +299,7 @@ public function purge()
{
try
{
return JFactory::getCache('')->gc();
JFactory::getCache('')->gc();
}
catch (JCacheExceptionConnecting $exception)
{
Expand All @@ -304,5 +309,9 @@ public function purge()
{
return false;
}

Factory::getApplication()->triggerEvent('onAfterPurge', array());

return true;
}
}
52 changes: 45 additions & 7 deletions administrator/components/com_users/models/fields/groupparent.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,12 @@

defined('JPATH_BASE') or die;

JFormHelper::loadFieldClass('list');
use Joomla\CMS\Access\Access;
use Joomla\CMS\Factory;
use Joomla\CMS\Form\FormHelper;
use Joomla\CMS\Helper\UserGroupsHelper;

FormHelper::loadFieldClass('list');

/**
* User Group Parent field..
Expand All @@ -26,6 +31,31 @@ class JFormFieldGroupParent extends JFormFieldList
*/
protected $type = 'GroupParent';

/**
* Method to clean the Usergroup Options from all children starting by a given father
*
* @param array $userGroupsOptions The usergroup options to clean
* @param integer $fatherId The father ID to start with
*
* @return array The cleaned field options
*
* @since __DEPLOY_VERSION__
*/
private function cleanOptionsChildrenByFather($userGroupsOptions, $fatherId)
{
foreach ($userGroupsOptions as $userGroupsOptionsId => $userGroupsOptionsData)
{
if ((int) $userGroupsOptionsData->parent_id === (int) $fatherId)
{
unset($userGroupsOptions[$userGroupsOptionsId]);

$userGroupsOptions = $this->cleanOptionsChildrenByFather($userGroupsOptions, $userGroupsOptionsId);
}
}

return $userGroupsOptions;
}

/**
* Method to get the field options.
*
Expand All @@ -35,22 +65,30 @@ class JFormFieldGroupParent extends JFormFieldList
*/
protected function getOptions()
{
$options = JHelperUsergroups::getInstance()->getAll();
$options = UserGroupsHelper::getInstance()->getAll();
$currentGroupId = $this->form->getValue('id');

// Prevent to set yourself as parent
if ($currentGroupId)
{
unset($options[$currentGroupId]);
}

// Prevent parenting to children of this item.
if ($id = $this->form->getValue('id'))
// We should not remove any groups when we are creating a new group
if (!is_null($currentGroupId))
{
unset($options[$id]);
// Prevent parenting direct children and children of children of this item.
$options = $this->cleanOptionsChildrenByFather($options, $currentGroupId);
}

$options = array_values($options);
$isSuperAdmin = JFactory::getUser()->authorise('core.admin');
$isSuperAdmin = Factory::getUser()->authorise('core.admin');

// Pad the option text with spaces using depth level as a multiplier.
for ($i = 0, $n = count($options); $i < $n; $i++)
{
// Show groups only if user is super admin or group is not super admin
if ($isSuperAdmin || !JAccess::checkGroup($options[$i]->id, 'core.admin'))
if ($isSuperAdmin || !Access::checkGroup($options[$i]->id, 'core.admin'))
{
$options[$i]->value = $options[$i]->id;
$options[$i]->text = str_repeat('- ', $options[$i]->level) . $options[$i]->title;
Expand Down
3 changes: 3 additions & 0 deletions administrator/language/en-GB/en-GB.plg_actionlog_joomla.ini
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ PLG_ACTIONLOG_JOOMLA_TYPE_TEMPLATE="template"
PLG_ACTIONLOG_JOOMLA_TYPE_USER="user"
PLG_ACTIONLOG_JOOMLA_TYPE_USER_GROUP="user group"
PLG_ACTIONLOG_JOOMLA_TYPE_USER_NOTE="user note"
PLG_ACTIONLOG_JOOMLA_USER_CACHE="User <a href='{accountlink}'>{username}</a> deleted cache group {group}"
PLG_ACTIONLOG_JOOMLA_USER_CHECKIN="User <a href='{accountlink}'>{username}</a> performed a check in to table {table}"
PLG_ACTIONLOG_JOOMLA_USER_LOG="User <a href='{accountlink}'>{username}</a> purged one or more rows from the action log"
PLG_ACTIONLOG_JOOMLA_USER_LOGEXPORT="User <a href='{accountlink}'>{username}</a> exported one or more rows from the action log"
PLG_ACTIONLOG_JOOMLA_USER_LOGGED_IN="User <a href='{accountlink}'>{username}</a> logged in to {app}"
PLG_ACTIONLOG_JOOMLA_USER_LOGGED_OUT="User <a href='{accountlink}'>{username}</a> logged out from {app}"
PLG_ACTIONLOG_JOOMLA_USER_LOGIN_FAILED="User <a href='{accountlink}'>{username}</a> tried to login to {app}"
Expand Down
38 changes: 19 additions & 19 deletions installation/sql/mysql/joomla.sql
Original file line number Diff line number Diff line change
Expand Up @@ -695,19 +695,19 @@ CREATE TABLE IF NOT EXISTS `#__fields` (
`type` varchar(255) NOT NULL DEFAULT 'text',
`note` varchar(255) NOT NULL DEFAULT '',
`description` text NOT NULL,
`state` tinyint(1) NOT NULL DEFAULT '0',
`required` tinyint(1) NOT NULL DEFAULT '0',
`checked_out` int(11) NOT NULL DEFAULT '0',
`state` tinyint(1) NOT NULL DEFAULT 0,
`required` tinyint(1) NOT NULL DEFAULT 0,
`checked_out` int(11) NOT NULL DEFAULT 0,
`checked_out_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`ordering` int(11) NOT NULL DEFAULT '0',
`ordering` int(11) NOT NULL DEFAULT 0,
`params` text NOT NULL,
`fieldparams` text NOT NULL,
`language` char(7) NOT NULL DEFAULT '',
`created_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`created_user_id` int(10) unsigned NOT NULL DEFAULT '0',
`created_user_id` int(10) unsigned NOT NULL DEFAULT 0,
`modified_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`modified_by` int(10) unsigned NOT NULL DEFAULT '0',
`access` int(11) NOT NULL DEFAULT '1',
`modified_by` int(10) unsigned NOT NULL DEFAULT 0,
`access` int(11) NOT NULL DEFAULT 1,
PRIMARY KEY (`id`),
KEY `idx_checkout` (`checked_out`),
KEY `idx_state` (`state`),
Expand Down Expand Up @@ -742,17 +742,17 @@ CREATE TABLE IF NOT EXISTS `#__fields_groups` (
`title` varchar(255) NOT NULL DEFAULT '',
`note` varchar(255) NOT NULL DEFAULT '',
`description` text NOT NULL,
`state` tinyint(1) NOT NULL DEFAULT '0',
`checked_out` int(11) NOT NULL DEFAULT '0',
`state` tinyint(1) NOT NULL DEFAULT 0,
`checked_out` int(11) NOT NULL DEFAULT 0,
`checked_out_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`ordering` int(11) NOT NULL DEFAULT '0',
`ordering` int(11) NOT NULL DEFAULT 0,
`params` text NOT NULL,
`language` char(7) NOT NULL DEFAULT '',
`created` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`created_by` int(10) unsigned NOT NULL DEFAULT '0',
`created_by` int(10) unsigned NOT NULL DEFAULT 0,
`modified` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`modified_by` int(10) unsigned NOT NULL DEFAULT '0',
`access` int(11) NOT NULL DEFAULT '1',
`modified_by` int(10) unsigned NOT NULL DEFAULT 0,
`access` int(11) NOT NULL DEFAULT 1,
PRIMARY KEY (`id`),
KEY `idx_checkout` (`checked_out`),
KEY `idx_state` (`state`),
Expand Down Expand Up @@ -1439,7 +1439,7 @@ CREATE TABLE IF NOT EXISTS `#__menu_types` (
`menutype` varchar(24) NOT NULL,
`title` varchar(48) NOT NULL,
`description` varchar(255) NOT NULL DEFAULT '',
`client_id` int(11) NOT NULL DEFAULT '0',
`client_id` int(11) NOT NULL DEFAULT 0,
PRIMARY KEY (`id`),
UNIQUE KEY `idx_menutype` (`menutype`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci;
Expand Down Expand Up @@ -1651,7 +1651,7 @@ CREATE TABLE IF NOT EXISTS `#__postinstall_messages` (
`description_key` varchar(255) NOT NULL DEFAULT '' COMMENT 'Lang key for description',
`action_key` varchar(255) NOT NULL DEFAULT '',
`language_extension` varchar(255) NOT NULL DEFAULT 'com_postinstall' COMMENT 'Extension holding lang keys',
`language_client_id` tinyint(3) NOT NULL DEFAULT '1',
`language_client_id` tinyint(3) NOT NULL DEFAULT 1,
`type` varchar(10) NOT NULL DEFAULT 'link' COMMENT 'Message type - message, link, action',
`action_file` varchar(255) DEFAULT '' COMMENT 'RAD URI to the PHP file containing action method',
`action` varchar(255) DEFAULT '' COMMENT 'Action method name or URL',
Expand Down Expand Up @@ -1687,7 +1687,7 @@ CREATE TABLE IF NOT EXISTS `#__privacy_requests` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`email` varchar(100) NOT NULL DEFAULT '',
`requested_at` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`status` tinyint(4) NOT NULL DEFAULT '0',
`status` tinyint(4) NOT NULL DEFAULT 0,
`request_type` varchar(25) NOT NULL DEFAULT '',
`confirm_token` varchar(100) NOT NULL DEFAULT '',
`confirm_token_created_at` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
Expand All @@ -1702,12 +1702,12 @@ CREATE TABLE IF NOT EXISTS `#__privacy_requests` (

CREATE TABLE IF NOT EXISTS `#__privacy_consents` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`user_id` int(10) unsigned NOT NULL DEFAULT '0',
`state` INT(10) NOT NULL DEFAULT '1',
`user_id` int(10) unsigned NOT NULL DEFAULT 0,
`state` INT(10) NOT NULL DEFAULT 1,
`created` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`subject` varchar(255) NOT NULL DEFAULT '',
`body` text NOT NULL,
`remind` tinyint(4) NOT NULL DEFAULT '0',
`remind` tinyint(4) NOT NULL DEFAULT 0,
`token` varchar(100) NOT NULL DEFAULT '',
PRIMARY KEY (`id`),
KEY `idx_user_id` (`user_id`)
Expand Down
16 changes: 8 additions & 8 deletions installation/sql/postgresql/joomla.sql
Original file line number Diff line number Diff line change
Expand Up @@ -751,17 +751,17 @@ CREATE TABLE "#__fields_groups" (
"title" varchar(255) DEFAULT '' NOT NULL,
"note" varchar(255) DEFAULT '' NOT NULL,
"description" text NOT NULL,
"state" smallint DEFAULT '0' NOT NULL,
"checked_out" integer DEFAULT '0' NOT NULL,
"state" smallint DEFAULT 0 NOT NULL,
"checked_out" integer DEFAULT 0 NOT NULL,
"checked_out_time" timestamp without time zone DEFAULT '1970-01-01 00:00:00' NOT NULL,
"ordering" integer DEFAULT '0' NOT NULL,
"ordering" integer DEFAULT 0 NOT NULL,
"params" text DEFAULT '' NOT NULL,
"language" varchar(7) DEFAULT '' NOT NULL,
"created" timestamp without time zone DEFAULT '1970-01-01 00:00:00' NOT NULL,
"created_by" bigint DEFAULT '0' NOT NULL,
"created_by" bigint DEFAULT 0 NOT NULL,
"modified" timestamp without time zone DEFAULT '1970-01-01 00:00:00' NOT NULL,
"modified_by" bigint DEFAULT '0' NOT NULL,
"access" bigint DEFAULT '1' NOT NULL,
"modified_by" bigint DEFAULT 0 NOT NULL,
"access" bigint DEFAULT 1 NOT NULL,
PRIMARY KEY ("id")
);
CREATE INDEX "#__fields_groups_idx_checked_out" ON "#__fields_groups" ("checked_out");
Expand Down Expand Up @@ -2142,8 +2142,8 @@ CREATE TABLE "#__action_logs" (
PRIMARY KEY ("id")
);

CREATE INDEX "#__action_logs_idx_user_id" ON "#__action_logs" ("user_id");
CREATE INDEX "#__action_logs_idx_user_id_logdate" ON "#__action_logs" ("user_id", "log_date");
CREATE INDEX "#__action_logs_idx_user_id" ON "#__action_logs" ("user_id");
CREATE INDEX "#__action_logs_idx_user_id_logdate" ON "#__action_logs" ("user_id", "log_date");
CREATE INDEX "#__action_logs_idx_user_id_extension" ON "#__action_logs" ("user_id", "extension");
CREATE INDEX "#__action_logs_idx_extension_itemid" ON "#__action_logs" ("extension", "item_id");

Expand Down

0 comments on commit 64cf8b3

Please sign in to comment.