__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
<?php /** * @package Regular Labs Library * @version 25.6.10828 * * @author Peter van Westen <[email protected]> * @link https://regularlabs.com * @copyright Copyright © 2025 Regular Labs All Rights Reserved * @license GNU General Public License version 2 or later */ namespace RegularLabs\Library; defined('_JEXEC') or die; use Joomla\CMS\Language\Text as JText; use Joomla\Component\Actionlogs\Administrator\Plugin\ActionLogPlugin as JActionLogPlugin; use Joomla\Event\DispatcherInterface as JDispatcherInterface; use RegularLabs\Library\Language as RL_Language; class ActionLogPlugin extends JActionLogPlugin { static $ids = []; static $item_titles = []; static $item_types = []; public $alias = ''; public $events = []; public $lang_prefix_change_state = 'PLG_SYSTEM_ACTIONLOGS'; public $lang_prefix_delete = 'PLG_SYSTEM_ACTIONLOGS'; public $lang_prefix_install = 'PLG_ACTIONLOG_JOOMLA'; public $lang_prefix_save = 'PLG_SYSTEM_ACTIONLOGS'; public $lang_prefix_uninstall = 'PLG_ACTIONLOG_JOOMLA'; public $name = ''; public $option = ''; public $table = null; public function __construct(JDispatcherInterface &$subject, array $config = []) { parent::__construct($subject, $config); \RegularLabs\Library\Language::load('plg_actionlog_joomla', JPATH_ADMINISTRATOR); \RegularLabs\Library\Language::load('plg_actionlog_' . $this->alias); $config = \RegularLabs\Library\Parameters::getComponent($this->alias); $enable_actionlog = $config->enable_actionlog ?? \true; $this->events = $enable_actionlog ? ['*'] : []; if ($enable_actionlog && !empty($config->actionlog_events)) { $this->events = \RegularLabs\Library\ArrayHelper::toArray($config->actionlog_events); } $this->name = JText::_($this->name); $this->option = $this->option ?: 'com_' . $this->alias; } public function addItem($extension, $type, $title) { self::$item_types[$extension] = $type; self::$item_titles[$extension] = $title; } public function getItem($context) { $item = $this->getItemData($context); if (!isset($item->file)) { $item->file = JPATH_ADMINISTRATOR . '/components/' . $item->option . '/models/' . $item->type . '.php'; } if (!isset($item->model)) { $item->model = $this->alias . 'Model' . ucfirst($item->type); } if (!isset($item->url)) { $item->url = 'index.php?option=' . $item->option . '&view=' . $item->type . '&layout=edit&id={id}'; } return $item; } public function onContentAfterDelete($context, $table) { if (!str_contains($context, $this->option)) { return; } if (!\RegularLabs\Library\ArrayHelper::find(['*', 'delete'], $this->events)) { return; } $item = $this->getItem($context); $title = $table->title ?? $table->name ?? $table->id; $message = ['action' => 'deleted', 'type' => $item->title, 'id' => $table->id, 'title' => $title]; $this->addLog([$message], $this->lang_prefix_delete . '_CONTENT_DELETED', $context); } public function onContentAfterSave($context, $table, $isNew, $data = []) { $data = \RegularLabs\Library\ArrayHelper::toArray($data); if (isset($data['ignore_actionlog']) && $data['ignore_actionlog']) { return; } if (!str_contains($context, $this->option)) { return; } $event = $isNew ? 'create' : 'update'; if (!\RegularLabs\Library\ArrayHelper::find(['*', $event], $this->events)) { return; } $item = $this->getItem($context); $title = $table->title ?? $table->name ?? $table->id; $item_url = str_replace('{id}', $table->id, $item->url); $message = ['action' => $isNew ? 'add' : 'update', 'type' => $item->title, 'id' => $table->id, 'title' => $title, 'itemlink' => $item_url]; $languageKey = $isNew ? $this->lang_prefix_save . '_CONTENT_ADDED' : $this->lang_prefix_save . '_CONTENT_UPDATED'; $this->addLog([$message], $languageKey, $context); } public function onContentChangeState($context, $ids, $value) { if (!str_contains($context, $this->option)) { return; } if (!\RegularLabs\Library\ArrayHelper::find(['*', 'change_state'], $this->events)) { return; } switch ($value) { case 0: $languageKey = $this->lang_prefix_change_state . '_CONTENT_UNPUBLISHED'; $action = 'unpublish'; break; case 1: $languageKey = $this->lang_prefix_change_state . '_CONTENT_PUBLISHED'; $action = 'publish'; break; case 2: $languageKey = $this->lang_prefix_change_state . '_CONTENT_ARCHIVED'; $action = 'archive'; break; case -2: $languageKey = $this->lang_prefix_change_state . '_CONTENT_TRASHED'; $action = 'trash'; break; default: return; } $item = $this->getItem($context); if (!$this->table) { if (!is_file($item->file)) { return; } require_once $item->file; $this->table = (new $item->model())->getTable(); } foreach ($ids as $id) { $this->table->load($id); $title = $this->table->title ?? $this->table->name ?? $this->table->id; $itemlink = str_replace('{id}', $this->table->id, $item->url); $message = ['action' => $action, 'type' => $item->title, 'id' => $id, 'title' => $title, 'itemlink' => $itemlink]; $this->addLog([$message], $languageKey, $context); } } public function onExtensionAfterDelete($context, $table) { self::onContentAfterDelete($context, $table); } public function onExtensionAfterSave($context, $table, $isNew) { self::onContentAfterSave($context, $table, $isNew); } public function onExtensionAfterUninstall($installer, $eid, $result) { // Prevent duplicate logs if (in_array('uninstall_' . $eid, self::$ids, \true)) { return; } $context = \RegularLabs\Library\Input::get('option', ''); if (!str_contains($context, $this->option)) { return; } if (!\RegularLabs\Library\ArrayHelper::find(['*', 'uninstall'], $this->events)) { return; } if ($result === \false) { return; } $manifest = $installer->get('manifest'); if ($manifest === null) { return; } self::$ids[] = 'uninstall_' . $eid; $message = ['action' => 'uninstall', 'type' => $this->lang_prefix_install . '_TYPE_' . strtoupper($manifest->attributes()->type), 'id' => $eid, 'extension_name' => JText::_($manifest->name)]; $languageKey = $this->lang_prefix_uninstall . '_EXTENSION_UNINSTALLED'; $this->addLog([$message], $languageKey, 'com_regularlabsmanager'); } private function getItemData(string $extension): object { if (str_contains($extension, '.')) { [$extension, $type] = explode('.', $extension); } RL_Language::load($extension); $type ??= self::$item_types[$extension] ?? 'item'; $title = self::$item_titles[$extension] ?? JText::_($extension) . ' ' . JText::_('RL_ITEM'); return (object) ['context' => $extension . '.' . $type, 'option' => $extension, 'type' => $type, 'title' => $title]; } }
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| Form | Folder | 0775 |
|
|
| ActionLogPlugin.php | File | 7.65 KB | 0664 |
|
| Alias.php | File | 3.38 KB | 0664 |
|
| ArrayHelper.php | File | 13.01 KB | 0664 |
|
| Article.php | File | 10.96 KB | 0664 |
|
| Cache.php | File | 4.74 KB | 0664 |
|
| Color.php | File | 1.9 KB | 0664 |
|
| DB.php | File | 16.24 KB | 0664 |
|
| Date.php | File | 5.18 KB | 0664 |
|
| Document.php | File | 13.34 KB | 0664 |
|
| DownloadKey.php | File | 3.93 KB | 0664 |
|
| EditorButtonPlugin.php | File | 5.61 KB | 0664 |
|
| EditorButtonPopup.php | File | 5.76 KB | 0664 |
|
| Extension.php | File | 14.38 KB | 0664 |
|
| FieldHelper.php | File | 1.92 KB | 0664 |
|
| FieldsPlugin.php | File | 979 B | 0664 |
|
| File.php | File | 12.96 KB | 0664 |
|
| Html.php | File | 24.53 KB | 0664 |
|
| HtmlTag.php | File | 4.53 KB | 0664 |
|
| Http.php | File | 4.33 KB | 0664 |
|
| Image.php | File | 28.24 KB | 0664 |
|
| Input.php | File | 5.28 KB | 0664 |
|
| Language.php | File | 999 B | 0664 |
|
| Layout.php | File | 1.08 KB | 0664 |
|
| License.php | File | 1.72 KB | 0664 |
|
| MobileDetect.php | File | 763 B | 0664 |
|
| ObjectHelper.php | File | 2.57 KB | 0664 |
|
| Parameters.php | File | 6.37 KB | 0664 |
|
| Php.php | File | 6.33 KB | 0664 |
|
| PluginTag.php | File | 15.52 KB | 0664 |
|
| Protect.php | File | 26.27 KB | 0664 |
|
| RegEx.php | File | 6.33 KB | 0664 |
|
| ShowOn.php | File | 1.32 KB | 0664 |
|
| SimpleCategory.php | File | 1.73 KB | 0664 |
|
| StringHelper.php | File | 22.05 KB | 0664 |
|
| StringReplacer.php | File | 13.25 KB | 0664 |
|
| SystemPlugin.php | File | 15.73 KB | 0664 |
|
| Text.php | File | 20.17 KB | 0664 |
|
| Title.php | File | 2.86 KB | 0664 |
|
| Uri.php | File | 5.76 KB | 0664 |
|
| User.php | File | 3.35 KB | 0664 |
|
| Variables.php | File | 11.06 KB | 0664 |
|
| Version.php | File | 7.88 KB | 0664 |
|
| Xml.php | File | 1.47 KB | 0664 |
|