Skip to content

Commit

Permalink
Merge branch '4.2-dev' into nowrap
Browse files Browse the repository at this point in the history
  • Loading branch information
brianteeman authored Aug 22, 2022
2 parents fd7ceef + 9a1309c commit 30a9c9d
Show file tree
Hide file tree
Showing 43 changed files with 586 additions and 119 deletions.
9 changes: 9 additions & 0 deletions administrator/components/com_admin/script.php
Original file line number Diff line number Diff line change
Expand Up @@ -6435,6 +6435,11 @@ public function deleteUnexistingFiles($dryRun = false, $suppressOutput = false)
'/plugins/system/webauthn/webauthn.php',
'/plugins/task/checkfiles/checkfiles.php',
'/plugins/task/demotasks/demotasks.php',
// From 4.2.0 to 4.2.1
'/media/vendor/hotkeys.js/js/hotkeys.js',
'/media/vendor/hotkeys.js/js/hotkeys.min.js',
'/media/vendor/hotkeys.js/js/hotkeys.min.js.gz',
'/media/vendor/hotkeys.js/LICENSE',
);

$folders = array(
Expand Down Expand Up @@ -7802,6 +7807,10 @@ public function deleteUnexistingFiles($dryRun = false, $suppressOutput = false)
// From 4.2.0-beta2 to 4.2.0-beta3
'/plugins/system/webauthn/src/Helper',
'/plugins/system/webauthn/src/Exception',
// From 4.2.0 to 4.2.1
'/media/vendor/hotkeys.js/js',
'/media/vendor/hotkeys.js',
'/libraries/vendor/symfony/string/Resources/bin',
);

$status['files_checked'] = $files;
Expand Down
10 changes: 10 additions & 0 deletions administrator/components/com_joomlaupdate/extract.php
Original file line number Diff line number Diff line change
Expand Up @@ -1930,6 +1930,16 @@ function setHugeMemoryLimit()
case 'finalizeUpdate':
$root = $configuration['setup.destdir'] ?? '';

// Remove the administrator/cache/autoload_psr4.php file
$filename = $root . (empty($root) ? '' : '/') . 'administrator/cache/autoload_psr4.php';

if (file_exists($filename)) {
clearFileInOPCache($filename);
clearstatcache(true, $filename);

@unlink($filename);
}

// Remove update.php
clearFileInOPCache($basePath . 'update.php');
@unlink($basePath . 'update.php');
Expand Down
25 changes: 13 additions & 12 deletions administrator/components/com_joomlaupdate/src/Model/UpdateModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public function applyUpdateSite()
}

