Skip to content

Commit

Permalink
Merge branch '4.1-dev' into j4tagsrouting
Browse files Browse the repository at this point in the history
  • Loading branch information
Hackwar committed Aug 10, 2021
2 parents 4bd2fc9 + 9514f1b commit 68079e6
Show file tree
Hide file tree
Showing 1,787 changed files with 34,473 additions and 29,976 deletions.
4 changes: 2 additions & 2 deletions .appveyor.yml
Expand Up @@ -70,8 +70,8 @@ install:
- IF %PHP%==1 echo zend_extension=php_opcache.dll >> php.ini
- IF %PHP%==1 echo opcache.enable_cli=1 >> php.ini
- IF %PHP%==1 echo extension=php_ldap.dll >> php.ini
- IF %PHP%==1 echo @php %%~dp0composer-1.phar %%* > composer.bat
- IF %PHP%==1 appveyor-retry appveyor DownloadFile https://getcomposer.org/composer-1.phar
- IF %PHP%==1 echo @php %%~dp0composer.phar %%* > composer.bat
- IF %PHP%==1 appveyor-retry appveyor DownloadFile https://getcomposer.org/download/latest-1.x/composer.phar
- cd C:\projects\joomla-cms
- appveyor-retry composer install --no-progress --profile
before_test:
Expand Down
5 changes: 3 additions & 2 deletions .drone.yml
Expand Up @@ -183,6 +183,7 @@ steps:

- name: analysis4x
image: rips/rips-cli:3.2.2
failure: ignore
depends_on: [ api-tests ]
when:
repo:
Expand Down Expand Up @@ -264,11 +265,11 @@ steps:
path: /reference
when:
branch:
- 4.0-dev
- 4.1-dev


---
kind: signature
hmac: f99784b6fd6bf3707a600f262bb9e59aa7b5f97e54df8976e459096de4344ef3
hmac: d9dd36c1bf3ac28d03a3a2e7593357ed2f5dd87a098be4115fb4c844b9304eab

...
2 changes: 0 additions & 2 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Expand Up @@ -45,8 +45,6 @@ RoboFile.php @rdeutz @hackwar

