first commit
This commit is contained in:
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package Joomla.Administrator
|
||||
* @subpackage com_admin
|
||||
*
|
||||
* @copyright (C) 2019 Open Source Matters, Inc. <https://www.joomla.org>
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*
|
||||
* This file contains post-installation message handling for notifying users of a change
|
||||
* in the default .htaccess and web.config files.
|
||||
*/
|
||||
|
||||
// phpcs:disable PSR1.Files.SideEffects
|
||||
\defined('_JEXEC') or die;
|
||||
// phpcs:enable PSR1.Files.SideEffects
|
||||
|
||||
/**
|
||||
* Notifies users of the add the nosniff headers by applying the changes from the default .htaccess or web.config file
|
||||
*
|
||||
* This check returns true regardless of condition.
|
||||
*
|
||||
* @return boolean
|
||||
*
|
||||
* @since 3.4
|
||||
*/
|
||||
function admin_postinstall_addnosniff_condition()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@ -0,0 +1,86 @@
|
||||
<?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
|
||||
*/
|
||||
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\Filesystem\File;
|
||||
use Joomla\Filesystem\Path;
|
||||
use Joomla\Registry\Registry;
|
||||
use Joomla\Utilities\ArrayHelper;
|
||||
|
||||
// phpcs:disable PSR1.Files.SideEffects
|
||||
\defined('_JEXEC') or die;
|
||||
// phpcs:enable PSR1.Files.SideEffects
|
||||
|
||||
/**
|
||||
* 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, ['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', ['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,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package Joomla.Administrator
|
||||
* @subpackage com_admin
|
||||
*
|
||||
* @copyright (C) 2023 Open Source Matters, Inc. <https://www.joomla.org>
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*
|
||||
* This file contains post-installation message handling for notifying users of a change
|
||||
* in the default .htaccess file regarding setting the Content-Encoding header.
|
||||
*/
|
||||
|
||||
// phpcs:disable PSR1.Files.SideEffects
|
||||
\defined('_JEXEC') or die;
|
||||
// phpcs:enable PSR1.Files.SideEffects
|
||||
|
||||
/**
|
||||
* Notifies users of a change in the default .htaccess file regarding setting the Content-Encoding header
|
||||
*
|
||||
* This check returns true regardless of condition.
|
||||
*
|
||||
* @return boolean
|
||||
*
|
||||
* @since 4.2.9
|
||||
*/
|
||||
function admin_postinstall_htaccesssetce_condition()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@ -0,0 +1,30 @@
|
||||
<?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
|
||||
*
|
||||
* This file contains post-installation message handling for notifying users of a change
|
||||
* in the default .htaccess file regarding hardening against XSS in SVG's
|
||||
*/
|
||||
|
||||
// phpcs:disable PSR1.Files.SideEffects
|
||||
\defined('_JEXEC') or die;
|
||||
// phpcs:enable PSR1.Files.SideEffects
|
||||
|
||||
/**
|
||||
* Notifies users of a change in the default .htaccess file regarding hardening against XSS in SVG's
|
||||
*
|
||||
* This check returns true regardless of condition.
|
||||
*
|
||||
* @return boolean
|
||||
*
|
||||
* @since 3.9.21
|
||||
*/
|
||||
function admin_postinstall_htaccesssvg_condition()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@ -0,0 +1,48 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package Joomla.Administrator
|
||||
* @subpackage com_admin
|
||||
*
|
||||
* @copyright (C) 2015 Open Source Matters, Inc. <https://www.joomla.org>
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*
|
||||
* This file contains post-installation message handling for the checks if the installation is
|
||||
* affected by the issue with content languages access in 3.4.0
|
||||
*/
|
||||
|
||||
use Joomla\CMS\Factory;
|
||||
|
||||
// phpcs:disable PSR1.Files.SideEffects
|
||||
\defined('_JEXEC') or die;
|
||||
// phpcs:enable PSR1.Files.SideEffects
|
||||
|
||||
/**
|
||||
* Checks if the installation is affected by the issue with content languages access in 3.4.0
|
||||
*
|
||||
* @link https://github.com/joomla/joomla-cms/pull/6172
|
||||
* @link https://github.com/joomla/joomla-cms/pull/6194
|
||||
*
|
||||
* @return boolean
|
||||
*
|
||||
* @since 3.4.1
|
||||
*/
|
||||
function admin_postinstall_languageaccess340_condition()
|
||||
{
|
||||
$db = Factory::getDbo();
|
||||
$query = $db->getQuery(true)
|
||||
->select($db->quoteName('access'))
|
||||
->from($db->quoteName('#__languages'))
|
||||
->where($db->quoteName('access') . ' = ' . $db->quote('0'));
|
||||
$db->setQuery($query);
|
||||
$db->execute();
|
||||
$numRows = $db->getNumRows();
|
||||
|
||||
if (isset($numRows) && $numRows != 0) {
|
||||
// We have rows here so we have at minimum one row with access set to 0
|
||||
return true;
|
||||
}
|
||||
|
||||
// All good the query return nothing.
|
||||
return false;
|
||||
}
|
||||
@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package Joomla.Administrator
|
||||
* @subpackage com_admin
|
||||
*
|
||||
* @copyright (C) 2015 Open Source Matters, Inc. <https://www.joomla.org>
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*
|
||||
* This file contains post-installation message handling for the checking minimum PHP version support
|
||||
*/
|
||||
|
||||
// phpcs:disable PSR1.Files.SideEffects
|
||||
\defined('_JEXEC') or die;
|
||||
// phpcs:enable PSR1.Files.SideEffects
|
||||
|
||||
/**
|
||||
* Alerts the user we are collecting anonymous data as of Joomla 3.5.0.
|
||||
*
|
||||
* @return boolean
|
||||
*
|
||||
* @since 3.5
|
||||
*/
|
||||
function admin_postinstall_statscollection_condition()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package Joomla.Administrator
|
||||
* @subpackage com_admin
|
||||
*
|
||||
* @copyright (C) 2020 Open Source Matters, Inc. <https://www.joomla.org>
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*
|
||||
* This file contains post-installation message handling for notifying users of a change
|
||||
* in the default textfilter settings
|
||||
*/
|
||||
|
||||
// phpcs:disable PSR1.Files.SideEffects
|
||||
\defined('_JEXEC') or die;
|
||||
// phpcs:enable PSR1.Files.SideEffects
|
||||
|
||||
/**
|
||||
* Notifies users the changes from the default textfilter.
|
||||
*
|
||||
* This check returns true regardless of condition.
|
||||
*
|
||||
* @return boolean
|
||||
*
|
||||
* @since 3.9.19
|
||||
*/
|
||||
function admin_postinstall_textfilter3919_condition()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
Reference in New Issue
Block a user