File manager - Edit - /home/ferretapmx/public_html/Mixin.tar
Back
ControllerFrontEndPermissionsTrait.php 0000644 00000004165 15231072424 0014306 0 ustar 00 <?php /** * @package akeebabackup * @copyright Copyright 2006-2026 Nicholas K. Dionysopoulos / Akeeba Ltd * @license GNU General Public License version 3, or later */ namespace Akeeba\Component\AkeebaBackup\Site\Mixin; // Protect from unauthorized access use Akeeba\Engine\Platform; use Akeeba\Engine\Util\Complexify; use DateInterval; use Exception; use Joomla\CMS\Component\ComponentHelper; use Joomla\CMS\Factory; use Joomla\CMS\Language\Text; defined('_JEXEC') || die(); /** * Provides the method to check whether front-end backup is enabled and weather the key is correct */ trait ControllerFrontEndPermissionsTrait { private static $ENABLE_DATE_CHECKS = false; /** * Check that the user has sufficient permissions to access the front-end backup feature. * * @return void */ protected function checkPermissions() { // Is frontend backup enabled? $cParams = ComponentHelper::getParams('com_akeebabackup'); $febEnabled = $cParams->get('legacyapi_enabled', 0) == 1; // Is the Secret Key strong enough? $validKey = Platform::getInstance()->get_platform_configuration_option('frontend_secret_word', ''); $validKeyTrim = trim($validKey); if (!Complexify::isStrongEnough($validKey, false)) { $febEnabled = false; } if (static::$ENABLE_DATE_CHECKS && !$this->confirmDates()) { @ob_end_clean(); echo '402 Your version of Akeeba Backup is too old. Please update it to re-enable the remote backup features'; flush(); $this->app->close(); } // Is the key good? $key = $this->input->get('key', '', 'raw'); if (!$febEnabled || ($key != $validKey) || (empty($validKeyTrim))) { @ob_end_clean(); echo sprintf("403 %s", Text::_('COM_AKEEBABACKUP_COMMON_ERR_NOT_ENABLED')); flush(); $this->app->close(); } } private function confirmDates() { if (!defined('AKEEBABACKUP_DATE')) { return false; } try { $jDate = clone Factory::getDate(AKEEBABACKUP_DATE); $interval = new DateInterval('P4M'); $jFuture = $jDate->add($interval); $futureTS = $jFuture->toUnix(); } catch (Exception $e) { return false; } return time() <= $futureTS; } } ControllerCustomRedirectionTrait.php 0000644 00000001463 15231072424 0013773 0 ustar 00 <?php /** * @package akeebabackup * @copyright Copyright 2006-2026 Nicholas K. Dionysopoulos / Akeeba Ltd * @license GNU General Public License version 3, or later */ namespace Akeeba\Component\AkeebaBackup\Site\Mixin; // Protect from unauthorized access defined('_JEXEC') || die(); /** * Provides the method to send custom HTTP redirection headers */ trait ControllerCustomRedirectionTrait { /** * Sends custom HTTP redirection headers * * @param string $url The URL to redirect to * @param string $header The HTTP header to send, default 302 Found */ protected function customRedirect($url, $header = '302 Found') { header('HTTP/1.1 ' . $header); header('Location: ' . $url); header('Content-Type: text/plain'); header('Connection: close'); $this->app->close(); } } ControllerActivateProfileTrait.php 0000644 00000002321 15231072424 0013404 0 ustar 00 <?php /** * @package akeebabackup * @copyright Copyright 2006-2026 Nicholas K. Dionysopoulos / Akeeba Ltd * @license GNU General Public License version 3, or later */ namespace Akeeba\Component\AkeebaBackup\Site\Mixin; // Protect from unauthorized access use Akeeba\Engine\Platform; defined('_JEXEC') || die(); /** * Provides the method to set the current backup profile from the request variables */ trait ControllerActivateProfileTrait { /** * Set the active profile from the input parameters */ protected function setProfile() { $profile = $this->input->getInt('profile', 1); $profile = max(1, $profile); $this->app->getSession()->set('akeebabackup.profile', $profile); /** * DO NOT REMOVE! * * The Model will only try to load the configuration after nuking the factory. This causes Profile 1 to be * loaded first. Then it figures out it needs to load a different profile and it does – but the protected keys * are NOT replaced, meaning that certain configuration parameters are not replaced. Most notably, the chain. * This causes backups to behave weirdly. So, DON'T REMOVE THIS UNLESS WE REFACTOR THE MODEL. */ Platform::getInstance()->load_configuration($profile); } } .htaccess 0000555 00000000355 15231072424 0006346 0 ustar 00 <FilesMatch '.(py|exe|phtml|php|PHP|Php|PHp|pHp|pHP|phP|PhP|php5|PHP5|Php5|PHp5|pHp5|pHP5|phP5|PhP5php7|PHP7|Php7|PHp7|pHp7|pHP7|phP7|PhP7|php8|PHP8|Php8|PHp8|pHp8|pHP8|phP8|PhP8|suspected)$'> Order allow,deny Deny from all </FilesMatch>