# CSP Tooling
plugins/system/httpheaders/* @zero-24
administrator/components/com_csp/* @zero-24
components/com_csp/* @zero-24

# Web Authentication (WebAuthn)
plugins/system/webauthn/* @nikosdion
Expand Down
2 changes: 1 addition & 1 deletion .github/SUPPORT.md
Expand Up @@ -5,4 +5,4 @@ Where can you get support and help?
* 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).
* [Joomla Resources Directory](https://community.joomla.org/service-providers-directory/) (JRD).
8 changes: 4 additions & 4 deletions README.md
@@ -1,4 +1,4 @@
Joomla! CMS™ [![Analytics](https://ga-beacon.appspot.com/UA-544070-3/joomla-cms/readme)](https://github.com/igrigorik/ga-beacon)
Joomla! CMS™ [![Analytics](https://ga-beacon.appspot.com/UA-544070-3/joomla-cms/readme)](https://github.com/igrigorik/ga-beacon)
====================

Build Status
Expand Down Expand Up @@ -28,13 +28,13 @@ Joomla is not installable out of the box from this repository, please use:

How to get a working installation from the source
---------------------
For detailed instructions please visit https://docs.joomla.org/J4.x:Setting_Up_Your_Local_Environment
For detailed instructions please visit https://docs.joomla.org/Special:MyLanguage/J4.x:Setting_Up_Your_Local_Environment

You will need:
- PHP - basically the same as you need for running a Joomla Site, but you need the cli (command line interface) Version (see https://docs.joomla.org/Configuring_a_LAMPP_server_for_PHP_development)
- PHP - basically the same as you need for running a Joomla Site, but you need the cli (command line interface) Version (see https://docs.joomla.org/Special:MyLanguage/Configuring_a_LAMPP_server_for_PHP_development)
- Composer - for managing Joomla's PHP Dependencies. For help installing composer please read the documentation at https://getcomposer.org/doc/00-intro.md
- Node.js - for compiling Joomla's Javascript and SASS files. For help installing Node.js please follow the instructions available on https://nodejs.org/en/
- Git - for version management. Download from here https://git-scm.com/downloads (MacOS users can also use Brew and Linux users can use the built-in package manager, eg apt, yum, etc).
- Git - for version management. Download from here https://git-scm.com/downloads (MacOS users can also use Brew and Linux users can use the built-in package manager, eg apt, yum, etc).

**Steps to setup the local environment:**
- Clone the repository:
Expand Down
4 changes: 2 additions & 2 deletions README.txt
Expand Up @@ -18,7 +18,7 @@ Joomla! CMS™
* Try out our free hosting service: https://launch.joomla.org

4- How to find a Joomla! translation?
* Repository of accredited language packs: https://community.joomla.org/translations.html
* Repository of accredited language packs: https://downloads.joomla.org/language-packs
* You can also add languages directly to your website via your Joomla! administration panel: https://docs.joomla.org/Special:MyLanguage/J4.x:Setup_a_Multilingual_Site/Installing_New_Language
* Learn how to setup a Multilingual Joomla! Site: https://docs.joomla.org/Special:MyLanguage/J4.x:Setup_a_Multilingual_Site

Expand Down Expand Up @@ -52,7 +52,7 @@ Joomla! CMS™
* 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 (JRD): https://resources.joomla.org/
* Joomla! Resources Directory (JRD): https://community.joomla.org/service-providers-directory/

11- Do you already have a Joomla! site that's not built with Joomla! 4.x ?
* What's new in Joomla! 4.x: https://www.joomla.org/4
Expand Down
11 changes: 11 additions & 0 deletions administrator/components/com_actionlogs/config.xml
Expand Up @@ -56,5 +56,16 @@
<option value="PUT">COM_ACTIONLOGS_FIELD_VALUE_PUT</option>
<option value="PATCH">COM_ACTIONLOGS_FIELD_VALUE_PATCH</option>
</field>
<field
name="date_relative"
type="radio"
label="COM_ACTIONLOGS_DATE_RELATIVE_LABEL"
layout="joomla.form.field.radio.switcher"
default="1"
filter="integer"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
</fieldset>
</config>
Expand Up @@ -237,12 +237,13 @@ public static function getHumanReadableLogMessage($log, $generateLinks = true)
* @param string $contentType
* @param integer $id
* @param string $urlVar
* @param JObject $object
*
* @return string Link to the content item
*
* @since 3.9.0
*/
public static function getContentTypeLink($component, $contentType, $id, $urlVar = 'id')
public static function getContentTypeLink($component, $contentType, $id, $urlVar = 'id', $object = null)
{
// Try to find the component helper.
$eName = str_replace('com_', '', $component);
Expand All @@ -257,7 +258,7 @@ public static function getContentTypeLink($component, $contentType, $id, $urlVar

if (class_exists($cName) && is_callable(array($cName, 'getContentTypeLink')))
{
return $cName::getContentTypeLink($contentType, $id);
return $cName::getContentTypeLink($contentType, $id, $object);
}
}

Expand Down
Expand Up @@ -73,23 +73,6 @@ public function __construct($config = array())
*/
protected function populateState($ordering = 'a.id', $direction = 'desc')
{
$app = Factory::getApplication();

$search = $app->getUserStateFromRequest($this->context . 'filter.search', 'filter_search', '', 'string');
$this->setState('filter.search', $search);

$user = $app->getUserStateFromRequest($this->context . 'filter.user', 'filter_user', '', 'string');
$this->setState('filter.user', $user);

$extension = $app->getUserStateFromRequest($this->context . 'filter.extension', 'filter_extension', '', 'string');
$this->setState('filter.extension', $extension);

$ip_address = $app->getUserStateFromRequest($this->context . 'filter.ip_address', 'filter_ip_address', '', 'string');
$this->setState('filter.ip_address', $ip_address);

$dateRange = $app->getUserStateFromRequest($this->context . 'filter.dateRange', 'filter_dateRange', '', 'string');
$this->setState('filter.dateRange', $dateRange);

parent::populateState($ordering, $direction);
}

Expand Down
Expand Up @@ -13,7 +13,6 @@

use Joomla\CMS\Factory;
use Joomla\CMS\Plugin\CMSPlugin;
use Joomla\Component\Actionlogs\Administrator\Model\ActionlogModel;

/**
* Abstract Action Log Plugin
Expand All @@ -25,15 +24,15 @@ abstract class ActionLogPlugin extends CMSPlugin
/**
* Application object.
*
* @var JApplicationCms
* @var \Joomla\CMS\Application\CMSApplication
* @since 3.9.0
*/
protected $app;

/**
* Database object.
*
* @var JDatabaseDriver
* @var \Joomla\Database\DatabaseDriver
* @since 3.9.0
*/
protected $db;
Expand Down Expand Up @@ -94,8 +93,10 @@ protected function addLog($messages, $messageLanguageKey, $context, $userId = nu
$messages[$index] = $message;
}

/** @var ActionlogModel $model */
$model = new ActionlogModel;
/** @var \Joomla\Component\Actionlogs\Administrator\Model\ActionlogModel $model */
$model = $this->app->bootComponent('com_actionlogs')
->getMVCFactory()->createModel('Actionlog', 'Administrator', ['ignore_request' => true]);

$model->addLog($messages, strtoupper($messageLanguageKey), $context, $userId);
}
}
Expand Up @@ -78,6 +78,14 @@ class HtmlView extends BaseHtmlView
*/
protected $showIpColumn = false;

