AnonSec Shell
Server IP : 54.36.91.62  /  Your IP : 216.73.217.112
Web Server : Apache
System : Linux webm013.cluster127.gra.hosting.ovh.net 5.15.206-ovh-vps-grsec-zfs-classid #1 SMP Fri May 15 02:41:25 UTC 2026 x86_64
User : coopiak ( 151928)
PHP Version : 8.3.23
Disable Function : _dyuweyrj4,_dyuweyrj4r,dl
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/coopiak/amisdesseniors-fr/api/components/com_plugins/src/Controller/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     

Current File : /home/coopiak/amisdesseniors-fr/api/components/com_plugins/src/Controller/PluginsController.php
<?php

/**
 * @package     Joomla.API
 * @subpackage  com_plugins
 *
 * @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\Plugins\Api\Controller;

use Joomla\CMS\Filter\InputFilter;
use Joomla\CMS\Language\Text;
use Joomla\CMS\MVC\Controller\ApiController;
use Joomla\CMS\MVC\Controller\Exception;
use Joomla\CMS\Router\Exception\RouteNotFoundException;
use Joomla\String\Inflector;
use Tobscure\JsonApi\Exception\InvalidParameterException;

// phpcs:disable PSR1.Files.SideEffects
\defined('_JEXEC') or die;
// phpcs:enable PSR1.Files.SideEffects

/**
 * The plugins controller
 *
 * @since  4.0.0
 */
class PluginsController extends ApiController
{
    /**
     * The content type of the item.
     *
     * @var    string
     * @since  4.0.0
     */
    protected $contentType = 'plugins';

    /**
     * The default view for the display method.
     *
     * @var    string
     *
     * @since  3.0
     */
    protected $default_view = 'plugins';

    /**
     * Method to edit an existing record.
     *
     * @return  static  A \JControllerLegacy object to support chaining.
     *
     * @since   4.0.0
     */
    public function edit()
    {
        $recordId = $this->input->getInt('id');

        if (!$recordId) {
            throw new Exception\ResourceNotFound(Text::_('JLIB_APPLICATION_ERROR_RECORD'), 404);
        }

        $data = json_decode($this->input->json->getRaw(), true);

        foreach ($data as $key => $value) {
            if (!\in_array($key, ['enabled', 'access', 'ordering'])) {
                throw new InvalidParameterException("Invalid parameter {$key}.", 400);
            }
        }

        /** @var \Joomla\Component\Plugins\Administrator\Model\PluginModel $model */
        $model = $this->getModel(Inflector::singularize($this->contentType), '', ['ignore_request' => true]);

        if (!$model) {
            throw new \RuntimeException(Text::_('JLIB_APPLICATION_ERROR_MODEL_CREATE'));
        }

        $item = $model->getItem($recordId);

        if (!isset($item->extension_id)) {
            throw new RouteNotFoundException('Item does not exist');
        }

        $data['folder']  = $item->folder;
        $data['element'] = $item->element;

        $this->input->set('data', $data);

        return parent::edit();
    }

    /**
     * Plugin list view with filtering of data
     *
     * @return  static  A BaseController object to support chaining.
     *
     * @since   4.0.0
     */
    public function displayList()
    {
        $apiFilterInfo = $this->input->get('filter', [], 'array');
        $filter        = InputFilter::getInstance();

        if (\array_key_exists('element', $apiFilterInfo)) {
            $this->modelState->set('filter.element', $filter->clean($apiFilterInfo['element'], 'STRING'));
        }

        if (\array_key_exists('status', $apiFilterInfo)) {
            $this->modelState->set('filter.enabled', $filter->clean($apiFilterInfo['status'], 'INT'));
        }

        if (\array_key_exists('search', $apiFilterInfo)) {
            $this->modelState->set('filter.search', $filter->clean($apiFilterInfo['search'], 'STRING'));
        }

        if (\array_key_exists('type', $apiFilterInfo)) {
            $this->modelState->set('filter.folder', $filter->clean($apiFilterInfo['type'], 'STRING'));
        }

        return parent::displayList();
    }
}

Anon7 - 2022
AnonSec Team