$id = ExtensionHelper::getExtensionRecord('joomla', 'file')->extension_id;
$db = $this->getDatabase();
$db = version_compare(JVERSION, '4.2.0', 'lt') ? $this->getDbo() : $this->getDatabase();
$query = $db->getQuery(true)
->select($db->quoteName('us') . '.*')
->from($db->quoteName('#__update_sites_extensions', 'map'))
Expand Down Expand Up @@ -173,7 +173,7 @@ public function refreshUpdates($force = false)
*/
public function getCheckForSelfUpdate()
{
$db = $this->getDatabase();
$db = version_compare(JVERSION, '4.2.0', 'lt') ? $this->getDbo() : $this->getDatabase();

$query = $db->getQuery(true)
->select($db->quoteName('extension_id'))
Expand Down Expand Up @@ -244,7 +244,7 @@ public function getUpdateInformation()

// Fetch the update information from the database.
$id = ExtensionHelper::getExtensionRecord('joomla', 'file')->extension_id;
$db = $this->getDatabase();
$db = version_compare(JVERSION, '4.2.0', 'lt') ? $this->getDbo() : $this->getDatabase();
$query = $db->getQuery(true)
->select('*')
->from($db->quoteName('#__updates'))
Expand Down Expand Up @@ -300,7 +300,7 @@ public function getUpdateInformation()
*/
public function purge()
{
$db = $this->getDatabase();
$db = version_compare(JVERSION, '4.2.0', 'lt') ? $this->getDbo() : $this->getDatabase();

// Modify the database record
$update_site = new \stdClass();
Expand Down Expand Up @@ -632,7 +632,8 @@ public function finaliseUpgrade()
$installer->setUpgrade(true);
$installer->setOverwrite(true);

$installer->extension = new \Joomla\CMS\Table\Extension($this->getDatabase());
$db = version_compare(JVERSION, '4.2.0', 'lt') ? $this->getDbo() : $this->getDatabase();
$installer->extension = new \Joomla\CMS\Table\Extension($db);
$installer->extension->load(ExtensionHelper::getExtensionRecord('joomla', 'file')->extension_id);

$installer->setAdapter($installer->extension->type);
Expand Down Expand Up @@ -667,7 +668,7 @@ public function finaliseUpgrade()
ob_end_clean();

// Get a database connector object.
$db = $this->getDatabase();
$db = version_compare(JVERSION, '4.2.0', 'lt') ? $this->getDbo() : $this->getDatabase();

/*
* Check to see if a file extension by the same name is already installed.
Expand All @@ -694,7 +695,7 @@ public function finaliseUpgrade()
}

$id = $db->loadResult();
$row = new \Joomla\CMS\Table\Extension($this->getDatabase());
$row = new \Joomla\CMS\Table\Extension($db);

if ($id) {
// Load the entry and update the manifest_cache.
Expand Down Expand Up @@ -779,7 +780,7 @@ public function finaliseUpgrade()
ob_end_clean();

// Clobber any possible pending updates.
$update = new \Joomla\CMS\Table\Update($this->getDatabase());
$update = new \Joomla\CMS\Table\Update($db);
$uid = $update->find(
array('element' => 'joomla', 'type' => 'file', 'client_id' => '0', 'folder' => '')
);
Expand Down Expand Up @@ -1325,7 +1326,7 @@ private function getDatabaseSchemaCheck(): bool
*/
public function getNonCoreExtensions()
{
$db = $this->getDatabase();
$db = version_compare(JVERSION, '4.2.0', 'lt') ? $this->getDbo() : $this->getDatabase();
$query = $db->getQuery(true);

$query->select(
Expand Down Expand Up @@ -1375,7 +1376,7 @@ public function getNonCoreExtensions()
*/
public function getNonCorePlugins($folderFilter = ['system','user','authentication','actionlog','multifactorauth'])
{
$db = $this->getDatabase();
$db = version_compare(JVERSION, '4.2.0', 'lt') ? $this->getDbo() : $this->getDatabase();
$query = $db->getQuery(true);

$query->select(
Expand Down Expand Up @@ -1476,7 +1477,7 @@ public function fetchCompatibility($extensionID, $joomlaTargetVersion)
private function getUpdateSitesInfo($extensionID)
{
$id = (int) $extensionID;
$db = $this->getDatabase();
$db = version_compare(JVERSION, '4.2.0', 'lt') ? $this->getDbo() : $this->getDatabase();
$query = $db->getQuery(true);

$query->select(
Expand Down Expand Up @@ -1659,7 +1660,7 @@ protected function translateExtensionName(&$item)
*/
public function isTemplateActive($template)
{
$db = $this->getDatabase();
$db = version_compare(JVERSION, '4.2.0', 'lt') ? $this->getDbo() : $this->getDatabase();
$query = $db->getQuery(true);

$query->select(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,11 @@ protected function addToolbar()
}

// Add toolbar buttons.
if ($this->getCurrentUser()->authorise('core.admin')) {
$currentUser = version_compare(JVERSION, '4.2.0', 'ge')
? $this->getCurrentUser()
: Factory::getApplication()->getIdentity();

if ($currentUser->authorise('core.admin')) {
ToolbarHelper::preferences('com_joomlaupdate');
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@

use Exception;
use Joomla\CMS\Application\CMSApplication;
use Joomla\CMS\Component\ComponentHelper;
use Joomla\CMS\Date\Date;
use Joomla\CMS\Event\GenericEvent;
use Joomla\CMS\Event\MultiFactor\NotifyActionLog;
use Joomla\CMS\Event\MultiFactor\Validate;
use Joomla\CMS\Factory;
Expand All @@ -27,7 +25,6 @@
use Joomla\Component\Users\Administrator\Model\BackupcodesModel;
use Joomla\Component\Users\Administrator\Model\CaptiveModel;
use Joomla\Input\Input;
use ReflectionObject;
use RuntimeException;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

use Exception;
use Joomla\CMS\Application\CMSApplication;
use Joomla\CMS\Event\GenericEvent;
use Joomla\CMS\Event\MultiFactor\NotifyActionLog;
use Joomla\CMS\Event\MultiFactor\SaveSetup;
use Joomla\CMS\Factory;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@

use Exception;
use Joomla\CMS\Application\CMSApplication;
use Joomla\CMS\Component\ComponentHelper;
use Joomla\CMS\Event\GenericEvent;
use Joomla\CMS\Event\MultiFactor\NotifyActionLog;
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
Expand All @@ -25,7 +23,6 @@
use Joomla\Component\Users\Administrator\Helper\Mfa as MfaHelper;
use Joomla\Component\Users\Administrator\Model\MethodsModel;
use Joomla\Input\Input;
use ReflectionObject;
use RuntimeException;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
namespace Joomla\Component\Users\Administrator\DataShape;

use InvalidArgumentException;
use Joomla\Database\ParameterType;

/**
* Data shape for Method Setup Render Options
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Object\CMSObject;
use Joomla\CMS\Plugin\PluginHelper;

/**
* Users component helper.
Expand Down
9 changes: 4 additions & 5 deletions administrator/components/com_users/src/Model/MethodModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,15 @@
namespace Joomla\Component\Users\Administrator\Model;

use Exception;
use Joomla\CMS\Event\GenericEvent;
use Joomla\CMS\Event\MultiFactor\GetSetup;
use Joomla\CMS\Language\Text;
use Joomla\Component\Users\Administrator\DataShape\SetupRenderOptions;
use Joomla\Component\Users\Administrator\Helper\Mfa as MfaHelper;
use Joomla\Component\Users\Administrator\Table\MfaTable;
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\MVC\Model\BaseDatabaseModel;
use Joomla\CMS\User\User;
use Joomla\CMS\User\UserFactoryInterface;
use Joomla\Component\Users\Administrator\DataShape\SetupRenderOptions;
use Joomla\Component\Users\Administrator\Helper\Mfa as MfaHelper;
use Joomla\Component\Users\Administrator\Table\MfaTable;

/**
* Multi-factor Authentication management model
Expand Down
2 changes: 0 additions & 2 deletions administrator/components/com_users/src/Model/UserModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@

use Joomla\CMS\Access\Access;
use Joomla\CMS\Component\ComponentHelper;
use Joomla\CMS\Crypt\Crypt;
use Joomla\CMS\Encrypt\Aes;
use Joomla\CMS\Factory;
use Joomla\CMS\Form\Form;
use Joomla\CMS\Language\Multilanguage;
Expand Down
2 changes: 0 additions & 2 deletions administrator/components/com_users/src/Model/UsersModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@
use Joomla\CMS\MVC\Factory\MVCFactoryInterface;
use Joomla\CMS\MVC\Model\ListModel;
use Joomla\CMS\Plugin\PluginHelper;
use Joomla\Component\Users\Administrator\DataShape\MethodDescriptor;
use Joomla\Component\Users\Administrator\Helper\Mfa;
use Joomla\Database\DatabaseQuery;
use Joomla\Database\ParameterType;
use Joomla\Utilities\ArrayHelper;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
use Joomla\CMS\Plugin\PluginHelper;
use Joomla\CMS\Toolbar\Button\BasicButton;
use Joomla\CMS\Toolbar\Toolbar;
use Joomla\CMS\Toolbar\ToolbarFactoryInterface;
use Joomla\CMS\Toolbar\ToolbarHelper;
use Joomla\CMS\User\UserFactoryInterface;
use Joomla\Component\Users\Administrator\Helper\Mfa as MfaHelper;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
namespace Joomla\Component\Users\Administrator\View\Debuggroup;

use Joomla\CMS\Access\Exception\NotAllowed;
use Joomla\CMS\Factory;
use Joomla\CMS\Helper\ContentHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\MVC\View\GenericDataException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
namespace Joomla\Component\Users\Administrator\View\Debuguser;

use Joomla\CMS\Access\Exception\NotAllowed;
use Joomla\CMS\Factory;
use Joomla\CMS\Helper\ContentHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\MVC\View\GenericDataException;
Expand Down
2 changes: 1 addition & 1 deletion administrator/components/com_users/tmpl/captive/select.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
// Prevent direct access
defined('_JEXEC') or die;

use Joomla\Component\Users\Administrator\View\Captive\HtmlView;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Router\Route;
use Joomla\CMS\Uri\Uri;
use Joomla\Component\Users\Administrator\View\Captive\HtmlView;

/** @var HtmlView $this */

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
// Prevent direct access
defined('_JEXEC') or die;

use Joomla\Component\Users\Administrator\View\Method\HtmlView;
use Joomla\CMS\Factory;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Router\Route;
use Joomla\Component\Users\Administrator\View\Method\HtmlView;

/** @var HtmlView $this */

Expand Down
1 change: 0 additions & 1 deletion administrator/components/com_users/tmpl/user/edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
use Joomla\CMS\Language\Text;
use Joomla\CMS\Layout\LayoutHelper;
use Joomla\CMS\Router\Route;
use Joomla\Component\Users\Administrator\Helper\UsersHelper;

/** @var Joomla\Component\Users\Administrator\View\User\HtmlView $this */

Expand Down
3 changes: 1 addition & 2 deletions administrator/components/com_users/tmpl/user/edit_groups.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,4 @@

use Joomla\CMS\HTML\HTMLHelper;

?>
<?php echo HTMLHelper::_('access.usergroups', 'jform[groups]', $this->groups, true);
echo HTMLHelper::_('access.usergroups', 'jform[groups]', $this->groups, true);
2 changes: 1 addition & 1 deletion administrator/language/en-GB/plg_multifactorauth_totp.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ PLG_MULTIFACTORAUTH_TOTP="Multi-factor Authentication - Verification Code"
PLG_MULTIFACTORAUTH_TOTP_CAPTIVE_PROMPT="Please open your authenticator application or password manager and copy the six digit code for this site in the text box below, then click on the Validate button. If this code has been automatically filled in for you just click on the Validate button."
PLG_MULTIFACTORAUTH_TOTP_ERR_VALIDATIONFAILED="You did not enter a valid verification code. Please check your authenticator app setup, and make sure that the time and time zone on your device is set correctly."
PLG_MULTIFACTORAUTH_TOTP_LBL_LABEL="Enter the six digit verification code"
PLG_MULTIFACTORAUTH_TOTP_LBL_SETUP_INSTRUCTIONS="Set up your verification code (also known as an “authenticator code”) using the information below. You can use an authenticator app (such Google Authenticator, Authy, LastPass Authenticator, etc), your favorite password manager (1Password, BitWarden, Keeper, KeePassXC, Strongbox, etc) or, in some cases, your browser."
PLG_MULTIFACTORAUTH_TOTP_LBL_SETUP_INSTRUCTIONS="Set up your verification code (also known as an “authenticator code”) using the information below. You can use an authenticator app (such Google Authenticator, Authy, LastPass Authenticator, etc), your favourite password manager (1Password, BitWarden, Keeper, KeePassXC, Strongbox, etc) or, in some cases, your browser."
PLG_MULTIFACTORAUTH_TOTP_LBL_SETUP_PLACEHOLDER="Six Digit Code"
PLG_MULTIFACTORAUTH_TOTP_LBL_SETUP_TABLE_HEADING="Authenticator app setup"
PLG_MULTIFACTORAUTH_TOTP_LBL_SETUP_TABLE_KEY="Enter this key"
Expand Down
2 changes: 1 addition & 1 deletion administrator/manifests/files/joomla.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<authorUrl>www.joomla.org</authorUrl>
<copyright>(C) 2019 Open Source Matters, Inc.</copyright>
<license>GNU General Public License version 2 or later; see LICENSE.txt</license>
<version>4.2.1-dev</version>
<version>4.2.1-rc3-dev</version>
<creationDate>2022-08</creationDate>
<description>FILES_JOOMLA_XML_DESCRIPTION</description>

Expand Down
1 change: 1 addition & 0 deletions build/build.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ function clean_checkout(string $dir)
system('rm -rf libraries/vendor/symfony/*/Resources/doc');
system('rm -rf libraries/vendor/symfony/*/Tests');
system('rm -rf libraries/vendor/symfony/console/Resources');
system('rm -rf libraries/vendor/symfony/string/Resources/bin');

// tobscure/json-api
system('rm -rf libraries/vendor/tobscure/json-api/tests');
Expand Down
Loading

0 comments on commit 30a9c9d

Please sign in to comment.