Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
* text=auto eol=lf
*.png binary
*.jpg binary
*.zip binary
/.github export-ignore
/.gitignore export-ignore
/.gitattributes export-ignore
/phpunit.xml.dist export-ignore
/tests export-ignore
/docs/images export-ignore
29 changes: 29 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Bug report
description: Report a reproducible problem with Admin Activation Details.
labels: ["bug"]
body:
- type: textarea
id: problem
attributes:
label: What happened?
description: Describe the result and what you expected. Remove real email addresses, IPs and activation keys.
validations:
required: true
- type: input
id: versions
attributes:
label: phpBB, PHP and extension versions
validations:
required: true
- type: textarea
id: reproduce
attributes:
label: Steps to reproduce
description: Include whether this was registration or an activation resend, and whether mail was queued.
validations:
required: true
- type: textarea
id: errors
attributes:
label: Error messages and relevant extensions
description: Remove credentials and private account details before posting.
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: Questions, feature requests, and general discussion
url: https://github.com/phpbbmodders/adminactivationdetails/discussions
about: For anything that is not a bug report, please use Discussions instead.
42 changes: 42 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Tests
on:
push:
pull_request:
permissions:
contents: read
jobs:
tests:
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
phpbb: ['3.3.x', 'master']
php: ['8.3', '8.4']
name: phpBB ${{ matrix.phpbb }} / PHP ${{ matrix.php }}
steps:
- name: Checkout phpBB
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
repository: phpbb/phpbb
ref: ${{ matrix.phpbb }}
- name: Checkout extension
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
path: phpBB/ext/phpbbmodders/adminactivationdetails
- name: Set up PHP
uses: shivammathur/setup-php@d52fc211a0436f8839a587b3b5b8efddab4744ea # v2
with:
php-version: ${{ matrix.php }}
extensions: dom, gd, intl, mbstring, mysqli, pdo_sqlite, sqlite3, zip
coverage: none
- name: Install phpBB test dependencies
run: .github/setup-phpbb.sh none '${{ matrix.php }}' 1
- name: Run regression tests
run: phpBB/vendor/bin/phpunit --bootstrap tests/bootstrap.php --configuration phpBB/ext/phpbbmodders/adminactivationdetails/phpunit.xml.dist
- name: Check extension coding standards
run: phpBB/vendor/bin/phpcs -s --standard=build/code_sniffer/ruleset-php-extensions.xml --extensions=php --ignore='*/tests/*' phpBB/ext/phpbbmodders/adminactivationdetails
epv:
uses: phpbbmodders/.github/.github/workflows/epv.yml@v1
with:
EXTNAME: phpbbmodders/adminactivationdetails
PHPBB_BRANCHES: '["3.3.x", "master"]'
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/vendor/
/composer.lock
/.phpunit.result.cache
/tests/runtime/board-33.yml
/tests/runtime/board-40.yml
/tests/runtime/__pycache__/
78 changes: 78 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# Admin Activation Details

Adds the registering account's email address, stored registration IP and
registration date to phpBB's administrator activation emails. Valid IPv4
and IPv6 addresses include WHOIS/RDAP and Stop Forum Spam lookup links.

Requires phpBB 3.3.19 or phpBB 4.0 and PHP 8.3.36 or later. phpBB 4.0 is
still a development branch; see [testing](docs/testing.md) for tested revisions.

## Installation

Copy this extension into `ext/phpbbmodders/adminactivationdetails/`, then
open **ACP → Customise → Manage extensions** and enable **Admin Activation Details**.
Set **Account activation** to **By admin** in User registration settings.
Administrators must enable email for the existing **User requiring activation**
notification in their UCP notification settings.

There are no additional settings or database migrations. Disable the extension
to restore phpBB's original activation notification and email template.

## Email behavior

- Covers administrator activation notifications from registration and resends.
- Uses the account's stored registration IP, not the current visitor's address.
- Keeps phpBB's existing recipients, notification preferences, profile link,
activation link and mail queue behavior.
- Uses phpBB's current email-rendering user's date format and timezone, shown
explicitly beside the date. A queued email keeps that rendered date.
- Missing or invalid IPs show **Not available** and omit lookup links.
- Sends no passwords and makes no requests to lookup services. Clicking a lookup
link submits the IP to that service. A registration IP may identify a proxy or VPN.

