HEX
Server: Apache
System: Linux WWW 6.1.0-40-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.153-1 (2025-09-20) x86_64
User: web11 (1011)
PHP: 8.2.29
Disabled: NONE
Upload Files
File: /var/www/apklausos/application/controllers/PluginsController.php
<?php

/**
 * @todo Not used, copied to admin/pluginmanager.php. Delete this file?
 * @todo Actually, it's used for action direct.
 */
class PluginsController extends LSYii_Controller
{
    /**
     * Launch the event newDirectRequest
     * @param $plugin : the target
     * @param $function : the function to call from the plugin
     */
    public function actionDirect($plugin, $function = null)
    {
        $oEvent = new PluginEvent('newDirectRequest');
        // The intended target of the call.
        $oEvent->set('target', $plugin);
        // The name of the function.
        $oEvent->set('function', $function);
        $oEvent->set('request', App()->request);

        App()->getPluginManager()->dispatchEvent($oEvent);
        $sOutput = '';
        foreach ($oEvent->getAllContent() as $content) {
            $sOutput .= $content->getContent();
        }
        if (!empty($sOutput)) {
            $this->renderText($sOutput);
        }
    }

    /**
     * Launch the event newUnsecureRequest
     * @param $plugin : the target
     * @param $function : the function to call from the plugin
     */
    public function actionUnsecure($plugin, $function = null)
    {
        $oEvent = new PluginEvent('newUnsecureRequest');
        // The intended target of the call.
        $oEvent->set('target', $plugin);
        // The name of the function.
        $oEvent->set('function', $function);
        $oEvent->set('request', App()->request);

        App()->getPluginManager()->dispatchEvent($oEvent);
        $sOutput = '';
        foreach ($oEvent->getAllContent() as $content) {
            $sOutput .= $content->getContent();
        }
        if (!empty($sOutput)) {
            $this->renderText($sOutput);
        }
    }

    /**
     * Show list of plugins
     * @deprecated
     * @return void
     */
    public function actionIndex()
    {
        // Or shortcut for actionDirect ?
        $this->redirect($this->createUrl("admin/pluginmanager/sa/index"));
    }
}