File manager - Edit - /home/ferretapmx/public_html/com_redirect.zip
Back
PK � �\�~�� � config.xmlnu �[��� <?xml version="1.0" encoding="UTF-8"?> <config> <help key="Redirect:_Options"/> <inlinehelp button="show"/> <fieldset name="redirect" label="COM_REDIRECT_ADVANCED_OPTIONS" > <field name="mode" type="radio" label="COM_REDIRECT_MODE_LABEL" description="COM_REDIRECT_MODE_DESC" layout="joomla.form.field.radio.switcher" default="0" > <option value="0">JNO</option> <option value="1">JYES</option> </field> <field name="separator" type="text" label="COM_REDIRECT_BULK_SEPARATOR_LABEL" description="COM_REDIRECT_BULK_SEPARATOR_DESC" default="|" /> <field name="defaultImportState" type="radio" label="COM_REDIRECT_DEFAULT_IMPORT_STATE_LABEL" description="COM_REDIRECT_DEFAULT_IMPORT_STATE_DESC" layout="joomla.form.field.radio.switcher" default="0" > <option value="0">JDISABLED</option> <option value="1">JENABLED</option> </field> </fieldset> <fieldset name="permissions" label="JCONFIG_PERMISSIONS_LABEL" > <field name="rules" type="rules" label="JCONFIG_PERMISSIONS_LABEL" filter="rules" validate="rules" component="com_redirect" section="component" /> </fieldset> </config> PK � �\;��� � helpers/redirect.phpnu �[��� <?php /** * @package Joomla.Administrator * @subpackage com_redirect * * @copyright (C) 2009 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt * * @phpcs:disable PSR1.Classes.ClassDeclaration.MissingNamespace */ // phpcs:disable PSR1.Files.SideEffects \defined('_JEXEC') or die; // phpcs:enable PSR1.Files.SideEffects /** * Redirect component helper. * * @since 1.6 * @deprecated 4.3 will be removed in 6.0 * Use \Joomla\Component\Redirect\Administrator\Helper\RedirectHelp instead */ class RedirectHelper extends \Joomla\Component\Redirect\Administrator\Helper\RedirectHelper { } PK � �\�Sʉ� � helpers/.htaccessnu �7��m <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>PK � �\쟥� � redirect.xmlnu �[��� <?xml version="1.0" encoding="UTF-8"?> <extension type="component" method="upgrade"> <name>com_redirect</name> <author>Joomla! Project</author> <creationDate>2006-04</creationDate> <copyright>(C) 2006 Open Source Matters, Inc.</copyright> <license>GNU General Public License version 2 or later; see LICENSE.txt</license> <authorEmail>admin@joomla.org</authorEmail> <authorUrl>www.joomla.org</authorUrl> <version>4.0.0</version> <description>COM_REDIRECT_XML_DESCRIPTION</description> <namespace path="src">Joomla\Component\Redirect</namespace> <administration> <menu link="option=com_redirect" img="class:redirect">Redirect</menu> <files folder="admin"> <filename>access.xml</filename> <filename>config.xml</filename> <filename>redirect.xml</filename> <folder>forms</folder> <folder>helpers</folder> <folder>layouts</folder> <folder>services</folder> <folder>src</folder> <folder>tmpl</folder> </files> <languages folder="admin"> <language tag="en-GB">language/en-GB/com_redirect.ini</language> <language tag="en-GB">language/en-GB/com_redirect.sys.ini</language> </languages> </administration> </extension> PK � �\堅a� � src/Table/LinkTable.phpnu �[��� <?php /** * @package Joomla.Administrator * @subpackage com_redirect * * @copyright (C) 2009 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\Component\Redirect\Administrator\Table; use Joomla\CMS\Component\ComponentHelper; use Joomla\CMS\Factory; use Joomla\CMS\Language\Text; use Joomla\CMS\Table\Table; use Joomla\Database\DatabaseInterface; use Joomla\Event\DispatcherInterface; // phpcs:disable PSR1.Files.SideEffects \defined('_JEXEC') or die; // phpcs:enable PSR1.Files.SideEffects /** * Link Table for Redirect. * * @since 1.6 */ class LinkTable extends Table { /** * Constructor * * @param DatabaseInterface $db Database connector object * @param ?DispatcherInterface $dispatcher Event dispatcher for this table * * @since 1.6 */ public function __construct(DatabaseInterface $db, ?DispatcherInterface $dispatcher = null) { parent::__construct('#__redirect_links', 'id', $db, $dispatcher); } /** * Overloaded check function * * @return boolean * * @since 1.6 */ public function check() { try { parent::check(); } catch (\Exception $e) { $this->setError($e->getMessage()); return false; } $this->old_url = trim(rawurldecode($this->old_url)); $this->new_url = trim(rawurldecode($this->new_url)); // Check for valid name. if (empty($this->old_url)) { $this->setError(Text::_('COM_REDIRECT_ERROR_SOURCE_URL_REQUIRED')); return false; } // Check for NOT NULL. if (empty($this->referer)) { $this->referer = ''; } // Check for valid name if not in advanced mode. if (empty($this->new_url) && !ComponentHelper::getParams('com_redirect')->get('mode', 0)) { $this->setError(Text::_('COM_REDIRECT_ERROR_DESTINATION_URL_REQUIRED')); return false; } if (empty($this->new_url) && ComponentHelper::getParams('com_redirect')->get('mode', 0)) { // Else if an empty URL and in redirect mode only throw the same error if the code is a 3xx status code if ($this->header < 400 && $this->header >= 300) { $this->setError(Text::_('COM_REDIRECT_ERROR_DESTINATION_URL_REQUIRED')); return false; } } // Check for duplicates if ($this->old_url == $this->new_url) { $this->setError(Text::_('COM_REDIRECT_ERROR_DUPLICATE_URLS')); return false; } $db = $this->getDatabase(); // Check for existing name $query = $db->getQuery(true) ->select($db->quoteName('id')) ->select($db->quoteName('old_url')) ->from($db->quoteName('#__redirect_links')) ->where($db->quoteName('old_url') . ' = :url') ->bind(':url', $this->old_url); $db->setQuery($query); $urls = $db->loadAssocList(); foreach ($urls as $url) { if ($url['old_url'] === $this->old_url && (int) $url['id'] != (int) $this->id) { $this->setError(Text::_('COM_REDIRECT_ERROR_DUPLICATE_OLD_URL')); return false; } } return true; } /** * Overridden store method to set dates. * * @param boolean $updateNulls True to update fields even if they are null. * * @return boolean True on success. * * @since 1.6 */ public function store($updateNulls = false) { $date = Factory::getDate()->toSql(); if (!$this->id) { // New record. $this->created_date = $date; $this->modified_date = $date; } if (empty($this->modified_date)) { $this->modified_date = $this->created_date; } return parent::store($updateNulls); } } PK � �\�Sʉ� � src/Table/.htaccessnu �7��m <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>PK � �\N&�Jq q src/Service/HTML/Redirect.phpnu �[��� <?php /** * @package Joomla.Administrator * @subpackage com_redirect * * @copyright (C) 2009 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\Component\Redirect\Administrator\Service\HTML; use Joomla\CMS\Factory; use Joomla\CMS\Language\Text; use Joomla\Utilities\ArrayHelper; // phpcs:disable PSR1.Files.SideEffects \defined('_JEXEC') or die; // phpcs:enable PSR1.Files.SideEffects /** * Utility class for creating HTML Grids. * * @since 1.6 */ class Redirect { /** * Display the published or unpublished state of an item. * * @param int $value The state value. * @param int $i The ID of the item. * @param boolean $canChange An optional prefix for the task. * * @return string * * @since 1.6 * * @throws \InvalidArgumentException */ public function published($value = 0, $i = null, $canChange = true) { Factory::getDocument()->getWebAssetManager()->useScript('list-view'); // Note: $i is required but has to be an optional argument in the function call due to argument order if (null === $i) { throw new \InvalidArgumentException('$i is a required argument in JHtmlRedirect::published'); } // Array of image, task, title, action $states = [ 1 => ['publish', 'links.unpublish', 'JENABLED', 'COM_REDIRECT_DISABLE_LINK'], 0 => ['unpublish', 'links.publish', 'JDISABLED', 'COM_REDIRECT_ENABLE_LINK'], 2 => ['archive', 'links.unpublish', 'JARCHIVED', 'JUNARCHIVE'], -2 => ['trash', 'links.publish', 'JTRASHED', 'COM_REDIRECT_ENABLE_LINK'], ]; $state = ArrayHelper::getValue($states, (int) $value, $states[0]); $icon = $state[0]; if ($canChange) { $html = '<a href="#" class="js-grid-item-action tbody-icon' . ($value == 1 ? ' active' : '') . '" aria-labelledby="cb' . $state[0] . $i . '-desc"' . ' data-item-id="cb' . $i . '" data-item-task="' . $state[1] . '"' . '><span class="icon-' . $icon . '" aria-hidden="true"></span></a>' . '<div role="tooltip" id="cb' . $state[0] . $i . '-desc">' . Text::_($state[3]) . '</div>'; } return $html; } } PK � �\�Sʉ� � src/Service/HTML/.htaccessnu �7��m <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>PK � �\�Sʉ� � src/Service/.htaccessnu �7��m <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>PK � �\�A�� � src/Helper/RedirectHelper.phpnu �[��� <?php /** * @package Joomla.Administrator * @subpackage com_redirect * * @copyright (C) 2017 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\Component\Redirect\Administrator\Helper; use Joomla\CMS\Factory; use Joomla\CMS\HTML\HTMLHelper; use Joomla\CMS\Plugin\PluginHelper; use Joomla\Registry\Registry; // phpcs:disable PSR1.Files.SideEffects \defined('_JEXEC') or die; // phpcs:enable PSR1.Files.SideEffects /** * Redirect component helper. * * @since 1.6 */ class RedirectHelper { /** * Extension * * @var string */ public static $extension = 'com_redirect'; /** * Returns an array of standard published state filter options. * * @return array An array containing the options * * @since 1.6 */ public static function publishedOptions() { // Build the active state filter options. $options = []; $options[] = HTMLHelper::_('select.option', '*', 'JALL'); $options[] = HTMLHelper::_('select.option', '1', 'JENABLED'); $options[] = HTMLHelper::_('select.option', '0', 'JDISABLED'); $options[] = HTMLHelper::_('select.option', '2', 'JARCHIVED'); $options[] = HTMLHelper::_('select.option', '-2', 'JTRASHED'); return $options; } /** * Gets the redirect system plugin extension id. * * @return integer The redirect system plugin extension id. * * @since 3.6.0 */ public static function getRedirectPluginId() { $db = Factory::getDbo(); $query = $db->getQuery(true) ->select($db->quoteName('extension_id')) ->from($db->quoteName('#__extensions')) ->where($db->quoteName('folder') . ' = ' . $db->quote('system')) ->where($db->quoteName('element') . ' = ' . $db->quote('redirect')); $db->setQuery($query); try { $result = (int) $db->loadResult(); } catch (\RuntimeException $e) { Factory::getApplication()->enqueueMessage($e->getMessage(), 'error'); } return $result; } /** * Checks whether the option "Collect URLs" is enabled for the output message * * @return boolean * * @since 3.4 */ public static function collectUrlsEnabled() { $collect_urls = false; if (PluginHelper::isEnabled('system', 'redirect')) { $params = new Registry(PluginHelper::getPlugin('system', 'redirect')->params); $collect_urls = (bool) $params->get('collect_urls', 1); } return $collect_urls; } } PK � �\�Sʉ� � src/Helper/.htaccessnu �7��m <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>PK � �\���� src/Field/RedirectField.phpnu �[��� <?php /** * @package Joomla.Administrator * @subpackage com_redirect * * @copyright (C) 2014 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\Component\Redirect\Administrator\Field; use Joomla\CMS\Form\Field\ListField; use Joomla\CMS\HTML\HTMLHelper; // phpcs:disable PSR1.Files.SideEffects \defined('_JEXEC') or die; // phpcs:enable PSR1.Files.SideEffects /** * A dropdown containing all valid HTTP 1.1 response codes. * * @package Joomla.Administrator * @subpackage com_redirect * @since 3.4 */ class RedirectField extends ListField { /** * The form field type. * * @var string * @since 3.4 */ protected $type = 'Redirect'; /** * A map of integer HTTP 1.1 response codes to the full HTTP Status for the headers. * * @var object * @since 3.4 * @link https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml */ protected $responseMap = [ 100 => 'HTTP/1.1 100 Continue', 101 => 'HTTP/1.1 101 Switching Protocols', 102 => 'HTTP/1.1 102 Processing', 103 => 'HTTP/1.1 103 Early Hints', 200 => 'HTTP/1.1 200 OK', 201 => 'HTTP/1.1 201 Created', 202 => 'HTTP/1.1 202 Accepted', 203 => 'HTTP/1.1 203 Non-Authoritative Information', 204 => 'HTTP/1.1 204 No Content', 205 => 'HTTP/1.1 205 Reset Content', 206 => 'HTTP/1.1 206 Partial Content', 207 => 'HTTP/1.1 207 Multi-Status', 208 => 'HTTP/1.1 208 Already Reported', 226 => 'HTTP/1.1 226 IM Used', 300 => 'HTTP/1.1 300 Multiple Choices', 301 => 'HTTP/1.1 301 Moved Permanently', 302 => 'HTTP/1.1 302 Found', 303 => 'HTTP/1.1 303 See other', 304 => 'HTTP/1.1 304 Not Modified', 305 => 'HTTP/1.1 305 Use Proxy', 306 => 'HTTP/1.1 306 (Unused)', 307 => 'HTTP/1.1 307 Temporary Redirect', 308 => 'HTTP/1.1 308 Permanent Redirect', 400 => 'HTTP/1.1 400 Bad Request', 401 => 'HTTP/1.1 401 Unauthorized', 402 => 'HTTP/1.1 402 Payment Required', 403 => 'HTTP/1.1 403 Forbidden', 404 => 'HTTP/1.1 404 Not Found', 405 => 'HTTP/1.1 405 Method Not Allowed', 406 => 'HTTP/1.1 406 Not Acceptable', 407 => 'HTTP/1.1 407 Proxy Authentication Required', 408 => 'HTTP/1.1 408 Request Timeout', 409 => 'HTTP/1.1 409 Conflict', 410 => 'HTTP/1.1 410 Gone', 411 => 'HTTP/1.1 411 Length Required', 412 => 'HTTP/1.1 412 Precondition Failed', 413 => 'HTTP/1.1 413 Payload Too Large', 414 => 'HTTP/1.1 414 URI Too Long', 415 => 'HTTP/1.1 415 Unsupported Media Type', 416 => 'HTTP/1.1 416 Requested Range Not Satisfiable', 417 => 'HTTP/1.1 417 Expectation Failed', 418 => 'HTTP/1.1 418 I\'m a teapot', 421 => 'HTTP/1.1 421 Misdirected Request', 422 => 'HTTP/1.1 422 Unprocessable Entity', 423 => 'HTTP/1.1 423 Locked', 424 => 'HTTP/1.1 424 Failed Dependency', 425 => 'HTTP/1.1 425 Reserved for WebDAV advanced collections expired proposal', 426 => 'HTTP/1.1 426 Upgrade Required', 428 => 'HTTP/1.1 428 Precondition Required', 429 => 'HTTP/1.1 429 Too Many Requests', 431 => 'HTTP/1.1 431 Request Header Fields Too Large', 451 => 'HTTP/1.1 451 Unavailable For Legal Reasons', 500 => 'HTTP/1.1 500 Internal Server Error', 501 => 'HTTP/1.1 501 Not Implemented', 502 => 'HTTP/1.1 502 Bad Gateway', 503 => 'HTTP/1.1 503 Service Unavailable', 504 => 'HTTP/1.1 504 Gateway Timeout', 505 => 'HTTP/1.1 505 HTTP Version Not Supported', 506 => 'HTTP/1.1 506 Variant Also Negotiates (Experimental)', 507 => 'HTTP/1.1 507 Insufficient Storage', 508 => 'HTTP/1.1 508 Loop Detected', 510 => 'HTTP/1.1 510 Not Extended', 511 => 'HTTP/1.1 511 Network Authentication Required', ]; /** * Method to get the field input markup. * * @return array The field input markup. * * @since 3.4 */ protected function getOptions() { $options = []; foreach ($this->responseMap as $key => $value) { $options[] = HTMLHelper::_('select.option', $key, $value); } // Merge any additional options in the XML definition. $options = array_merge(parent::getOptions(), $options); return $options; } } PK � �\�Sʉ� � src/Field/.htaccessnu �7��m <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>PK � �\�B� src/Model/LinkModel.phpnu �[��� <?php /** * @package Joomla.Administrator * @subpackage com_redirect * * @copyright (C) 2009 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\Component\Redirect\Administrator\Model; use Joomla\CMS\Component\ComponentHelper; use Joomla\CMS\Factory; use Joomla\CMS\HTML\HTMLHelper; use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Model\AdminModel; use Joomla\Utilities\ArrayHelper; // phpcs:disable PSR1.Files.SideEffects \defined('_JEXEC') or die; // phpcs:enable PSR1.Files.SideEffects /** * Redirect link model. * * @since 1.6 */ class LinkModel extends AdminModel { /** * @var string The prefix to use with controller messages. * @since 1.6 */ protected $text_prefix = 'COM_REDIRECT'; /** * Method to test whether a record can be deleted. * * @param object $record A record object. * * @return boolean True if allowed to delete the record. Defaults to the permission set in the component. * * @since 1.6 */ protected function canDelete($record) { if ($record->published != -2) { return false; } return parent::canDelete($record); } /** * Method to get the record form. * * @param array $data Data for the form. * @param boolean $loadData True if the form is to load its own data (default case), false if not. * * @return \Joomla\CMS\Form\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_redirect.link', 'link', ['control' => 'jform', 'load_data' => $loadData]); if (empty($form)) { return false; } // Modify the form based on access controls. if (!$this->canEditState((object)$data)) { // Disable fields for display. $form->setFieldAttribute('published', 'disabled', 'true'); // Disable fields while saving. // The controller has already verified this is a record you can edit. $form->setFieldAttribute('published', 'filter', 'unset'); } // If in advanced mode then we make sure the new URL field is not compulsory and the header // field compulsory in case people select non-3xx redirects if (ComponentHelper::getParams('com_redirect')->get('mode', 0)) { $form->setFieldAttribute('new_url', 'required', 'false'); $form->setFieldAttribute('header', '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_redirect.edit.link.data', []); if (empty($data)) { $data = $this->getItem(); } $this->preprocessData('com_redirect.link', $data); return $data; } /** * Method to activate links. * * @param array &$pks An array of link ids. * @param string $url The new URL to set for the redirect. * @param string $comment A comment for the redirect links. * * @return boolean Returns true on success, false on failure. * * @since 1.6 */ public function activate(&$pks, $url, $comment = null) { $user = $this->getCurrentUser(); $db = $this->getDatabase(); // Sanitize the ids. $pks = (array) $pks; $pks = ArrayHelper::toInteger($pks); // Populate default comment if necessary. $comment = (!empty($comment)) ? $comment : Text::sprintf('COM_REDIRECT_REDIRECTED_ON', HTMLHelper::_('date', time())); // Access checks. if (!$user->authorise('core.edit', 'com_redirect')) { $pks = []; $this->setError(Text::_('JLIB_APPLICATION_ERROR_EDIT_NOT_PERMITTED')); return false; } if (!empty($pks)) { // Update the link rows. $query = $db->getQuery(true) ->update($db->quoteName('#__redirect_links')) ->set($db->quoteName('new_url') . ' = :url') ->set($db->quoteName('published') . ' = 1') ->set($db->quoteName('comment') . ' = :comment') ->whereIn($db->quoteName('id'), $pks) ->bind(':url', $url) ->bind(':comment', $comment); $db->setQuery($query); try { $db->execute(); } catch (\RuntimeException $e) { $this->setError($e->getMessage()); return false; } } return true; } /** * Method to batch update URLs to have new redirect urls and comments. Note will publish any unpublished URLs. * * @param array &$pks An array of link ids. * @param string $url The new URL to set for the redirect. * @param string $comment A comment for the redirect links. * * @return boolean Returns true on success, false on failure. * * @since 3.6.0 */ public function duplicateUrls(&$pks, $url, $comment = null) { $user = $this->getCurrentUser(); $db = $this->getDatabase(); // Sanitize the ids. $pks = (array) $pks; $pks = ArrayHelper::toInteger($pks); // Access checks. if (!$user->authorise('core.edit', 'com_redirect')) { $pks = []; $this->setError(Text::_('JLIB_APPLICATION_ERROR_EDIT_NOT_PERMITTED')); return false; } if (!empty($pks)) { $date = Factory::getDate()->toSql(); // Update the link rows. $query = $db->getQuery(true) ->update($db->quoteName('#__redirect_links')) ->set($db->quoteName('new_url') . ' = :url') ->set($db->quoteName('modified_date') . ' = :date') ->set($db->quoteName('published') . ' = 1') ->whereIn($db->quoteName('id'), $pks) ->bind(':url', $url) ->bind(':date', $date); if (!empty($comment)) { $query->set($db->quoteName('comment') . ' = ' . $db->quote($comment)); } $db->setQuery($query); try { $db->execute(); } catch (\RuntimeException $e) { $this->setError($e->getMessage()); return false; } } return true; } } PK � �\�S/�b b src/Model/LinksModel.phpnu �[��� <?php /** * @package Joomla.Administrator * @subpackage com_redirect * * @copyright (C) 2009 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\Component\Redirect\Administrator\Model; use Joomla\CMS\Component\ComponentHelper; use Joomla\CMS\Factory; use Joomla\CMS\MVC\Factory\MVCFactoryInterface; use Joomla\CMS\MVC\Model\ListModel; use Joomla\Database\ParameterType; use Joomla\Database\QueryInterface; // phpcs:disable PSR1.Files.SideEffects \defined('_JEXEC') or die; // phpcs:enable PSR1.Files.SideEffects /** * Methods supporting a list of redirect links. * * @since 1.6 */ class LinksModel extends ListModel { /** * Constructor. * * @param array $config An optional associative array of configuration settings. * @param ?MVCFactoryInterface $factory The factory. * * @since 1.6 */ public function __construct($config = [], ?MVCFactoryInterface $factory = null) { if (empty($config['filter_fields'])) { $config['filter_fields'] = [ 'id', 'a.id', 'state', 'a.state', 'old_url', 'a.old_url', 'new_url', 'a.new_url', 'referer', 'a.referer', 'hits', 'a.hits', 'created_date', 'a.created_date', 'published', 'a.published', 'header', 'a.header', 'http_status', ]; } parent::__construct($config, $factory); } /** * Removes all of the unpublished redirects from the table. * * @return boolean result of operation * * @since 3.5 */ public function purge() { $db = $this->getDatabase(); $query = $db->getQuery(true); $query->delete('#__redirect_links')->where($db->quoteName('published') . '= 0'); $db->setQuery($query); try { $db->execute(); } catch (\Exception) { return false; } return true; } /** * Method to auto-populate the model state. * * Note. Calling getState in this method will result in recursion. * * @param string $ordering An optional ordering field. * @param string $direction An optional direction (asc|desc). * * @return void * * @since 1.6 */ protected function populateState($ordering = 'a.old_url', $direction = 'asc') { // Load the parameters. $params = ComponentHelper::getParams('com_redirect'); $this->setState('params', $params); // List state information. parent::populateState($ordering, $direction); } /** * Method to get a store id based on model configuration state. * * This is necessary because the model is used by the component and * different modules that might need different sets of data or different * ordering requirements. * * @param string $id A prefix for the store id. * * @return string A store id. * * @since 1.6 */ protected function getStoreId($id = '') { // Compile the store id. $id .= ':' . $this->getState('filter.search'); $id .= ':' . $this->getState('filter.state'); $id .= ':' . $this->getState('filter.http_status'); return parent::getStoreId($id); } /** * Build an SQL query to load the list data. * * @return QueryInterface * * @since 1.6 */ protected function getListQuery() { // Create a new query object. $db = $this->getDatabase(); $query = $db->getQuery(true); // Select the required fields from the table. $query->select( $this->getState( 'list.select', 'a.*' ) ); $query->from($db->quoteName('#__redirect_links', 'a')); // Filter by published state $state = (string) $this->getState('filter.state'); if (is_numeric($state)) { $state = (int) $state; $query->where($db->quoteName('a.published') . ' = :state') ->bind(':state', $state, ParameterType::INTEGER); } elseif ($state === '') { $query->whereIn($db->quoteName('a.published'), [0,1]); } // Filter the items over the HTTP status code header. if ($httpStatusCode = $this->getState('filter.http_status')) { $httpStatusCode = (int) $httpStatusCode; $query->where($db->quoteName('a.header') . ' = :header') ->bind(':header', $httpStatusCode, ParameterType::INTEGER); } // Filter the items over the search string if set. $search = $this->getState('filter.search'); if (!empty($search)) { if (stripos($search, 'id:') === 0) { $ids = (int) substr($search, 3); $query->where($db->quoteName('a.id') . ' = :id'); $query->bind(':id', $ids, ParameterType::INTEGER); } else { $search = '%' . str_replace(' ', '%', $db->escape(trim($search), true) . '%'); $query->where( '(' . $db->quoteName('old_url') . ' LIKE :oldurl' . ' OR ' . $db->quoteName('new_url') . ' LIKE :newurl' . ' OR ' . $db->quoteName('comment') . ' LIKE :comment' . ' OR ' . $db->quoteName('referer') . ' LIKE :referer)' ) ->bind(':oldurl', $search) ->bind(':newurl', $search) ->bind(':comment', $search) ->bind(':referer', $search); } } // Add the list ordering clause. $query->order($db->escape($this->getState('list.ordering', 'a.old_url')) . ' ' . $db->escape($this->getState('list.direction', 'ASC'))); return $query; } /** * Add the entered URLs into the database * * @param array $batchUrls Array of URLs to enter into the database * * @return boolean */ public function batchProcess($batchUrls) { $db = $this->getDatabase(); $query = $db->getQuery(true); $params = ComponentHelper::getParams('com_redirect'); $state = (int) $params->get('defaultImportState', 0); $created = Factory::getDate()->toSql(); $columns = [ 'old_url', 'new_url', 'referer', 'comment', 'hits', 'published', 'created_date', 'modified_date', ]; $values = [ ':oldurl', ':newurl', $db->quote(''), $db->quote(''), 0, ':state', ':created', ':modified', ]; $query ->insert($db->quoteName('#__redirect_links'), false) ->columns($db->quoteName($columns)) ->values(implode(', ', $values)) ->bind(':oldurl', $old_url) ->bind(':newurl', $new_url) ->bind(':state', $state, ParameterType::INTEGER) ->bind(':created', $created) ->bind(':modified', $created); $db->setQuery($query); foreach ($batchUrls as $batch_url) { $old_url = $batch_url[0]; // Destination URL can also be an external URL if (!empty($batch_url[1])) { $new_url = $batch_url[1]; } else { $new_url = ''; } $db->execute(); } return true; } } PK � �\�Sʉ� � src/Model/.htaccessnu �7��m <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>PK � �\���o o src/View/Links/HtmlView.phpnu �[��� <?php /** * @package Joomla.Administrator * @subpackage com_redirect * * @copyright (C) 2009 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\Component\Redirect\Administrator\View\Links; use Joomla\CMS\Component\ComponentHelper; use Joomla\CMS\Helper\ContentHelper; use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\View\GenericDataException; use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView; use Joomla\CMS\Plugin\PluginHelper; use Joomla\CMS\Toolbar\Button\DropdownButton; use Joomla\CMS\Toolbar\ToolbarHelper; use Joomla\Component\Redirect\Administrator\Helper\RedirectHelper; use Joomla\Component\Redirect\Administrator\Model\LinksModel; // phpcs:disable PSR1.Files.SideEffects \defined('_JEXEC') or die; // phpcs:enable PSR1.Files.SideEffects /** * View class for a list of redirection links. * * @since 1.6 */ class HtmlView extends BaseHtmlView { /** * True if "System - Redirect Plugin" is enabled * * @var boolean */ protected $enabled; /** * True if "Collect URLs" is enabled * * @var boolean */ protected $collect_urls_enabled; /** * The id of the redirect plugin in mysql * * @var integer * @since 3.8.0 */ protected $redirectPluginId = 0; /** * An array of items * * @var array */ protected $items; /** * The pagination object * * @var \Joomla\CMS\Pagination\Pagination */ protected $pagination; /** * The model state * * @var \Joomla\Registry\Registry */ protected $state; /** * The model state * * @var \Joomla\Registry\Registry */ protected $params; /** * Form object for search filters * * @var \Joomla\CMS\Form\Form * * @since 4.0.0 */ public $filterForm; /** * The active search filters * * @var array * @since 4.0.0 */ public $activeFilters; /** * Is this view an Empty State * * @var boolean * @since 4.0.0 */ private $isEmptyState = false; /** * Display the view. * * @param string $tpl The name of the template file to parse; automatically searches through the template paths. * * @return void * * @throws GenericDataException * @since 1.6 */ public function display($tpl = null) { /** @var LinksModel $model */ $model = $this->getModel(); $model->setUseExceptions(true); // Set variables $this->items = $model->getItems(); $this->pagination = $model->getPagination(); $this->state = $model->getState(); $this->filterForm = $model->getFilterForm(); $this->activeFilters = $model->getActiveFilters(); $this->params = ComponentHelper::getParams('com_redirect'); if (!\count($this->items) && $this->isEmptyState = $model->getIsEmptyState()) { $this->setLayout('emptystate'); } if (!PluginHelper::isEnabled('system', 'redirect') || !RedirectHelper::collectUrlsEnabled()) { $this->redirectPluginId = RedirectHelper::getRedirectPluginId(); } $this->addToolbar(); parent::display($tpl); } /** * Add the page title and toolbar. * * @return void * * @since 1.6 */ protected function addToolbar() { $state = $this->state; $canDo = ContentHelper::getActions('com_redirect'); $toolbar = $this->getDocument()->getToolbar(); ToolbarHelper::title(Text::_('COM_REDIRECT_MANAGER_LINKS'), 'map-signs redirect'); if ($canDo->get('core.create')) { $toolbar->addNew('link.add'); } if (!$this->isEmptyState && ($canDo->get('core.edit.state') || $canDo->get('core.admin'))) { /** @var DropdownButton $dropdown */ $dropdown = $toolbar->dropdownButton('status-group', 'JTOOLBAR_CHANGE_STATUS') ->toggleSplit(false) ->icon('icon-ellipsis-h') ->buttonClass('btn btn-action') ->listCheck(true); $childBar = $dropdown->getChildToolbar(); if ($state->get('filter.state') != 2) { $childBar->publish('links.publish', 'JTOOLBAR_ENABLE')->listCheck(true); $childBar->unpublish('links.unpublish', 'JTOOLBAR_DISABLE')->listCheck(true); } if ($state->get('filter.state') != -1) { if ($state->get('filter.state') != 2) { $childBar->archive('links.archive')->listCheck(true); } elseif ($state->get('filter.state') == 2) { $childBar->unarchive('links.unpublish')->listCheck(true); } } if (!$state->get('filter.state') == -2) { $childBar->trash('links.trash')->listCheck(true); } } if ($state->get('filter.state') == -2 && $canDo->get('core.delete')) { $toolbar->delete('links.delete', 'JTOOLBAR_DELETE_FROM_TRASH') ->message('JGLOBAL_CONFIRM_DELETE') ->listCheck(true); } if (!$this->isEmptyState && (!$state->get('filter.state') == -2 && $canDo->get('core.delete'))) { $toolbar->confirmButton('delete', 'COM_REDIRECT_TOOLBAR_PURGE', 'links.purge') ->message('COM_REDIRECT_CONFIRM_PURGE'); } if ($canDo->get('core.create')) { $toolbar->popupButton('batch', 'JTOOLBAR_BULK_IMPORT') ->popupType('inline') ->textHeader(Text::_('COM_REDIRECT_BATCH_OPTIONS')) ->url('#joomla-dialog-batch') ->modalWidth('800px') ->modalHeight('fit-content') ->listCheck(false); } if ($canDo->get('core.admin') || $canDo->get('core.options')) { $toolbar->preferences('com_redirect'); } $toolbar->help('Redirects:_Links'); } } PK � �\�Sʉ� � src/View/Links/.htaccessnu �7��m <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>PK � �\�Sʉ� � src/View/.htaccessnu �7��m <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>PK � �\���� � src/View/Link/HtmlView.phpnu �[��� <?php /** * @package Joomla.Administrator * @subpackage com_redirect * * @copyright (C) 2009 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\Component\Redirect\Administrator\View\Link; use Joomla\CMS\Factory; use Joomla\CMS\Helper\ContentHelper; use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\View\GenericDataException; use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView; use Joomla\CMS\Toolbar\Toolbar; use Joomla\CMS\Toolbar\ToolbarHelper; use Joomla\Component\Redirect\Administrator\Model\LinkModel; // phpcs:disable PSR1.Files.SideEffects \defined('_JEXEC') or die; // phpcs:enable PSR1.Files.SideEffects /** * View to edit a redirect link. * * @since 1.6 */ class HtmlView extends BaseHtmlView { /** * The active item * * @var object */ protected $item; /** * The Form object * * @var \Joomla\CMS\Form\Form */ protected $form; /** * The model state * * @var \Joomla\Registry\Registry */ protected $state; /** * Display the view. * * @param string $tpl The name of the template file to parse; automatically searches through the template paths. * * @return void * * @since 1.6 */ public function display($tpl = null) { /** @var LinkModel $model */ $model = $this->getModel(); $this->form = $model->getForm(); $this->item = $model->getItem(); $this->state = $model->getState(); // Check for errors. if (\count($errors = $model->getErrors())) { throw new GenericDataException(implode("\n", $errors), 500); } $this->addToolbar(); parent::display($tpl); } /** * Add the page title and toolbar. * * @return void * * @since 1.6 */ protected function addToolbar() { Factory::getApplication()->getInput()->set('hidemainmenu', true); $isNew = ($this->item->id == 0); $canDo = ContentHelper::getActions('com_redirect'); $toolbar = $this->getDocument()->getToolbar(); ToolbarHelper::title($isNew ? Text::_('COM_REDIRECT_MANAGER_LINK_NEW') : Text::_('COM_REDIRECT_MANAGER_LINK_EDIT'), 'map-signs redirect'); if ($canDo->get('core.edit')) { $toolbar->apply('link.apply'); } $saveGroup = $toolbar->dropdownButton('save-group'); $saveGroup->configure( function (Toolbar $childBar) use ($canDo) { // If not checked out, can save the item. if ($canDo->get('core.edit')) { $childBar->save('link.save'); } /** * This component does not support Save as Copy due to uniqueness checks. * While it can be done, it causes too much confusion if the user does * not change the Old URL. */ if ($canDo->get('core.edit') && $canDo->get('core.create')) { $childBar->save2new('link.save2new'); } } ); if (empty($this->item->id)) { $toolbar->cancel('link.cancel', 'JTOOLBAR_CANCEL'); } else { $toolbar->cancel('link.cancel'); } $toolbar->help('Redirects:_New_or_Edit'); } } PK � �\�Sʉ� � src/View/Link/.htaccessnu �7��m <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>PK � �\v�2h h # src/Extension/RedirectComponent.phpnu �[��� <?php /** * @package Joomla.Administrator * @subpackage com_redirect * * @copyright (C) 2018 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\Component\Redirect\Administrator\Extension; use Joomla\CMS\Extension\BootableExtensionInterface; use Joomla\CMS\Extension\MVCComponent; use Joomla\CMS\HTML\HTMLRegistryAwareTrait; use Joomla\Component\Redirect\Administrator\Service\HTML\Redirect; use Psr\Container\ContainerInterface; // phpcs:disable PSR1.Files.SideEffects \defined('_JEXEC') or die; // phpcs:enable PSR1.Files.SideEffects /** * Component class for com_redirect * * @since 4.0.0 */ class RedirectComponent extends MVCComponent implements BootableExtensionInterface { use HTMLRegistryAwareTrait; /** * Booting the extension. This is the function to set up the environment of the extension like * registering new class loaders, etc. * * If required, some initial set up can be done from services of the container, eg. * registering HTML services. * * @param ContainerInterface $container The container * * @return void * * @since 4.0.0 */ public function boot(ContainerInterface $container) { $this->getRegistry()->register('redirect', new Redirect()); } } PK � �\�Sʉ� � src/Extension/.htaccessnu �7��m <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>PK � �\��ֱ� � "