Server IP : 1.179.227.78 / Your IP : 10.104.4.41 Web Server : Apache System : Linux afdc-mdu34 5.4.0-153-generic #170-Ubuntu SMP Fri Jun 16 13:43:31 UTC 2023 x86_64 User : www ( 1001) PHP Version : 7.4.30 Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /www/wwwroot/afdc-mdu34.rtarf.mi.th/joomla/tmp/install_5b8cf56deccbf/backend/Model/Mixin/ |
Upload File : |
<?php /** * @package AkeebaBackup * @copyright Copyright (c)2006-2018 Nicholas K. Dionysopoulos / Akeeba Ltd * @license GNU General Public License version 3, or later */ namespace Akeeba\Backup\Admin\Model\Mixin; // Protect from unauthorized access defined('_JEXEC') or die(); use JClientFtp; use JClientHelper; use JLoader; use JPath; trait Chmod { /** * 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 JLoader::import('joomla.client.helper'); $ftpOptions = JClientHelper::getCredentials('ftp'); // Check to make sure the path valid and clean $path = JPath::clean($path); if (@chmod($path, $mode)) { $ret = true; } elseif ($ftpOptions['enabled'] == 1) { // Connect the FTP client JLoader::import('joomla.client.ftp'); $ftp = JClientFtp::getInstance( $ftpOptions['host'], $ftpOptions['port'], array(), $ftpOptions['user'], $ftpOptions['pass'] ); // Translate path and delete $path = JPath::clean(str_replace(JPATH_ROOT, $ftpOptions['root'], $path), '/'); // FTP connector throws an error $ret = $ftp->chmod($path, $mode); } else { $ret = false; } return $ret; } }