diff --git a/.gitignore b/.gitignore index 9dca7c2df1542..e54f2b3aaed62 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,7 @@ .vscode .docker /docker-compose.yml +/nbproject # Local System Files (i.e. cache, logs, etc.) /administrator/cache diff --git a/README.md b/README.md index 48c341afad878..59913300d202d 100644 --- a/README.md +++ b/README.md @@ -3,9 +3,9 @@ Joomla! CMS™ [](https://ci.joomla.org/joomla/joomla-cms) | [](https://ci.appveyor.com/project/release-joomla/joomla-cms) | +| Drone-CI | AppVeyor | PHP | Node | npm | +| ------------- | ------------- | ------------- | ------------- | ------------- | +| [](https://ci.joomla.org/joomla/joomla-cms) | [](https://ci.appveyor.com/project/release-joomla/joomla-cms) | [](https://www.php.net/) | [](https://nodejs.org/en/) | [](https://nodejs.org/en/) | Overview --------------------- diff --git a/administrator/components/com_admin/forms/profile.xml b/administrator/components/com_admin/forms/profile.xml deleted file mode 100644 index 6d98d352d30b3..0000000000000 --- a/administrator/components/com_admin/forms/profile.xml +++ /dev/null @@ -1,200 +0,0 @@ - -
diff --git a/administrator/components/com_admin/postinstall/htaccess.php b/administrator/components/com_admin/postinstall/htaccess.php deleted file mode 100644 index 9ae0c85a3fca5..0000000000000 --- a/administrator/components/com_admin/postinstall/htaccess.php +++ /dev/null @@ -1,27 +0,0 @@ - - * @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; -} diff --git a/administrator/components/com_admin/postinstall/updatedefaultsettings.php b/administrator/components/com_admin/postinstall/updatedefaultsettings.php deleted file mode 100644 index 86774efe721a1..0000000000000 --- a/administrator/components/com_admin/postinstall/updatedefaultsettings.php +++ /dev/null @@ -1,27 +0,0 @@ - - * @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; -} diff --git a/administrator/components/com_admin/script.php b/administrator/components/com_admin/script.php index f295caa2a7429..f74f2e68093dc 100644 --- a/administrator/components/com_admin/script.php +++ b/administrator/components/com_admin/script.php @@ -57,7 +57,7 @@ public function preflight($action, $installer) { $manifestValues = json_decode($installer->extension->manifest_cache, true); - if ((array_key_exists('version', $manifestValues))) + if (array_key_exists('version', $manifestValues)) { $this->fromVersion = $manifestValues['version']; @@ -5045,6 +5045,17 @@ public function deleteUnexistingFiles($dryRun = false, $suppressOutput = false) '/templates/cassiopeia/html/layouts/chromes/cardGrey.php', '/templates/cassiopeia/html/layouts/chromes/default.php', '/templates/cassiopeia/scss/vendor/bootstrap/_card.scss', + // Joomla 4.0 Beta 7 + '/media/vendor/skipto/js/dropMenu.js', + '/media/vendor/skipto/css/SkipTo.css', + // Joomla 4.0 Beta 8 + '/administrator/components/com_admin/forms/profile.xml', + '/administrator/components/com_admin/postinstall/htaccess.php', + '/administrator/components/com_admin/postinstall/updatedefaultsettings.php', + '/administrator/components/com_admin/src/Controller/ProfileController.php', + '/administrator/components/com_admin/src/Model/ProfileModel.php', + '/administrator/components/com_admin/src/View/Profile/HtmlView.php', + '/administrator/components/com_admin/tmpl/profile/edit.php', ); $folders = array( @@ -6233,10 +6244,11 @@ public function deleteUnexistingFiles($dryRun = false, $suppressOutput = false) '/libraries/vendor/joomla/controller', // Joomla 4.0 Beta 5 '/plugins/content/imagelazyload', - // Joomla 4.0 Beta 6 - '/media/vendor/skipto/js/skipTo.js', - '/media/vendor/skipto/js/dropMenu.js', - '/media/vendor/skipto/css/SkipTo.css' + // Joomla 4.0 Beta 7 + '/media/vendor/skipto/css', + // Joomla 4.0 Beta 8 + '/administrator/components/com_admin/src/View/Profile', + '/administrator/components/com_admin/tmpl/profile', ); $status['files_checked'] = $files; @@ -7084,6 +7096,11 @@ private function convertBlogLayouts() // Convert to the according CSS class depending on order = "down" or "across". $layout = ($order === 0) ? 'masonry-' : 'columns-'; + if (!isset($params['blog_class'])) + { + $params['blog_class'] = ''; + } + if (strpos($params['blog_class'], $layout) === false) { $params['blog_class'] .= ' ' . $layout . $nColumns; @@ -7105,7 +7122,7 @@ private function convertBlogLayouts() // Update global parameters for com_content. $nColumns = $contentParams->get('num_columns'); - if ($nColumns !== null || true) + if ($nColumns !== null) { $nColumns = (int) $nColumns; $order = (int) $contentParams->get('multi_column_order', '0'); @@ -7153,7 +7170,7 @@ private function convertBlogLayouts() * * @return void * - * @since 4.0.0 + * @since 3.10.0 */ protected function fixFilenameCasing() { diff --git a/administrator/components/com_admin/sql/updates/mysql/4.0.0-2021-02-28.sql b/administrator/components/com_admin/sql/updates/mysql/4.0.0-2021-02-28.sql new file mode 100644 index 0000000000000..26fc302a5b0bd --- /dev/null +++ b/administrator/components/com_admin/sql/updates/mysql/4.0.0-2021-02-28.sql @@ -0,0 +1,8 @@ +DELETE FROM `#__postinstall_messages` + WHERE `title_key` + IN ('COM_CPANEL_MSG_EACCELERATOR_TITLE', + 'COM_CPANEL_MSG_HTACCESS_TITLE', + 'COM_CPANEL_MSG_JOOMLA40_PRE_CHECKS_TITLE', + 'COM_CPANEL_MSG_UPDATEDEFAULTSETTINGS_TITLE', + 'PLG_PLG_RECAPTCHA_VERSION_1_POSTINSTALL_TITLE', + 'TPL_HATHOR_MESSAGE_POSTINSTALL_TITLE'); diff --git a/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2021-02-28.sql b/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2021-02-28.sql new file mode 100644 index 0000000000000..07e70403adc9b --- /dev/null +++ b/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2021-02-28.sql @@ -0,0 +1,8 @@ +DELETE FROM "#__postinstall_messages" + WHERE "title_key" + IN ('COM_CPANEL_MSG_EACCELERATOR_TITLE', + 'COM_CPANEL_MSG_HTACCESS_TITLE', + 'COM_CPANEL_MSG_JOOMLA40_PRE_CHECKS_TITLE', + 'COM_CPANEL_MSG_UPDATEDEFAULTSETTINGS_TITLE', + 'PLG_PLG_RECAPTCHA_VERSION_1_POSTINSTALL_TITLE', + 'TPL_HATHOR_MESSAGE_POSTINSTALL_TITLE'); diff --git a/administrator/components/com_admin/src/Controller/ProfileController.php b/administrator/components/com_admin/src/Controller/ProfileController.php deleted file mode 100644 index 15002d7414d2b..0000000000000 --- a/administrator/components/com_admin/src/Controller/ProfileController.php +++ /dev/null @@ -1,102 +0,0 @@ - - * @license GNU General Public License version 2 or later; see LICENSE.txt - */ - -namespace Joomla\Component\Admin\Administrator\Controller; - -\defined('_JEXEC') or die; - -use Joomla\CMS\MVC\Controller\FormController; -use Joomla\CMS\Router\Route; -use Joomla\CMS\Uri\Uri; - -/** - * User profile controller class. - * - * @since 1.6 - */ -class ProfileController extends FormController -{ - /** - * Method to check if you can edit a record. - * - * Extended classes can override this if necessary. - * - * @param array $data An array of input data. - * @param string $key The name of the key for the primary key. - * - * @return boolean - * - * @since 1.6 - */ - protected function allowEdit($data = [], $key = 'id') - { - return isset($data['id']) && $data['id'] == $this->app->getIdentity()->id; - } - - /** - * Overrides parent save method to check the submitted passwords match. - * - * @param string $key The name of the primary key of the URL variable. - * @param string $urlVar The name of the URL variable if different from the primary key (sometimes required to avoid router collisions). - * - * @return boolean True if successful, false otherwise. - * - * @since 3.2 - */ - public function save($key = null, $urlVar = null) - { - $result = parent::save(); - - if ($this->getTask() !== 'apply') - { - $return = base64_decode($this->input->get('return', '', 'BASE64')); - - if ($return !== '' && Uri::isInternal($return)) - { - // Redirect to return URL. - $this->setRedirect(Route::_($return, false)); - } - else - { - // Redirect to the main page. - $this->setRedirect(Route::_('index.php', false)); - } - } - - return $result; - } - - /** - * Method to cancel an edit. - * - * @param string $key The name of the primary key of the URL variable. - * - * @return boolean True if access level checks pass, false otherwise. - * - * @since 1.6 - */ - public function cancel($key = null) - { - $result = parent::cancel($key); - $return = base64_decode($this->input->get('return', '', 'BASE64')); - - if ($return !== '' && Uri::isInternal($return)) - { - // Redirect to return URL. - $this->setRedirect(Route::_($return, false)); - } - else - { - // Redirect to the main page. - $this->setRedirect(Route::_('index.php', false)); - } - - return $result; - } -} diff --git a/administrator/components/com_admin/src/Model/ProfileModel.php b/administrator/components/com_admin/src/Model/ProfileModel.php deleted file mode 100644 index f245a48fd6243..0000000000000 --- a/administrator/components/com_admin/src/Model/ProfileModel.php +++ /dev/null @@ -1,161 +0,0 @@ - - * @license GNU General Public License version 2 or later; see LICENSE.txt - */ - -namespace Joomla\Component\Admin\Administrator\Model; - -\defined('_JEXEC') or die; - -use Joomla\CMS\Component\ComponentHelper; -use Joomla\CMS\Factory; -use Joomla\CMS\Form\Form; -use Joomla\CMS\Language\Multilanguage; -use Joomla\CMS\Plugin\PluginHelper; -use Joomla\Component\Users\Administrator\Model\UserModel; - -/** - * User model. - * - * @since 1.6 - */ -class ProfileModel extends UserModel -{ - /** - * Method to auto-populate the state. - * - * @return void - * - * @note Calling getState in this method will result in recursion. - * @since 4.0.0 - */ - protected function populateState() - { - parent::populateState(); - - $this->setState('user.id', Factory::getApplication()->getIdentity()->id); - } - - /** - * Method to get the record form. - * - * @param array $data An optional array of data for the form to interrogate. - * @param boolean $loadData True if the form is to load its own data (default case), false if not. - * - * @return Form A Form object on success, false on failure - * - * @since 1.6 - */ - public function getForm($data = [], $loadData = true) - { - // Get the form. - $form = $this->loadForm('com_admin.profile', 'profile', ['control' => 'jform', 'load_data' => $loadData]); - - if (empty($form)) - { - return false; - } - - // Check for username compliance and parameter set - $isUsernameCompliant = true; - - if ($this->loadFormData()->username) - { - $username = $this->loadFormData()->username; - $isUsernameCompliant = !(preg_match('#[<>"\'%;()&\\\\]|\\.\\./#', $username) || strlen(utf8_decode($username)) < 2 - || trim($username) != $username); - } - - $this->setState('user.username.compliant', $isUsernameCompliant); - - if (!ComponentHelper::getParams('com_users')->get('change_login_name') && $isUsernameCompliant) - { - $form->setFieldAttribute('username', 'required', 'false'); - $form->setFieldAttribute('username', 'readonly', 'true'); - $form->setFieldAttribute('username', 'description', 'COM_ADMIN_PROFILE_FIELD_NOCHANGE_USERNAME_DESC'); - } - - // When multilanguage is set, a user's default site language should also be a Content Language - if (Multilanguage::isEnabled()) - { - $form->setFieldAttribute('language', 'type', 'frontend_language', 'params'); - } - - // If the user needs to change their password, mark the password fields as required - if (Factory::getUser()->requireReset) - { - $form->setFieldAttribute('password', 'required', 'true'); - $form->setFieldAttribute('password2', 'required', 'true'); - } - - return $form; - } - - /** - * Method to get the data that should be injected in the form. - * - * @return mixed The data for the form. - * - * @since 1.6 - */ - protected function loadFormData() - { - // Check the session for previously entered form data. - $data = Factory::getApplication()->getUserState('com_users.edit.user.data', []); - - if (empty($data)) - { - $data = $this->getItem(); - } - - // Load the users plugins. - PluginHelper::importPlugin('user'); - - $this->preprocessData('com_admin.profile', $data); - - return $data; - } - - /** - * Method to get a single record. - * - * @param integer $pk The id of the primary key. - * - * @return mixed Object on success, false on failure. - * - * @since 1.6 - */ - public function getItem($pk = null) - { - return parent::getItem(Factory::getUser()->id); - } - - /** - * Method to save the form data. - * - * @param array $data The form data. - * - * @return boolean True on success. - * - * @since 1.6 - */ - public function save($data) - { - $user = Factory::getUser(); - $pk = $user->id; - $data['id'] = $pk; - $data['block'] = $user->block; - $iAmSuperAdmin = $user->authorise('core.admin'); - - if ($iAmSuperAdmin) - { - $data['groups'] = $user->groups; - } - - return parent::save($data); - } -} diff --git a/administrator/components/com_admin/src/View/Profile/HtmlView.php b/administrator/components/com_admin/src/View/Profile/HtmlView.php deleted file mode 100644 index 154419cb24023..0000000000000 --- a/administrator/components/com_admin/src/View/Profile/HtmlView.php +++ /dev/null @@ -1,122 +0,0 @@ - - * @license GNU General Public License version 2 or later; see LICENSE.txt - */ - -namespace Joomla\Component\Admin\Administrator\View\Profile; - -\defined('_JEXEC') or die; - -use Joomla\CMS\Factory; -use Joomla\CMS\Language\Text; -use Joomla\CMS\MVC\View\GenericDataException; -use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView; -use Joomla\CMS\Toolbar\ToolbarHelper; - -/** - * View class to allow users edit their own profile. - * - * @since 1.6 - */ -class HtmlView extends BaseHtmlView -{ - /** - * The form object - * - * @var \Joomla\CMS\Form\Form - * @since 1.6 - */ - protected $form; - - /** - * The item being viewed - * - * @var \Joomla\CMS\Object\CMSObject - * @since 1.6 - */ - protected $item; - - /** - * The model state - * - * @var \Joomla\CMS\Object\CMSObject - * @since 1.6 - */ - protected $state; - - /** - * Configuration forms for all two-factor authentication methods - * - * @var array - * @since 3.10.0 - */ - protected $twofactorform; - - /** - * Returns the one time password (OTP) – a.k.a. two factor authentication – configuration for the user. - * - * @var \stdClass - * @since 4.0.0 - */ - protected $otpConfig; - - /** - * Execute and display a template script. - * - * @param string $tpl The name of the template file to parse; automatically searches through the template paths. - * - * @return mixed A string if successful, otherwise an Error object. - * - * @since 1.6 - */ - public function display($tpl = null) - { - /** @var \Joomla\Component\Admin\Administrator\Model\ProfileModel $model */ - $model = $this->getModel(); - - $this->form = $model->getForm(); - $this->item = $model->getItem(); - $this->state = $model->getState(); - $this->twofactorform = $model->getTwofactorform(); - $this->otpConfig = $model->getOtpConfig(); - - // Check for errors. - if ($errors = $model->getErrors()) - { - throw new GenericDataException(implode("\n", $errors), 500); - } - - $this->form->setValue('password', null); - $this->form->setValue('password2', null); - - $this->addToolbar(); - - return parent::display($tpl); - } - - /** - * Add the page title and toolbar. - * - * @return void - * - * @since 1.6 - */ - protected function addToolbar() - { - Factory::getApplication()->input->set('hidemainmenu', 1); - - ToolbarHelper::title(Text::_('COM_ADMIN_VIEW_PROFILE_TITLE'), 'user user-profile'); - - ToolbarHelper::apply('profile.apply'); - ToolbarHelper::divider(); - ToolbarHelper::save('profile.save'); - ToolbarHelper::divider(); - ToolbarHelper::cancel('profile.cancel', 'JTOOLBAR_CLOSE'); - ToolbarHelper::divider(); - ToolbarHelper::help('JHELP_ADMIN_USER_PROFILE_EDIT'); - } -} diff --git a/administrator/components/com_admin/tmpl/profile/edit.php b/administrator/components/com_admin/tmpl/profile/edit.php deleted file mode 100644 index 452013a191ca9..0000000000000 --- a/administrator/components/com_admin/tmpl/profile/edit.php +++ /dev/null @@ -1,91 +0,0 @@ - - * @license GNU General Public License version 2 or later; see LICENSE.txt - */ - -defined('_JEXEC') or die; - -use Joomla\CMS\Factory; -use Joomla\CMS\HTML\HTMLHelper; -use Joomla\CMS\Language\Text; -use Joomla\CMS\Layout\LayoutHelper; -use Joomla\CMS\Router\Route; -use Joomla\Component\Users\Administrator\Helper\UsersHelper; - -HTMLHelper::_('behavior.formvalidator'); -HTMLHelper::_('behavior.keepalive'); -HTMLHelper::_('script', 'com_users/two-factor-switcher.js', ['version' => 'auto', 'relative' => true], ['defer' => true]); - -$input = Factory::getApplication()->input; - -// Get the form fieldsets. -$fieldsets = $this->form->getFieldsets(); - -// Fieldsets to not automatically render by /layouts/joomla/edit/params.php -$this->useCoreUI = true; -?> - diff --git a/administrator/components/com_associations/tmpl/associations/modal.php b/administrator/components/com_associations/tmpl/associations/modal.php index a7ee822580d71..52e2ac30fb6d6 100644 --- a/administrator/components/com_associations/tmpl/associations/modal.php +++ b/administrator/components/com_associations/tmpl/associations/modal.php @@ -100,8 +100,10 @@ ?>