| Current Path : /home/w/u/e/wuectly/www/03cbe/ |
| Current File : /home/w/u/e/wuectly/www/03cbe/postinstall.tar |
actions.php 0000604 00000003525 15245535264 0006731 0 ustar 00 <?php
/**
* @package Joomla.Plugin
* @subpackage Twofactorauth.totp
*
* @copyright (C) 2013 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*
* This file contains the functions used by the com_postinstall code to deliver
* the necessary post-installation messages concerning the activation of the
* two-factor authentication code.
*/
/**
* Checks if the plugin is enabled. If not it returns true, meaning that the
* message concerning two factor authentication should be displayed.
*
* @return integer
*
* @since 3.2
*/
function twofactorauth_postinstall_condition()
{
$db = JFactory::getDbo();
$query = $db->getQuery(true)
->select('*')
->from($db->qn('#__extensions'))
->where($db->qn('type') . ' = ' . $db->q('plugin'))
->where($db->qn('enabled') . ' = 1')
->where($db->qn('folder') . ' = ' . $db->q('twofactorauth'));
$db->setQuery($query);
$enabled_plugins = $db->loadObjectList();
return count($enabled_plugins) === 0;
}
/**
* Enables the two factor authentication plugin and redirects the user to their
* user profile page so that they can enable two factor authentication on their
* account.
*
* @return void
*
* @since 3.2
*/
function twofactorauth_postinstall_action()
{
// Enable the plugin
$db = JFactory::getDbo();
$query = $db->getQuery(true)
->update($db->qn('#__extensions'))
->set($db->qn('enabled') . ' = 1')
->where($db->qn('type') . ' = ' . $db->q('plugin'))
->where($db->qn('folder') . ' = ' . $db->q('twofactorauth'));
$db->setQuery($query);
$db->execute();
// Clean cache.
JFactory::getCache()->clean('com_plugins');
// Redirect the user to their profile editor page
$url = 'index.php?option=com_users&task=user.edit&id=' . JFactory::getUser()->id;
JFactory::getApplication()->redirect($url);
}
hathormessage.php 0000604 00000007751 15245557301 0010124 0 ustar 00 <?php
/**
* @package Joomla.Administrator
* @subpackage Template.hathor
*
* @copyright (C) 2017 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*
*/
/**
* Checks if hathor is the default backend template or currently used as default style.
* If yes we want to show a message and action button.
*
* @return boolean
*
* @since 3.7
*/
function hathormessage_postinstall_condition()
{
$db = JFactory::getDbo();
$user = JFactory::getUser();
$globalTemplate = 'n/a';
$template = 'n/a';
// We can only do that if you have edit permissions in com_templates
if ($user->authorise('core.edit.state', 'com_templates'))
{
$query = $db->getQuery(true)
->select('template')
->from($db->quoteName('#__template_styles'))
->where($db->quoteName('home') . ' = ' . $db->quote('1'))
->where($db->quoteName('client_id') . ' = 1');
// Get the global setting about the default template
$globalTemplate = $db->setQuery($query)->loadResult();
}
// Get the current user admin style
$adminstyle = $user->getParam('admin_style');
if ($adminstyle)
{
$query = $db->getQuery(true)
->select('template')
->from($db->quoteName('#__template_styles'))
->where($db->quoteName('id') . ' = ' . (int) $adminstyle)
->where($db->quoteName('client_id') . ' = 1');
// Get the template name associated to the admin style
$template = $db->setquery($query)->loadResult();
}
if (($globalTemplate != 'hathor') && ($template != 'hathor'))
{
// Hathor is not default not global and not in the user so no message needed
return false;
}
// Hathor is default please add the message
return true;
}
/**
* Set the default backend template back to isis if you are allowed to do this
* This also sets the current user setting to isis if not done yet
*
* @return void
*
* @since 3.7
*/
function hathormessage_postinstall_action()
{
$db = JFactory::getDbo();
$user = JFactory::getUser();
$query = $db->getQuery(true)
->select(array('id', 'title'))
->from($db->quoteName('#__template_styles'))
->where($db->quoteName('template') . ' = "isis"')
->where($db->quoteName('client_id') . ' = 1');
$isisStyleId = $db->setQuery($query)->loadColumn();
$isisStyleName = $db->setQuery($query)->loadColumn(1);
$adminstyle = $user->getParam('admin_style');
// The user uses the system setting so no need to change that.
if ($adminstyle)
{
$query = $db->getQuery(true)
->select('template')
->from($db->quoteName('#__template_styles'))
->where($db->quoteName('id') . ' = ' . (int) $adminstyle)
->where($db->quoteName('client_id') . ' = 1');
$template = $db->setQuery($query)->loadResult();
// The current user uses hathor
if ($template == 'hathor')
{
$user->setParam('admin_style', $isisStyleId['0']);
$user->save();
}
}
// We can only do that if you have edit permissions in com_templates
if ($user->authorise('core.edit.state', 'com_templates'))
{
$query = $db->getQuery(true)
->update($db->quoteName('#__template_styles'))
->set($db->quoteName('home') . ' = ' . $db->quote('0'))
->where($db->quoteName('template') . ' = "hathor"')
->where($db->quoteName('client_id') . ' = 1');
// Execute
$db->setQuery($query)->execute();
$query = $db->getQuery(true)
->update($db->quoteName('#__template_styles'))
->set($db->quoteName('home') . ' = ' . $db->quote('1'))
->where($db->quoteName('template') . ' = "isis"')
->where($db->quoteName('client_id') . ' = 1')
->where($db->quoteName('id') . ' = ' . $isisStyleId[0]);
// Execute
$db->setQuery($query)->execute();
}
// The postinstall component load the language to late... so we need to make sure it is loaded here.
JFactory::getLanguage()->load('tpl_hathor', JPATH_ADMINISTRATOR, null, false, true);
// Template was successfully changed to isis
JFactory::getApplication()->enqueueMessage(JText::sprintf('TPL_HATHOR_CHANGED_DEFAULT_TEMPLATE_TO_ISIS', $isisStyleName[0]), 'message');
}
updatecachetime.php 0000604 00000002605 15245570673 0010417 0 ustar 00 <?php
/**
* @package Joomla.Plugin
* @subpackage System.updatenotification
*
* @copyright (C) 2016 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
/**
* Checks if the com_installer config for the cache Hours are eq 0 and the updatenotification Plugin is enabled
*
* @return boolean
*
* @since 3.6.3
*/
function updatecachetime_postinstall_condition()
{
$cacheTimeout = (int) JComponentHelper::getComponent('com_installer')->params->get('cachetimeout', 6);
// Check if cachetimeout is eq zero
if ($cacheTimeout === 0 && JPluginHelper::isEnabled('system', 'updatenotification'))
{
return true;
}
return false;
}
/**
* Sets the cachetimeout back to the default (6 hours)
*
* @return void
*
* @since 3.6.3
*/
function updatecachetime_postinstall_action()
{
$installer = JComponentHelper::getComponent('com_installer');
// Sets the cachetimeout back to the default (6 hours)
$installer->params->set('cachetimeout', 6);
// Save the new parameters back to com_installer
$table = JTable::getInstance('extension');
$table->load($installer->id);
$table->bind(array('params' => $installer->params->toString()));
// Store the changes
if (!$table->store())
{
// If there is an error show it to the admin
JFactory::getApplication()->enqueueMessage($table->getError(), 'error');
}
}
textfilter3919.php 0000604 00000001170 15245662525 0010004 0 ustar 00 <?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
*/
defined('_JEXEC') or die;
/**
* 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;
}
joomla40checks.php 0000604 00000003554 15245662525 0010102 0 ustar 00 <?php
/**
* @package Joomla.Administrator
* @subpackage com_admin
*
* @copyright (C) 2016 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 Joomla 4.0 pre checks
*/
defined('_JEXEC') or die;
/**
* Checks if the installation meets the current requirements for Joomla 4
*
* @return boolean True if any check fails.
*
* @since 3.7
*
* @link https://developer.joomla.org/news/658-joomla4-manifesto.html
* @link https://developer.joomla.org/news/704-looking-forward-with-joomla-4.html
* @link https://developer.joomla.org/news/788-joomla-4-on-the-move.html
*/
function admin_postinstall_joomla40checks_condition()
{
$db = JFactory::getDbo();
$serverType = $db->getServerType();
$serverVersion = $db->getVersion();
if ($serverType == 'mssql')
{
// MS SQL support will be dropped
return true;
}
if ($serverType == 'postgresql' && version_compare($serverVersion, '11.0', 'lt'))
{
// PostgreSQL minimum version is 11.0
return true;
}
// Check whether we have a MariaDB version string and extract the proper version from it
if ($serverType == 'mysql' && stripos($serverVersion, 'mariadb') !== false)
{
$serverVersion = preg_replace('/^5\.5\.5-/', '', $serverVersion);
// MariaDB minimum version is 10.1
if (version_compare($serverVersion, '10.1', 'lt'))
{
return true;
}
}
if ($serverType == 'mysql' && version_compare($serverVersion, '5.6', 'lt'))
{
// MySQL minimum version is 5.6.0
return true;
}
if ($db->name === 'mysql')
{
// Using deprecated MySQL driver
return true;
}
if ($db->name === 'postgresql')
{
// Using deprecated PostgreSQL driver
return true;
}
// PHP minimum version is 7.2.5
return version_compare(PHP_VERSION, '7.2.5', 'lt');
}
htaccesssvg.php 0000604 00000001320 15245662525 0007576 0 ustar 00 <?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
*/
defined('_JEXEC') or die;
/**
* 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;
}
eaccelerator.php 0000604 00000004661 15245662525 0007725 0 ustar 00 <?php
/**
* @package Joomla.Administrator
* @subpackage com_admin
*
* @copyright (C) 2013 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 eAccelerator compatibility.
*/
defined('_JEXEC') or die;
use Joomla\Registry\Registry;
use Joomla\Utilities\ArrayHelper;
/**
* Checks if the eAccelerator caching method is enabled.
*
* This check should be done through the 3.x series as the issue impacts migrated sites which will
* most often come from the previous LTS release (2.5). Remove for version 4 or when eAccelerator support is added.
*
* This check returns true when the eAccelerator caching method is user, meaning that the message concerning it should be displayed.
*
* @return integer
*
* @since 3.2
*/
function admin_postinstall_eaccelerator_condition()
{
$app = JFactory::getApplication();
$cacheHandler = $app->get('cacheHandler', '');
return (ucfirst($cacheHandler) == 'Eaccelerator');
}
/**
* Disables the unsupported eAccelerator caching method, replacing it with the "file" caching method.
*
* @return void
*
* @since 3.2
*/
function admin_postinstall_eaccelerator_action()
{
$prev = ArrayHelper::fromObject(new JConfig);
$data = array_merge($prev, array('cacheHandler' => 'file'));
$config = new Registry($data);
jimport('joomla.filesystem.path');
jimport('joomla.filesystem.file');
// Set the configuration file path.
$file = JPATH_CONFIGURATION . '/configuration.php';
// Get the new FTP credentials.
$ftp = JClientHelper::getCredentials('ftp', true);
// Attempt to make the file writeable if using FTP.
if (!$ftp['enabled'] && JPath::isOwner($file) && !JPath::setPermissions($file, '0644'))
{
JError::raiseNotice(500, JText::_('COM_CONFIG_ERROR_CONFIGURATION_PHP_NOTWRITABLE'));
}
// Attempt to write the configuration file as a PHP class named JConfig.
$configuration = $config->toString('PHP', array('class' => 'JConfig', 'closingtag' => false));
if (!JFile::write($file, $configuration))
{
JFactory::getApplication()->enqueueMessage(JText::_('COM_CONFIG_ERROR_WRITE_FAILED'), 'error');
return;
}
// Attempt to make the file unwriteable if NOT using FTP.
if (!$ftp['enabled'] && JPath::isOwner($file) && !JPath::setPermissions($file, '0444'))
{
JError::raiseNotice(500, JText::_('COM_CONFIG_ERROR_CONFIGURATION_PHP_NOTUNWRITABLE'));
}
}
updatedefaultsettings.php 0000604 00000001167 15245662525 0011702 0 ustar 00 <?php
/**
* @package Joomla.Administrator
* @subpackage com_admin
*
* @copyright (C) 2018 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 various default settings.
*/
defined('_JEXEC') or die;
/**
* Notifies users of a change in various default settings
*
* This check returns true regardless of condition.
*
* @return boolean
*
* @since 3.8.8
*/
function admin_postinstall_updatedefaultsettings_condition()
{
return true;
}
behindproxy.php 0000604 00000004424 15245662525 0007624 0 ustar 00 <?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\Filesystem\File;
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 = JFactory::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);
jimport('joomla.filesystem.path');
jimport('joomla.filesystem.file');
// Set the configuration file path.
$file = JPATH_CONFIGURATION . '/configuration.php';
// Get the new FTP credentials.
$ftp = JClientHelper::getCredentials('ftp', true);
// Attempt to make the file writeable if using FTP.
if (!$ftp['enabled'] && JPath::isOwner($file) && !JPath::setPermissions($file, '0644'))
{
JError::raiseNotice(500, JText::_('COM_CONFIG_ERROR_CONFIGURATION_PHP_NOTWRITABLE'));
}
// 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))
{
JFactory::getApplication()->enqueueMessage(JText::_('COM_CONFIG_ERROR_WRITE_FAILED'), 'error');
return;
}
// Attempt to make the file unwriteable if NOT using FTP.
if (!$ftp['enabled'] && JPath::isOwner($file) && !JPath::setPermissions($file, '0444'))
{
JError::raiseNotice(500, JText::_('COM_CONFIG_ERROR_CONFIGURATION_PHP_NOTUNWRITABLE'));
}
}
addnosniff.php 0000604 00000001271 15245662525 0007401 0 ustar 00 <?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.
*/
defined('_JEXEC') or die;
/**
* 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;
}
statscollection.php 0000604 00000001063 15245662525 0010477 0 ustar 00 <?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
*/
defined('_JEXEC') or die;
/**
* 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;
}
htaccess.php 0000604 00000001212 15245662525 0007056 0 ustar 00 <?php
/**
* @package Joomla.Administrator
* @subpackage com_admin
*
* @copyright (C) 2014 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.
*/
defined('_JEXEC') or die;
/**
* Notifies users of a change in the default .htaccess or web.config file
*
* This check returns true regardless of condition.
*
* @return boolean
*
* @since 3.4
*/
function admin_postinstall_htaccess_condition()
{
return true;
}
languageaccess340.php 0000604 00000002300 15245662525 0010454 0 ustar 00 <?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
*/
defined('_JEXEC') or die;
/**
* 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 = JFactory::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 minumum one row with access set to 0
return true;
}
// All good the query return nothing.
return false;
}