diff --git a/CHANGELOG.md b/CHANGELOG.md index d949b54..5e3e140 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -35,6 +35,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Trusted IPs: configurable repeatable rows of IP addresses, CIDR ranges, and wildcards that bypass admin session timeout - Supports exact IPs (192.168.1.100), CIDR (10.0.0.0/24), and wildcards (192.168.1.*) - Each entry has a label and enabled toggle for easy management +- Current IP display above trusted IPs table so admins can easily add their own IP ## [02.06.00] - 2026-05-25 diff --git a/src/packages/plg_system_mokowaas/Field/CurrentIpField.php b/src/packages/plg_system_mokowaas/Field/CurrentIpField.php new file mode 100644 index 0000000..6de6e00 --- /dev/null +++ b/src/packages/plg_system_mokowaas/Field/CurrentIpField.php @@ -0,0 +1,40 @@ + + * + * SPDX-LICENSE-IDENTIFIER: GPL-3.0-or-later + * + * FILE INFORMATION + * DEFGROUP: Joomla.Plugin + * INGROUP: MokoWaaS + * VERSION: 02.11.00 + * PATH: /src/Field/CurrentIpField.php + * BRIEF: Read-only field that displays the current user's IP address + */ + +namespace Moko\Plugin\System\MokoWaaS\Field; + +defined('_JEXEC') or die; + +use Joomla\CMS\Form\FormField; + +class CurrentIpField extends FormField +{ + protected $type = 'CurrentIp'; + + protected function getInput() + { + $currentIp = $_SERVER['REMOTE_ADDR'] ?? 'unknown'; + + return '
' . htmlspecialchars($currentIp) . ' '
+ . '— add this to the table below to keep your session alive.'
+ . '