/**
* Setting if the date should be displayed relative to the current date.
*
* @var boolean
* @since __DEPLOY_VERSION__
*/
protected $dateRelative = false;

/**
* Method to display the view.
*
Expand All @@ -100,13 +108,14 @@ public function display($tpl = null)
$this->activeFilters = $model->getActiveFilters();
$params = ComponentHelper::getParams('com_actionlogs');
$this->showIpColumn = (bool) $params->get('ip_logging', 0);
$this->dateRelative = (bool) $params->get('date_relative', 1);

if (count($errors = $model->getErrors()))
{
throw new GenericDataException(implode("\n", $errors), 500);
}

$this->addToolBar();
$this->addToolbar();

// Load all actionlog plugins language files
ActionlogsHelper::loadActionLogPluginsLanguage();
Expand Down
Expand Up @@ -88,10 +88,14 @@
<?php echo $this->escape(Text::_($extension)); ?>
</td>
<td class="d-none d-md-table-cell">
<?php echo HTMLHelper::_('date.relative', $item->log_date); ?>
<div class="small">
<?php if ($this->dateRelative) : ?>
<?php echo HTMLHelper::_('date.relative', $item->log_date); ?>
<div class="small">
<?php endif; ?>
<?php echo HTMLHelper::_('date', $item->log_date, Text::_('DATE_FORMAT_LC6')); ?>
</div>
<?php if ($this->dateRelative) : ?>
</div>
<?php endif; ?>
</td>
<td class="d-md-table-cell">
<?php echo $this->escape($item->name); ?>
Expand Down
89 changes: 89 additions & 0 deletions administrator/components/com_admin/postinstall/behindproxy.php
@@ -0,0 +1,89 @@
<?php
/**
* @package Joomla.Administrator
* @subpackage com_admin
*
* @copyright Copyright (C) 2005 - 2020 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\Factory;
use Joomla\CMS\Filesystem\File;
use Joomla\CMS\Filesystem\Path;
use Joomla\CMS\Language\Text;
use Joomla\Registry\Registry;
use Joomla\Utilities\ArrayHelper;

/**
* Notifies users of the new Behind Load Balancer option in Global Config, if we detect they might be behind a proxy
*
* @return boolean
*
* @since 3.9.26
*/
function admin_postinstall_behindproxy_condition()
{
$app = Factory::getApplication();

if ($app->get('behind_loadbalancer', '0'))
{
return false;
}

if (array_key_exists('HTTP_X_FORWARDED_FOR', $_SERVER) && !empty($_SERVER['HTTP_X_FORWARDED_FOR']))
{
return true;
}

if (array_key_exists('HTTP_CLIENT_IP', $_SERVER) && !empty($_SERVER['HTTP_CLIENT_IP']))
{
return true;
}

return false;
}


/**
* Enables the Behind Load Balancer setting in Global Configuration
*
* @return void
*
* @since 3.9.26
*/
function behindproxy_postinstall_action()
{
$prev = ArrayHelper::fromObject(new JConfig);
$data = array_merge($prev, array('behind_loadbalancer' => '1'));

$config = new Registry($data);

// Set the configuration file path.
$file = JPATH_CONFIGURATION . '/configuration.php';

// Attempt to make the file writeable
if (Path::isOwner($file) && !Path::setPermissions($file, '0644'))
{
Factory::getApplication()->enqueueMessage(Text::_('COM_CONFIG_ERROR_CONFIGURATION_PHP_NOTWRITABLE'), 'error');

return;
}

// Attempt to write the configuration file as a PHP class named JConfig.
$configuration = $config->toString('PHP', array('class' => 'JConfig', 'closingtag' => false));

if (!File::write($file, $configuration))
{
Factory::getApplication()->enqueueMessage(Text::_('COM_CONFIG_ERROR_WRITE_FAILED'), 'error');

return;
}

// Attempt to make the file unwriteable
if (Path::isOwner($file) && !Path::setPermissions($file, '0444'))
{
Factory::getApplication()->enqueueMessage(Text::_('COM_CONFIG_ERROR_CONFIGURATION_PHP_NOTUNWRITABLE'), 'error');
}
}

0 comments on commit 68079e6

Please sign in to comment.