The extension supplies a plain-text English email template; phpBB's normal
language fallback applies. Translations can provide
`language/<locale>/email/admin_activate.txt` inside this extension. Existing
core-template customizations and HTML-email modifications do not automatically
carry over to the extension's template.

## Screenshots

Browser previews of captured test emails with synthetic details. Click an image
to see it full size; see the [gallery](docs/images/screenshots/README.md).

[<img src="docs/images/screenshots/ipv4.png" alt="IPv4 registration email example" width="640" height="610">](docs/images/screenshots/ipv4.png)

[<img src="docs/images/screenshots/ipv6.png" alt="IPv6 registration email example" width="640" height="610">](docs/images/screenshots/ipv6.png)

[<img src="docs/images/screenshots/missing-ip.png" alt="Missing or invalid IP email example" width="640" height="571">](docs/images/screenshots/missing-ip.png)

## Development

See [implementation and testing](docs/testing.md). The extension listens to
`core.modify_notification_template` and changes only the `admin_activate` email.
Another extension replacing that template may conflict.
No phpBB core files need editing. If using phpBB's CLI to enable or disable
the extension, run `cache:purge` afterward to rebuild its cached services.

The feature was requested in this [phpBB discussion](https://www.phpbb.com/community/viewtopic.php?t=2667817).

Synthetic [IPv4](samples/admin-activation-ipv4.txt) and
[IPv6](samples/admin-activation-ipv6.txt) email examples are included. Their example activation keys do not work.

## Contributing

Contributions are welcome!

- **Bug reports**: [Open an issue](https://github.com/phpbbmodders/adminactivationdetails/issues).
- **Everything else** (questions, feature requests, ideas, general discussion): [Use Discussions](https://github.com/phpbbmodders/adminactivationdetails/discussions).
- Pull requests are welcome for bug fixes or discussed features.

## Acknowledgments

- Implementation, testing and documentation assisted by [Codex](https://openai.com/codex/).

## License

This extension is licensed under the **GNU General Public License v2.0**.
See [license.txt](license.txt).
7 changes: 7 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Security policy

Report suspected vulnerabilities privately to security@williamjacoby.cc.
Include the organization name **phpbbmodders**, repository name
**adminactivationdetails**, affected versions, and reproduction steps.

Do not post activation keys or account details in a public issue.
26 changes: 26 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"name": "phpbbmodders/adminactivationdetails",
"type": "phpbb-extension",
"description": "Include registration IP, account details and IP lookup links in administrator activation emails.",
"homepage": "https://www.phpbbmodders.com/",
"version": "1.0.0-dev",
"license": "GPL-2.0-only",
"authors": [
{
"name": "phpBB Modders",
"homepage": "https://www.phpbbmodders.com/",
"role": "Extension Developer"
}
],
"require": {
"php": ">=8.3.36",
"phpbb/phpbb": ">=3.3.19,<4.1.0@dev",
"composer/installers": "^1.0 || ^2.0"
},
"extra": {
"display-name": "Admin Activation Details",
"soft-require": {
"phpbb/phpbb": ">=3.3.19,<4.1.0@dev"
}
}
}
8 changes: 8 additions & 0 deletions config/services.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
services:
phpbbmodders.adminactivationdetails.listener:
class: phpbbmodders\adminactivationdetails\event\listener
arguments:
- '@user_loader'
- '@user'
tags:
- { name: event.listener }
17 changes: 17 additions & 0 deletions docs/images/screenshots/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Email examples

Browser previews of captured plain-text test emails. All account details are
synthetic, and the example activation keys do not work. These previews show the
email contents; the surrounding frame is not part of the sent email.

### IPv4 registration

[<img src="ipv4.png" alt="IPv4 registration email example" width="640" height="610">](ipv4.png)

### IPv6 registration

[<img src="ipv6.png" alt="IPv6 registration email example" width="640" height="610">](ipv6.png)

### Missing or invalid IP

[<img src="missing-ip.png" alt="Missing or invalid IP email example" width="640" height="571">](missing-ip.png)
Binary file added docs/images/screenshots/ipv4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/screenshots/ipv6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/screenshots/missing-ip.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
83 changes: 83 additions & 0 deletions docs/testing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# Implementation and testing

## Implementation

The extension listens to `core.modify_notification_template` on phpBB 3.3 and
4.0. Only emails using `admin_activate.txt` are affected. Core's activation URL
identifies the account; the extension loads its stored registration details.
Missing accounts cannot expose Anonymous account details.

This event covers notification-manager mail from new registrations and direct
mail from activation resends. Core still controls recipients, preferences,
activation keys, and queuing. The extension does not replace a core service.

phpBB's resend path sends directly to administrators. It does not use the
registration notification-manager subscription preferences; the extension
preserves that existing behavior rather than changing who receives mail.

## Results — 10/26/2026

Both live boards used PHP 8.4.27 with SQLite and a localhost-only SMTP capture.

| Board | Source revision | Unit tests | Browser and delivery checks |
| --- | --- | --- | --- |
| phpBB 3.3.19 (3.3.x source) | `1b1ffdf89c033f584a1daf0c6995c13e59dcb81b` | 8 tests, 42 assertions | Passed |
| phpBB 4.0.0-a3-dev | `2a2dad29a4d47d26d8f01f4bf4851c98f809c481` | 8 tests, 42 assertions | Passed |

Source inspection also compared the current 3.3.x (`d8e558ca55`) and master
(`a4cea6406f`) revisions: the exercised UCP, notification and messenger paths
are unchanged from the runtime snapshots above. The phpBB 4.0 claim is for the
measured development snapshot, not a future final release.

Verified on each board:

- Real registration through Playwright, with separate applicant and admin mail.
- Correct account email, stored registration IP, registration date/timezone,
and existing profile/activation URLs; no password or unexpanded variables.
- IPv6 output and encoded lookup URLs; invalid addresses omit lookup links.
- Real activation resend from localhost retains the stored synthetic IPv6 IP.
- Mail remains queued until processing and retains its enriched contents.
- Registration notification email opt-out is respected.
- Disable plus cache purge restores the original email; re-enable plus cache
purge restores the enriched email.
- Administrator login and the email's activation key activate the correct account.

The installable package passes EPV with **0 fatal, 0 error, 0 warning, 0 notice**.
The production PHP passes both branches' phpBB extension coding standards.
Composer metadata validates; its explicit extension version produces Composer's
usual Packagist advisory. GitHub CI is configured but has not been run remotely.

## Repeat unit tests

Use the committed `phpbb-release-tools/phpbb-test-board/run-unit-tests.sh`
runner against this checkout, once with `-b 3.3.x` and once with `-b master`.
It uses phpBB's own test bootstrap and supported PHPUnit dependencies.

CI repeats the regression suite and code standards on both phpBB branches,
using PHP 8.3 and 8.4. The organization EPV workflow validates both branches.
The local runtime tests above used PHP 8.4; PHP 8.3 CI has not run yet.

## Repeat browser/delivery tests

Use `seed-forum` with a copy of the appropriate `tests/runtime/board-*.yml.example`.
Change the source and disposable board paths, choose free ports, and install
with `reset-board.sh --config YOUR_CONFIG --reset`. These fixtures are strictly
for disposable local boards. Mark the new board root by creating an empty
`.adminactivationdetails-test-board` file; the PHP fixture refuses unmarked boards.

Start `python3 tests/runtime/smtp_capture.py /path/to/artifacts/mail` in a
separate terminal. It listens only on `127.0.0.1:18250` and never relays mail.
Configure the board with `sudo -u www-data php tests/runtime/fixture.php BOARD_ROOT setup`.
Keep test-board CLI cache operations under the web-server user so Twig cache
permissions remain consistent. Run `cache:purge` after CLI extension state changes.

Run `tests/runtime/browser.js` through the Playwright skill runner, or with a
locally installed Playwright and Chromium, setting `TEST_URL`, `TEST_BOARD_ROOT`
and `TEST_ARTIFACT_DIR`. The script uses the local SMTP capture and invokes the
PHP fixture through noninteractive `sudo -u www-data`.

The browser test creates only synthetic `@example.org` accounts. It tests
registration, resend, IPv6, invalid IPs, queueing and opt-out; results are written
as JSON to the artifact directory. The test restores the admin subscription.
After testing, use the fixture's `mail-off` operation and stop the capture server.
Restore or remove only the disposable boards and their dedicated nginx sites.
Loading
Loading