Skip to content
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion administrator/components/com_admin/script.php
Original file line number Diff line number Diff line change
Expand Up @@ -6371,7 +6371,6 @@ public function deleteUnexistingFiles($dryRun = false, $suppressOutput = false)

if ($dryRun === false)
{
// TODO There is an issue while deleting folders using the ftp mode
if (Folder::delete(JPATH_ROOT . $folder))
{
$status['folders_deleted'][] = $folder;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ public function &getConfig(): array
$registry = new Registry(new \JConfig);
$this->config = $registry->toArray();
$hidden = [
'host', 'user', 'password', 'ftp_user', 'ftp_pass',
'host', 'user', 'password',
'smtpuser', 'smtppass', 'redis_server_auth', 'session_redis_server_auth',
'proxy_user', 'proxy_pass', 'secret'
];
Expand Down
67 changes: 0 additions & 67 deletions administrator/components/com_config/forms/application.xml
Original file line number Diff line number Diff line change
Expand Up @@ -373,73 +373,6 @@
/>
</fieldset>

<fieldset name="ftp" label="CONFIG_FTP_SETTINGS_LABEL">

<field
name="ftp_enable"
type="radio"
label="COM_CONFIG_FIELD_FTP_ENABLE_LABEL"
layout="joomla.form.field.radio.switcher"
default="0"
filter="boolean"
>
<option value="0">JNO</option>
<option value="1">JYES</option>
</field>

<field
name="ftp_host"
type="text"
label="COM_CONFIG_FIELD_FTP_HOST_LABEL"
filter="string"
showon="ftp_enable:1"
size="14"
/>

<field
name="ftp_port"
type="number"
label="COM_CONFIG_FIELD_FTP_PORT_LABEL"
showon="ftp_enable:1"
min="1"
max="65535"
hint="21"
validate="number"
filter="integer"
/>

<field
name="ftp_user"
type="text"
label="COM_CONFIG_FIELD_FTP_USERNAME_LABEL"
filter="string"
showon="ftp_enable:1"
autocomplete="off"
size="25"
/>

<field
name="ftp_pass"
type="password"
label="COM_CONFIG_FIELD_FTP_PASSWORD_LABEL"
filter="raw"
showon="ftp_enable:1"
autocomplete="off"
size="25"
lock="true"
/>

<field
name="ftp_root"
type="text"
label="COM_CONFIG_FIELD_FTP_ROOT_LABEL"
showon="ftp_enable:1"
filter="string"
size="50"
/>

</fieldset>

<fieldset
name="proxy"
label="CONFIG_PROXY_SETTINGS_LABEL">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
\defined('_JEXEC') or die;

use Joomla\CMS\Application\CMSApplication;
use Joomla\CMS\Client\ClientHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\MVC\Controller\BaseController;
use Joomla\CMS\MVC\Factory\MVCFactoryInterface;
Expand Down Expand Up @@ -82,9 +81,6 @@ public function save()

$this->app->setUserState('com_config.config.global.data', null);

// Set FTP credentials, if given.
ClientHelper::setCredentialsFromRequest('ftp');

/** @var \Joomla\Component\Config\Administrator\Model\ApplicationModel $model */
$model = $this->getModel('Application', 'Administrator');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
\defined('_JEXEC') or die;

use Joomla\CMS\Application\CMSApplication;
use Joomla\CMS\Client\ClientHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\MVC\Controller\FormController;
use Joomla\CMS\MVC\Factory\MVCFactoryInterface;
Expand Down Expand Up @@ -62,9 +61,6 @@ public function save($key = null, $urlVar = null)
// Check for request forgeries.
$this->checkToken();

// Set FTP credentials, if given.
ClientHelper::setCredentialsFromRequest('ftp');

$data = $this->input->get('jform', [], 'ARRAY');
$id = $this->input->get('id', null, 'INT');
$option = $this->input->get('component');
Expand Down
22 changes: 5 additions & 17 deletions administrator/components/com_config/src/Model/ApplicationModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
use Joomla\CMS\Access\Rules;
use Joomla\CMS\Cache\Exception\CacheConnectingException;
use Joomla\CMS\Cache\Exception\UnsupportedCacheException;
use Joomla\CMS\Client\ClientHelper;
use Joomla\CMS\Component\ComponentHelper;
use Joomla\CMS\Factory;
use Joomla\CMS\Filesystem\File;
Expand Down Expand Up @@ -50,7 +49,7 @@ class ApplicationModel extends FormModel
* @var array
* @since 3.9.23
*/
private $protectedConfigurationFields = array('password', 'secret', 'ftp_pass', 'smtppass', 'redis_server_auth', 'session_redis_server_auth');
private $protectedConfigurationFields = array('password', 'secret', 'smtppass', 'redis_server_auth', 'session_redis_server_auth');

/**
* Method to get a form object.
Expand Down Expand Up @@ -861,14 +860,6 @@ public function save($data)
$app->set('cors_allow_headers', $data['cors_allow_headers']);
$app->set('cors_allow_methods', $data['cors_allow_methods']);

// Overwrite the old FTP credentials with the new ones.
$app->set('ftp_enable', $data['ftp_enable']);
$app->set('ftp_host', $data['ftp_host']);
$app->set('ftp_port', $data['ftp_port']);
$app->set('ftp_user', $data['ftp_user']);
$app->set('ftp_pass', $data['ftp_pass']);
$app->set('ftp_root', $data['ftp_root']);

// Clear cache of com_config component.
$this->cleanCache('_system', 0);
$this->cleanCache('_system', 1);
Expand Down Expand Up @@ -944,13 +935,10 @@ private function writeConfigFile(Registry $config)
// Set the configuration file path.
$file = JPATH_CONFIGURATION . '/configuration.php';

// Get the new FTP credentials.
$ftp = ClientHelper::getCredentials('ftp', true);

$app = Factory::getApplication();

// Attempt to make the file writeable if using FTP.
if (!$ftp['enabled'] && Path::isOwner($file) && !Path::setPermissions($file, '0644'))
// Attempt to make the file writeable.
if (Path::isOwner($file) && !Path::setPermissions($file, '0644'))
{
$app->enqueueMessage(Text::_('COM_CONFIG_ERROR_CONFIGURATION_PHP_NOTWRITABLE'), 'notice');
}
Expand All @@ -969,8 +957,8 @@ private function writeConfigFile(Registry $config)
\opcache_invalidate($file);
}

// Attempt to make the file unwriteable if NOT using FTP.
if (!$ftp['enabled'] && Path::isOwner($file) && !Path::setPermissions($file, '0444'))
// Attempt to make the file unwriteable.
if (Path::isOwner($file) && !Path::setPermissions($file, '0444'))
{
$app->enqueueMessage(Text::_('COM_CONFIG_ERROR_CONFIGURATION_PHP_NOTUNWRITABLE'), 'notice');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

\defined('_JEXEC') or die;

use Joomla\CMS\Client\ClientHelper;
use Joomla\CMS\Component\ComponentHelper;
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
Expand Down Expand Up @@ -91,12 +90,8 @@ public function display($tpl = null)
// Get the params for com_media.
$mediaParams = ComponentHelper::getParams('com_media');

// Load settings for the FTP layer.
$ftp = ClientHelper::setCredentialsFromRequest('ftp');

$this->form = &$form;
$this->data = &$data;
$this->ftp = &$ftp;
$this->usersParams = &$usersParams;
$this->mediaParams = &$mediaParams;
$this->components = ConfigHelper::getComponentsWithConfig();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@
<?php echo $this->loadTemplate('server'); ?>
<?php echo $this->loadTemplate('locale'); ?>
<?php echo $this->loadTemplate('webservices'); ?>
<?php echo $this->loadTemplate('ftp'); ?>
<?php echo $this->loadTemplate('proxy'); ?>
<?php echo $this->loadTemplate('database'); ?>
<?php echo $this->loadTemplate('mail'); ?>
Expand All @@ -72,12 +71,6 @@
<?php echo $this->loadTemplate('filters'); ?>
<?php echo HTMLHelper::_('uitab.endTab'); ?>

<?php if ($this->ftp) : ?>
<?php echo HTMLHelper::_('uitab.addTab', 'configTabs', 'page-ftp', Text::_('COM_CONFIG_FTP_SETTINGS')); ?>
<?php echo $this->loadTemplate('ftplogin'); ?>
<?php echo HTMLHelper::_('uitab.endTab'); ?>
<?php endif; ?>

<?php echo HTMLHelper::_('uitab.addTab', 'configTabs', 'page-permissions', Text::_('COM_CONFIG_PERMISSIONS')); ?>
<?php echo $this->loadTemplate('permissions'); ?>
<?php echo HTMLHelper::_('uitab.endTab'); ?>
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

\defined('_JEXEC') or die;

use Joomla\CMS\Client\ClientHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\MVC\Controller\BaseController;
use Joomla\CMS\Response\JsonResponse;
Expand Down Expand Up @@ -62,9 +61,6 @@ public function display($cachable = false, $urlparams = false)
// Get and render the view.
if ($view = $this->getView($vName, $vFormat))
{
$ftp = ClientHelper::setCredentialsFromRequest('ftp');
$view->ftp = &$ftp;

// Get the model for the view.
$model = $this->getModel($vName);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

\defined('_JEXEC') or die;

use Joomla\CMS\Client\ClientHelper;
use Joomla\CMS\Factory;
use Joomla\CMS\Filesystem\File;
use Joomla\CMS\Filesystem\Path;
Expand Down Expand Up @@ -80,8 +79,6 @@ public function install()
{
$this->setState('action', 'install');

// Set FTP credentials, if given.
ClientHelper::setCredentialsFromRequest('ftp');
$app = Factory::getApplication();

// Load installer plugins for assistance if required:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@
<?php if ($this->showMessage) : ?>
<?php echo $this->loadTemplate('message'); ?>
<?php endif; ?>
<?php if ($this->ftp) : ?>
<?php echo $this->loadTemplate('ftp'); ?>
<?php endif; ?>
<?php echo LayoutHelper::render('joomla.searchtools.default', array('view' => $this)); ?>
<?php if (empty($this->items)) : ?>
<div class="alert alert-info">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
</div>
<?php endif; ?>

<?php if ($tabs || $this->ftp) : ?>
<?php if ($tabs) : ?>
<?php echo HTMLHelper::_('uitab.startTabSet', 'myTab', ['active' => $tabs[0]['name'] ?? '']); ?>
<?php // Show installation tabs ?>
<?php foreach ($tabs as $tab) : ?>
Expand All @@ -61,11 +61,6 @@
<?php echo HTMLHelper::_('uitab.endTab'); ?>
<?php endforeach; ?>

<?php if ($this->ftp) : ?>
<?php echo HTMLHelper::_('uitab.addTab', 'myTab', 'ftp', Text::_('COM_INSTALLER_MSG_DESCFTPTITLE')); ?>
<?php echo $this->loadTemplate('ftp'); ?>
<?php echo HTMLHelper::_('uitab.endTab'); ?>
<?php endif; ?>
<?php echo HTMLHelper::_('uitab.endTabSet'); ?>
<?php endif; ?>

Expand Down
Loading