Skip to content

Phase 2: admin screens on IPF - #3

Merged
fiammybe merged 2 commits into
mainfrom
claude/project-thread-kfbxfw
Oct 25, 2026
Merged

fiammybe merged 2 commits into
mainfrom
claude/project-thread-kfbxfw

Conversation

@fiammybe

Copy link
Copy Markdown
Contributor

What

All admin screens for imforum, built on icms_ipf_view_Table and getSecureForm():

  • Categories and forums: moderators as a multi-select on the forum form, and group permissions per forum. A new forum starts with the groups from the permission template.
  • Permission template: stored in its own table, and can optionally be applied to existing forums, replacing their permissions.
  • Reports (open/all toggle), suspensions (per forum or everywhere), digests and the archive.
  • Prune: a preview with a count, then a confirmation; topics are deleted or moved to another forum. Recount resyncs every counter in a few queries.
  • Overview with statistics and a link to open reports.

Security

imforum_admin_op() runs every write operation only on POST with a valid token. A deletion confirmation (confirm=1) needs a valid token too, because icms_ipf_Controller does not check it.

Core issues worked around

These were found by installing ImpressCMS 2.0.4 through the web installer, installing imforum and clicking through every screen:

  1. Missing admin menu on the first request after a cache rebuild. The core include_onces menu.php into another module object, so displayAdminMenu() fails on count(null). imforum_admin_menu() loads the menu itself.
  2. Empty permission select. A permission select left empty is not posted, and saveItem_Permissions() fails on count(null). imforum_admin_store() turns missing fields into empty arrays first.
  3. Date picker built too early. The date picker needs $xoTheme, so forms are passed as closures and rendered after icms_cp_header().

Tests

  • Unit tests: the token rule (AdminRequestTest), and each menu entry pointing to an existing script with the right tab index.
  • Integration tests (AdminToolsTest): moderators via the forum form, hidden counters that get recounted, synchroniseAll, findInactive and moveToForum.
  • End-to-end check on a real installation: one category, two forums, moderators and group permissions created without SQL. A POST with a forged token, a write via GET and a tokenless deletion confirmation were all refused. Prune deleted the matching topics.

Generated by Claude Code

Categories, forums (with moderators and group permissions), permission
template, reports, suspensions, digests, archive, prune and recount.
Every operation that writes requires POST and a valid security token,
including deletion confirmations. Works around three core issues found
on a real installation: the admin menu missing after a menu cache
rebuild, count(null) on an empty permission select, and the date picker
needing the theme before the form is built.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MZy45V5RV9nx6Buq8vqKHr
icms_module_Object sets hasconfig for any 'config' array, even an empty
one. The admin menu then offered a Preferences link for imforum, and the
preferences page, finding no settings, sent the user on to the system
module's preferences.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MZy45V5RV9nx6Buq8vqKHr
@fiammybe
fiammybe merged commit 8aab3d3 into main Oct 25, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants