1
Mamba
Re: XOOPS 2.7.4-RC1 Released

Thank you for your kind words!

It's nice that some people see and appreciate the progress!
Support XOOPS => DONATE
Use 2.7.x | Docs | Modules | Bugs



2
blindman
Re: XOOPS 2.7.4-RC1 Released
  • 9/26 11:15

  • blindman

  • Not too shy to talk

  • Posts: 120

  • Since: 2005/6/26


Xoops is gaining traction and making a major comeback in the CMS world.
It is catching up in many areas where it previously lagged behind.

I first dabbled in PHP thanks to Xoops—that was about 20 years ago—and I still try to implement things in a localhost environment.
As always, I look forward to daily updates on Xoops development.

I congratulate the team; the direction is encouraging.



3
Mamba
XOOPS 2.7.4-RC1 Released

Resized Image


XOOPS 2.7.4 RC 1 — two-factor authentication and a new editor experience

The XOOPS Development Team is pleased to announce XOOPS 2.7.4 RC 1, the release candidate for XOOPS 2.7.4. This release brings two-factor authentication into the core, makes SCEditor a full visual editor and the default for new sites, adds Markdown support through EasyMDE, and continues the security hardening of the 2.7 line.

The feature set is final. Please test this release candidate on a staging copy of your site and report anything you find before the final release.

DOWNLOAD: https://github.com/XOOPS/XoopsCore27/releases

Two-factor authentication

* Two methods: a time-based authenticator app (Google Authenticator, Microsoft Authenticator, Aegis, FreeOTP, or any password manager that generates TOTP codes), or a six-digit code mailed to the member's address
* Recovery codes: ten one-time codes at enrolment, for the day the phone or the mailbox is out of reach
* Lockout: five wrong codes lock the second step for fifteen minutes, and the member is notified by e-mail
* Self-service: members enrol, disable and replace their recovery codes from Edit Account; administrators can reset a member's factor from Users, and an operator locked out of the site has a documented recovery procedure
* Off by default: switch it to "Optional" in System Preferences and every member may enrol; nobody is forced
* Protected at rest: authenticator secrets are encrypted with a site key; mailed codes are stored hashed and expire after ten minutes

Editors

* SCEditor edits visually with its full toolbar and keeps XOOPS BBCode intact across visual and source modes. Its emoticons are registered as XOOPS smileys, and new installs use it as the default editor
* System > Preferences > Editors configures SCEditor's toolbar buttons, plugins, emoticons, resizing, auto-expand, spellcheck, size and the image category for dropped images
* Markdown through EasyMDE: Markdown is stored in the existing text columns and rendered with Parsedown in safe mode; the editor preview uses the same renderer
* More BBCode: MyTextSanitizer renders the tags SCEditor writes: sub, sup, s (strikethrough), justify, hr, ol and table
* TinyMCE 7.9.3: the bundled TinyMCE 7 is updated to the current 7.x release, which carries three content-sanitisation fixes

Security hardening

* Remember-me tokens are revoked when the password changes, including a lost-password reset
* A restored session ends for a deactivated account, and group membership is read from the database on every request, so a removed group right takes effect immediately
* Registration validates the account again at the save step, not only at the first step
* Comment editing and deletion check that the comment belongs to the module handling the request
* The TinyMCE image manager checks category permissions for upload, delete and listing, as the core image manager does
* The upgrade wizard admits webmasters only
* The LDAP and Active Directory adapters stop when a requested StartTLS connection fails, instead of continuing without it
* Editor output is tightened: BBCode attributes and rendered Markdown are restored only where they belong, and SCEditor's visual view checks link schemes

Fixes
* The upgrade wizard reports a patch task that cannot complete, instead of re-queuing it silently, and no longer re-queues the 2.5.10-to-2.5.11 patch on every run
* The Modern admin theme shows its redirect notifications again, in light, dark and right-to-left layouts
* The Administration Menu link in the user block is shown only to administrators
* Several legacy classes load again on PHP 8: the tar and zip downloaders, the XML-RPC parser, and XoopsTpl::fetchFromData()
* An unknown user ID in the users admin shows a message instead of an error page, and logout works on sites with remember-me turned off

Changed since Beta 2:

* the editor work (SCEditor, the Editors preferences, Markdown),
* the upgrade wizard fix,
* the Modern theme notifications,
* the user-block fix,
* the PHP 8 legacy-class fixes,
* translatable upgrade-wizard messages are new in RC 1.
* the System module moves to 2.1.13; the upgrade wizard applies it.

Upgrading from 2.7.3

Copy the new files over the web root and run the upgrade wizard. It creates the user_2fa table and the two-factor preference, registers the SCEditor emoticons as smileys, and adds the Editors preferences. No mainfile.php changes are needed.
* Two-factor authentication needs the PHP sodium extension; the wizard reports whether it is available. Operations notes are in docs/2fa-operations.md
* Every remembered device logs in once more after the upgrade
* An upgraded site keeps its current editor settings; SCEditor becomes the default only on a fresh install. For SCEditor's MP3 button, set 'mp3' => 1 in xoops_data/configs/textsanitizer/config.php
* If you copied extras/login.php (the SSL popup login) elsewhere on your site, replace or remove that copy: updating the core does not patch it
* A site running a custom template set should re-import it

From a 2.7.4 beta: copy the new files and run the upgrade wizard again; it applies the RC 1 changes and updates the System module.

System requirements

PHP 8.2 to 8.5, MySQL 5.7+ or MariaDB 10.3+, and the PHP sodium extension for two-factor authentication.

Translations

XOOPS is available in 37 community translations at https://github.com/XoopsLanguages. XOOPS 2.7.4 adds English strings for two-factor authentication, the Editors preferences, SCEditor and the upgrade wizard; docs/lang_diff.txt lists every new constant. Translators, thank you: updated packs are very welcome before the final release.

Reporting issues

Please report bugs at https://github.com/XOOPS/XoopsCore27/issues with your PHP and MySQL versions and the steps to reproduce. Questions are welcome in the support forums.

Thank you to everyone who tested the betas, reported issues, submitted pull requests, translated strings and reviewed security findings during the 2.7.4 cycle. And a standing thank-you to JetBrains for the complimentary PhpStorm licenses that power the core team's development.

The XOOPS Development Team
Support XOOPS => DONATE
Use 2.7.x | Docs | Modules | Bugs



4
Mamba
Re: XOOPS Plugin for PhpStorm 1.0 Alpha 3 Released

4. Inspections + Alt+Enter

  1. Copy test-fixtures/bad_module_sample.php under htdocs/modules/_xoops_demo/.
  2. Open it — highlights for guards, query/exec, Request, etc.
  3. Alt+Enter on each highlight and apply the fix.
  4. For Smarty: a .tpl with bare {if …} should offer delimiter conversion.
  5. Goffy / wgSimpleAcc shapes: test-fixtures/wgsimpleacc_shapes.php (namespaced die guard + while (list = fetchRow)) and test-fixtures/index_404_stub.php (must not warn).

All inspections live under Settings → Editor → Inspections → XOOPS. Each can be switched off or downgraded there, and the Inspection ID below is what you put in a @noinspection comment or an .idea/inspectionProfiles file. Every inspection is silent in vendor/, templates_c/, cache/ and node_modules/.

4.1 Deprecated database API — XoopsDeprecatedDbApi

Flags queryF() and quoteString(). Use query() / exec() and quote() instead.

Why. queryF() was the "force" variant that skipped the write block on query(). Since XOOPS 2.5.12 the split is explicit: query() refuses mutating SQL and exec() is the only sanctioned write path, so queryF() no longer has a job. quoteString() is a plain alias of quote() kept for backward compatibility and scheduled for removal.

// before $db->queryF('UPDATE ' . $db->prefix('news') . ' SET hits = hits + 1'); $name = $db->quoteString($name); // after $db->exec('UPDATE ' . $db->prefix('news') . ' SET hits = hits + 1'); $name = $db->quote($name);

Quick-fixes. quoteString() is renamed to quote(). For queryF() the inspection reads the first string argument to decide what to offer:

  • SQL starting with SELECT / SHOW / DESCRIBE / EXPLAIN: rename to query() only.
  • SQL starting with INSERT / UPDATE / DELETE / REPLACE / TRUNCATE / ALTER / DROP / CREATE: exec() is offered first, query() second.
  • SQL that cannot be read (a variable, a concatenation): both renames are offered; pick by intent.

exec() takes one argument, so the exec() rename is withheld while the call still passes $limit / $start. Drop those first, then re-run the fix.

4.2 Deprecated XOBJ_DTYPE_UNICODE_* — XoopsDeprecatedUnicodeDtype

XOBJ_DTYPE_UNICODE_* constants were deprecated in XOOPS 2.7.3 (core issue #164) and are scheduled for removal in 4.0. The quick-fix renames the constant to its non-UNICODE successor (XOBJ_DTYPE_TXTBOX, TXTAREA, URL, EMAIL, ARRAY, OTHER). Value migration stays a core concern and is not performed here. Silent when the project Core Version is set to 2.5.

Why. The UNICODE_* types date from the pre-UTF-8 era when a field had to declare that it might hold multibyte text. Every supported core runs on utf8mb4, so the distinction is dead weight: the sanitizer treats XOBJ_DTYPE_UNICODE_TXTBOX and XOBJ_DTYPE_TXTBOX identically. Renaming is safe at the initVar() site because it changes only which constant name is looked up, not how the stored value is read or written.

// before $this->initVar('title', XOBJ_DTYPE_UNICODE_TXTBOX, null, true, 255); // after $this->initVar('title', XOBJ_DTYPE_TXTBOX, null, true, 255);

Core Version gate. The 2.5 LTS line never deprecated these constants, so a module that must keep running on 2.5 gets no warning. Set Core Version to 2.5 in Settings for that project; Auto, 2.7 and 4.0 all report.

4.3 isResultSet guard — XoopsResultSetGuard

Warns when fetchArray / fetchRow / fetchBoth appears without a dominating isResultSet check. Prefer the two-part guard:

$result = $db->query($sql); if (!$db->isResultSet($result) || !$result instanceof \mysqli_result) { throw new \RuntimeException('Database query failed'); } while (list($id, $title) = $db->fetchRow($result)) { // ... }

An early-exit guard covers later fetches of the same variable, including while (list(...) = $db->fetchRow($result)), until that variable is reassigned. The quick-fix inserts before the enclosing statement using the current PSI (safe to apply several times after Inspect Code).

Why two parts. query() returns false on failure, and fetchArray(false) is a fatal TypeError on PHP 8. isResultSet() is the XOOPS check; the instanceof \mysqli_result half is for static analysers such as Scrutinizer and PHPStan, which do not know that isResultSet() narrows the type.

What counts as guarded. The analysis is textual, so it follows a few explicit rules rather than full control flow:

  • A negative check that throws, returns or exits (if (!$db->isResultSet($result)) { return; }) covers every later fetch of $result in the same block. It stops covering at a reassignment of $result, at a nested function, or when the enclosing } closes.
  • A positive check (if ($db->isResultSet($result)) { ... }) covers fetches inside its body, brace-less body included. || and xor in a positive condition disqualify it: if ($db->isResultSet($result) || $fallback) can enter the body with $result === false, so the fetch inside is still reported. || is fine only in the terminating negative form above.
  • $result = $db->fetchArray($result) inside a guarded region stays guarded: the fetch reads the old value. $result = false or $db->fetchArray($result) does not, because or binds looser than = and the assignment completes first.
  • &&, and and xor in the guard condition disqualify it. if (!isResultSet($r) && $x) return; can fall through while $r is still false.
  • Comments and strings are masked first, so a commented-out guard never counts.

Guard quick-fix scope. The guard is inserted within the existing statement list. Unbraced if, while, for and foreach bodies receive a warning without a quick-fix; add braces first so the guard can stay inside the control flow.

4.4 include_once for headers — XoopsIncludeOnceHeader

XOOPS module entry points should load header.php / footer.php with include_once (not bare include).

Why. header.php starts the theme, opens the output buffer and pulls in $xoopsTpl; footer.php renders and flushes. Including either twice, which happens easily once a page delegates to a shared include/ file, produces duplicate headers or a blank page. include_once makes the second include a no-op. The rule applies to the core files and to a module's own header.php / footer.php, with or without the XOOPS_ROOT_PATH . prefix.

// before include XOOPS_ROOT_PATH . '/header.php'; include __DIR__ . '/footer.php'; // after include_once XOOPS_ROOT_PATH . '/header.php'; include_once __DIR__ . '/footer.php';

Quick-fix rewrites the keyword in place. require / require_once are not touched; only a bare include of a header.php / footer.php path is reported.

4.5 Direct-access guard — XoopsRootPathGuard

Reports include-only PHP files (classes, preloads, includes, blocks) that lack a terminating defined('XOOPS_ROOT_PATH') || exit/die(...) guard. The guard must be the first executable statement after <?php, declare and namespace; a use block before or after it is fine. die and exit are both accepted. In namespaced files the quick-fix inserts the guard after the namespace and before the use block (never before namespace, that is invalid PHP).

Not reported: language files, vendor/cache, tests, xoops_version.php, admin/ control-panel scripts, files whose first work is including mainfile.php / header.php / admin_header.php, and directory-protection stubs that only send HTTP 404/403.

Why. Files under class/, include/, preloads/, blocks/, kernel/ and src/ are meant to be pulled in by a bootstrapped page. Requested directly over HTTP they run without a session, without $xoopsUser, and with every global undefined, which is how include files turn into information leaks or code paths that skip permission checks. The guard turns a direct request into a one-line exit.

<?php namespace XoopsModules\Demo; defined('XOOPS_ROOT_PATH') || exit('Restricted access'); use XoopsModules\Demo\Constants; class Accounts extends \XoopsObject { }

Placement. PHP requires namespace to be the first statement, but use imports may follow executable code, so the guard sits between them. That is also where the wgSimpleAcc family and most Goffy modules put it. if (!defined('XOOPS_ROOT_PATH')) { exit('...'); } is accepted as an equivalent form.

Why entry points are skipped. A page that starts with include mainfile.php or header.php is bootstrapping itself and must be reachable over HTTP. admin/ scripts include admin_header.php for the same reason. A guard on any of these would exit every public request. A 404/403 stub (header('HTTP/1.0 404 Not Found'); and nothing else) is meant to answer direct requests, so a guard there would replace the intended HTTP status with "Restricted access".

Quick-fix limits. The fix computes the insert offset from the file, so it works after declare(strict_types=1), multiple declare statements, namespace Foo; and namespace Foo { … }, with both <?php and short <? tags. A file that starts with HTML before its first <?php is still reported, but the fix declines rather than guess where the guard belongs.

4.6 query() vs exec() — XoopsQueryExec

Flags string SQL starting with INSERT / UPDATE / DELETE / REPLACE / TRUNCATE / ALTER / DROP / CREATE passed to ->query(). Use exec() for mutations (XOOPS 2.5.12+ convention).

Why. Since 2.5.12 query() inspects the statement and blocks writes on a GET request, logging query() called with a mutating statement; use exec(). Code that worked on 2.5.11 silently stops writing on upgrade, and the only symptom is a log line. Splitting reads and writes at the call site also makes a future prepared-statement layer possible, because exec() never needs $limit / $start.

// before $db->query('DELETE FROM ' . $db->prefix('news') . ' WHERE storyid = ' . $id); // after $db->exec('DELETE FROM ' . $db->prefix('news') . ' WHERE storyid = ' . $id);

Quick-fix renames query to exec when the call has a single argument. With $limit / $start present the problem is still reported, but the fix is withheld: exec() takes one argument, so the extra ones must be removed by hand first. SQL held in a variable is not inspected; only a string literal as the first argument is read.

4.7 Raw superglobals — XoopsSuperglobal

Flags raw $_GET, $_POST, $_REQUEST, and $_COOKIE in module and XMF code. Prefer \Xmf\Request.

Why. \Xmf\Request does the type coercion, default handling and filtering that hand-written isset($_POST['x']) ? (int) $_POST['x'] : 0 tends to get subtly wrong, and it makes the input source explicit. $_REQUEST merges GET, POST and COOKIE in php.ini-dependent order, so a cookie can override a form field; that is why the fix always names a source and never offers $_REQUEST as one.

// before $op = $_GET['op']; $name = $_POST['name']; // after $op = \Xmf\Request::getString('op', '', 'GET'); $name = \Xmf\Request::getString('name', '', 'POST');

Quick-fix scope. Only a keyed read with a string-literal key ($_GET['op'], $_POST['name'], $_COOKIE['sid']) gets an Alt+Enter replacement, and it always uses getString. Change it to getInt, getBool, getArray or getCmd afterwards when the value is not free text. A bare $_POST (passed to a function, iterated, or used with a variable key) and any use of $_REQUEST are warnings only, because the right method and source cannot be inferred.

4.8 Missing registered template — XoopsMissingRegisteredTemplate

A template listed in xoops_version.php (file / template key) was not found under the module templates/ (or blocks/) directory. A case-only difference is reported as TEMPLATE_CASE_MISMATCH, with the actual disk spelling and no create-file quick-fix.

Why. On install and update XOOPS reads $modversion['templates'] and copies each listed file into the tplfile table. A missing file is skipped without an error, so the page or block later fails with a Smarty "unable to read resource" message that names a template you registered but never created, or that was renamed on disk without the manifest following.

$modversion['templates'][] = [ 'file' => 'demo_index.tpl', // must exist as templates/demo_index.tpl 'description' => 'Index page', ];

Both template inspections read xoops_version.php only, so they cover legacy and hybrid modules; a module.json-only module is not checked.

Quick-fix creates the file under templates/, keeping any sub-path in the name (blocks/demo_block.tpl becomes templates/blocks/demo_block.tpl), with a Smarty comment <{* name *}> as placeholder so the manifest and disk agree; fill in the markup afterwards. The inspection runs on xoops_version.php and is the inverse of 4.9.

4.9 Unregistered template — XoopsUnregisteredTemplate

A .tpl file under the module templates/ or blocks/ directory is not listed in xoops_version.php, so Smarty cannot display() it as a registered module template. Theme overrides under themes/ are ignored. The quick-fix appends a $modversion['templates'][] entry to the manifest.

Why. The db: template resource resolves through the tplfile table, and only registered templates get a row. An unregistered .tpl renders fine from the file system on a stock template set during development, then breaks on a site whose template set was imported, or on the first module update that resyncs templates. Registering it at creation time removes the surprise.

Matching. A manifest entry may be spelled relative to templates/ (demo_index.tpl, the XOOPS convention) or from the module root (templates/demo_index.tpl); both are accepted. Case-insensitive matching identifies the registration, but filename and directory spelling must match the disk exactly. The missing-template inspection and scanner report casing differences as a case mismatch, not a missing or unregistered template.

Quick-fix appends this at the end of the manifest (before a trailing ?> if there is one), unless the name is already quoted somewhere in the file:

$modversion['templates'][] = [ 'file' => 'demo_orphan.tpl', 'description' => '', ];

Files under themes/ and templates_c/ are never reported: a theme override is not a module template, and compiled templates are generated.

4.10 Wrong Smarty delimiters — XoopsWrongSmartyDelimiter

XOOPS Smarty uses <{ and }> delimiters. Bare {if} / {$var} tags are usually a mistake and will not render.

Why. XOOPS configures Smarty with <{ }> so that plain braces in CSS, JavaScript and JSON inside a template are left alone. A tag written in stock Smarty syntax is not an error: it is passed to the browser as literal text, so the symptom is {$title} appearing on the page, or an {if} block that always shows both branches.

<!-- before --> {if $items}<ul>{foreach $items as $item}<li>{$item.title}</li>{/foreach}</ul>{/if} <!-- after --> <{if $items}><ul><{foreach $items as $item}><li><{$item.title}></li><{/foreach}></ul><{/if}>

What is matched. A brace immediately followed by $ or by one of the common tag keywords (if, /if, foreach, /foreach, include, assign, block, literal) up to the closing brace on the same line. Tags already written as <{ … }> are skipped, and so are braces that do not look like a tag, which keeps inline CSS and JavaScript quiet.

Quick-fix wraps the tag in <{ }>. Apply it per tag, or run Code → Inspect Code on the templates/ folder and use Apply fix on the group to convert a whole template.

Support XOOPS => DONATE
Use 2.7.x | Docs | Modules | Bugs



5
Mamba
Re: XOOPS Plugin for PhpStorm 1.0 Alpha 3 Released

1. Install

./gradlew buildPlugin

# Windows: gradlew.bat buildPlugin

Then Install Plugin from Disk… → build/distributions/xoops-support-*.zip → restart.

2. Project detection

  1. Open a real XOOPS install (with mainfile.php or htdocs/mainfile.php). This plugin repository alone is not a XOOPS site root.
  2. Optional balloon: “XOOPS Support active”.
  3. Tools → XOOPS Support → Show XOOPS Project Info (runs in the background).
  4. Settings (search “XOOPS Support”): enable/disable, Core Version, suppress notification.

3. Tool window / scanner

  1. View → Tool Windows → XOOPS Support
  2. Refresh (or Tools → XOOPS Support → Refresh XOOPS Overview)
  3. Click findings to open files.

Reading the Overview. The header line gives the totals (here 22 modules, 316 findings) and the detected core line (XOOPS 2.7.x, from the Core Version setting or auto-detection) with the web root the scan used.

The Modules table lists every directory under modules/ that has a manifest, one row per module:

Column

Meaning

Manifest

xoops_version.php (legacy), module.json (4.0), or hybrid when both exist

TPL

.tpl files under templates/

Lang

.php files under language/ (all locales)

Pre

.php files under preloads/

Cls

.php files under class/ and src/ together

The counts are a quick health read: TPL 0 means the module renders nothing of its own (fine for a library module such as protector or xwhoops), Lang grows with every shipped locale (each adds its own set of files), and an unexpectedly large Cls usually means a vendored library sits under class/ or src/.

Findings are listed per module in the same order as the table. Each line is a kind, a message and a file:line link that opens the editor at that spot. The kinds map onto the section 4 inspections:

Finding

Inspection

MUTATING_QUERY

4.6 XoopsQueryExec

DEPRECATED_QUERY_F, DEPRECATED_QUOTE_STRING

4.1 XoopsDeprecatedDbApi

RAW_REQUEST

4.7 XoopsSuperglobal, $_REQUEST only; keyed $_GET / $_POST are left to the editor

MISSING_REGISTERED_TEMPLATE

4.8 XoopsMissingRegisteredTemplate

TEMPLATE_CASE_MISMATCH

4.8 XoopsMissingRegisteredTemplate: filename/directory spelling differs from disk

UNREGISTERED_TEMPLATE

4.9 XoopsUnregisteredTemplate

WRONG_SMARTY_DELIMITER

4.10 XoopsWrongSmartyDelimiter

SCAN_ERROR

a file or directory the scanner could not read

The scanner reports the first occurrence per file for the code-pattern kinds, so one RAW_REQUEST line can stand for several uses in that file; the editor inspection marks each one. The guard and isResultSet rules run only in the editor, where they have the PSI they need.

Use the Overview as the whole-site view: triage a large install or a module you have just imported, then open a file and let Alt+Enter do the individual fixes. The scan runs as a background task and honours Cancel.

Support XOOPS => DONATE
Use 2.7.x | Docs | Modules | Bugs



6
Mamba
ModuleTools 1.5 for XOOPS 2.8.0

Resized Image


ModuleTools: the shared toolbox every XOOPS 2.8.0 module now gets for free
 
If you have ever built a XOOPS module, you know the ritual. Copy a class/Common/ folder from the last module. Paste in the install helpers, the version checks, the admin table code, the confirmation dialog, the breadcrumb builder. Fix the namespace. Hope nothing drifted since the last copy.
 
With XOOPS 2.8, that ritual is over. ModuleTools ships inside XOOPS 2.8.0 Core as Xoops\ModuleTools\*, autoloaded on every request. There is nothing to install, nothing to activate, and no helper module to keep in sync. Your module just calls it.
 
What is in the box
 
ModuleTools is the successor to the mTools helper module, rebuilt as a proper library. It gathers the services modules used to carry as copied files:
 
 
*  Install and update hooks. Directory checks, file checks, dependency and version guards, sample-data buttons, and an update checker that reads your GitHub releases.
*  Admin pages in minutes. Object tables, tree tables, single-record views, CSV export, and a controller that handles create, edit, delete and uploads from one form definition.
*  Objects and forms. A dynamic object base with SEO fields and a form builder that turns your handler's metadata into a ready XoopsThemeForm.
*  Front-end helpers. Breadcrumbs, letter navigation, pagination, text truncation with intact HTML, social bookmarks, syntax highlighting, image resizing.
*  Permissions. Per-item group permissions with a clean gateway, so your module never writes to the permission table by hand.
*  Module lifecycle. A ModuleContext value object for paths, URLs and constants, a namespace autoloader that also understands legacy filenames, and a cloner that turns one module into the starting point for the next.
 
 
Why it matters
 
Less code to own. A typical converted module drops dozens of copied files. Fewer files means fewer places for a bug to hide and fewer places to patch when one is found.
 
Security fixes land once. When the confirmation dialog or the CSV export is hardened, every module on the site gets the fix on the next Core update. No module release required.
 
Modern PHP, tested. The library targets PHP 8.4, passes PHPStan at level 6, and ships a growing PHPUnit suite that includes consumer tests run against real modules inside a XOOPS tree.
 
No migration cliff. Existing modules keep working. ModuleTools registers lazy aliases for the stable XoopsModules\Mtools\* names, so a module written for the mTools module runs on 2.8 unchanged. When you are ready, the migration guide walks through swapping copied classes for library calls, and a Rector rule set does most of the typing.
 
Still there for 2.7. Sites on XOOPS 2.7.x keep the separately distributed mTools module with the same class names. Write against the API once and it runs on both.
 
Getting started
 
On XOOPS 2.8 the library is already loaded. In a module, grab your XMF helper and go:
 
use XmfModuleHelper;
use 
XoopsModuleToolsModuleModuleContext;
 
$helper 
= Helper::getHelper('mymodule');
$ctx    = ModuleContext::fromHelper($helper);
$ctx->uploadPath('images');
 
For standalone development, composer require xoops/moduletools brings in the same package with its stubs and test suite.
 
The full walkthrough lives in docs/getting-started.md, and docs/migrating-a-module.md covers converting an existing module. Try it on your next module, or on the one you have been meaning to clean up, and let us know what you build.
 
PACKAGIST: https://packagist.org/packages/xoops/moduletools
 
INSTALLATION: composer require xoops/moduletools
Support XOOPS => DONATE
Use 2.7.x | Docs | Modules | Bugs



7
Mamba
XOOPS Plugin for PhpStorm 1.0 Alpha 3 Released

Resized Image


XOOPS Support Plugin for PhpStorm: Alpha 3 is here

PhpStorm finally speaks XOOPS. XOOPS Support 1.0.0 Alpha 3 teaches the IDE the conventions that used to live only in our heads: language constants, xoops_version.php, the <{ }> Smarty delimiters, the isResultSet guard, the direct-access guard. The result is fewer round trips to the browser, fewer "why is this blank" moments, and cleaner modules on the first commit.

DOWNLOAD / INSTALLATION: Install it from the JetBrains Marketplace: plugins.jetbrains.com/plugin/33478

What you get

Ctrl+B on language constants. Put the cursor on _MI_, _AM_, _MD_, _CO_ or _MB_ and jump straight to its define(), with language/english/ preferred. Find Usages works the other way round. Completion now reads every file under language/, not a fixed list, so your own catalogs are covered.

Templates that match the manifest. Two inspections keep xoops_version.php and the templates/ folder in sync. A registered template that is missing on disk is flagged, and so is a .tpl on disk that was never registered. Both come with a one-click fix: create the file, or append the manifest entry.

Resized Image



Ten inspections with Alt+Enter fixes. Missing defined('XOOPS_ROOT_PATH') || exit guard, fetchArray() without isResultSet(), query() used for a write, the deprecated queryF() / quoteString(), XOBJ_DTYPE_UNICODE_* (deprecated since 2.7.3), raw $_GET / $_POST / $_REQUEST, bare {if} instead of <{if}>, and include where include_once belongs. Each one explains why in its description and fixes itself with a keystroke.

Resized Image


A site-wide Overview. The XOOPS Support tool window scans the whole install in the background, lists every module with its template, language, preload and class counts, and turns every finding into a clickable file:line. Cancel works, and it stays idle until you press Refresh.

Resized Image



Core-version aware. Tell the plugin whether the project targets 2.5, 2.7 or 4.0 and the inspections adjust. The UNICODE deprecation, for example, stays quiet on a 2.5 LTS project.

What changed in Alpha 3

This release grew out of real field reports on production modules, and every fix has a test behind it.


* Findings are no longer reported twice per file.
* The isResultSet quick-fix applies cleanly in an Inspect Code batch, and an early-exit guard now covers while (list(...) = $db->fetchRow($result)).
* The direct-access guard understands namespaced files, die as well as exit, short <? tags and multiple declare statements, and inserts after namespace where PHP requires it. Entry points, admin/ scripts and 404 stubs are left alone.
* Block templates in templates/blocks/ registered by bare name, the ['template'] = '…' assignment style, and manifests with URLs in descriptions all parse correctly, so the Overview no longer shows phantom template findings.
* Commented-out define() calls stay out of completion and navigation.
* Your Core Version setting from Alpha 2 carries over.


Try it


* Install the plugin and open your XOOPS webroot in PhpStorm.
* Open View → Tool Windows → XOOPS Support and press Refresh.
* Open any module file and press Alt+Enter on a highlight.


The full walkthrough is in the tutorial that ships with the plugin. Feedback and bug reports are welcome at github.com/XOOPS/phpstorm-plugin.
Support XOOPS => DONATE
Use 2.7.x | Docs | Modules | Bugs



8
Mamba
XOOPS 2.7.4-Beta2 with 2FA Released for Testing

Resized Image


XOOPS 2.7.4 Beta 2 — Two-Factor Authentication (2FA) comes to the Core

The XOOPS Development Team is pleased to announce XOOPS 2.7.4 Beta 2. The headline feature is two-factor authentication (2FA) built into the core: every member can protect their account with a second step at login, using an authenticator app or a code sent by e-mail. This is a beta for testing; please try it on a staging copy of your site and report what you find.

Two-factor authentication

* Two methods: a time-based authenticator app (Google Authenticator, Microsoft Authenticator, Aegis, FreeOTP, or any password manager that generates TOTP codes), or a six-digit code mailed to the member's address
* Ten one-time recovery codes at enrolment, for the day the phone or the mailbox is out of reach
* Five wrong codes lock the second step for fifteen minutes; the member is notified by e-mail
* Remember-me cookies are bound to the enrolled factor, so a reset invalidates them
* Members manage everything themselves from Edit Account, including disabling and replacing recovery codes
* Administrators reset a member's factor from Users, and an operator locked out of the site has a documented escape hatch
* Off by default. Switch it to "Optional" in System Preferences and every member may enrol; nobody is forced
* Secrets are encrypted at rest with a site key; mailed codes are stored hashed and expire after ten minutes

Also in this beta

* The login flow was split into reusable pieces, and every login path that cannot show a challenge (the upgrade wizard, XML-RPC, the SSL popup) refuses an account that must present its factor
* Account deletion removes the member's tokens and factor row, and no longer fails half-way
* A MySQL integration job now runs the concurrency and installed-site tests on PHP 8.2 through 8.5 on every change

Upgrading from 2.7.3

Copy the new htdocs/ files over the web root and run the upgrade wizard; it creates the user_2fa table and the new preference. Two-factor needs the PHP sodium extension, which the wizard checks for. No mainfile.php changes are needed. Operations notes: docs/2fa-operations.md in the package.

System requirements

* PHP >= 8.2.0 (PHP 8.4 or 8.5 recommended, prepared for 8.6)
* MySQL >= 5.7.8 or MariaDB >= 10.5 (a supported MySQL 8.x or MariaDB LTS recommended)
* Apache 2.4+ or nginx

MORE INFO: Read our News Release

DOWNLOAD: You can download the release from here: https://github.com/XOOPS/XoopsCore27/releases

Thank you to everyone testing the betas. Report issues at https://github.com/XOOPS/XoopsCore27/issues
Support XOOPS => DONATE
Use 2.7.x | Docs | Modules | Bugs



9
Mamba
XOOPS 2.7.4-Beta1 (ready for PHP 8.6)

Resized Image


XOOPS 2.7.4 Beta 1 — session and comment hardening

The XOOPS Development Team announces XOOPS 2.7.4 Beta 1, a security-focused update to the 2.7 line. It closes seven authorisation and session gaps found in a review of the 2.7.3 core, updates the bundled TinyMCE 7 to a release with content-sanitisation fixes, and repairs an upgrade-wizard fault that could stall a site on an old patch. XOOPS 2.7.4 runs on PHP 8.2 through 8.5.

Ready for PHP 8.6

* Complete session save-handler contract: create_sid() ahead of its PHP 9.0 requirement, new sessions survive 8.6's updateTimestamp() routing, session.use_strict_mode pinned to the 8.6 default today
* Deprecations cleared ahead of time: constructor value-returns (guarded by a repository-wide test), is_long(), curl_close(), imagedestroy()


System requirements

* PHP >= 8.2.0 (PHP 8.4 or 8.5 recommended, prepared for 8.6)
* MySQL >= 5.7.8 or MariaDB >= 10.5 (a supported MySQL 8.x or MariaDB LTS recommended)
* Apache 2.4+ or nginx

MORE INFO: Read our News Release

DOWNLOAD: You can download the release from here: https://github.com/XOOPS/XoopsCore27/releases
Support XOOPS => DONATE
Use 2.7.x | Docs | Modules | Bugs



10
Mamba
Re: XOOPS Debugbar 1.4.1 Released

That's excellent!

I'm happy that it's useful for you!

If you find any bugs, you can report them on GitHub, and please post it here with the link to GitHub as well.
Of course, if you have fixes for any bugs, please submit them as well.
Support XOOPS => DONATE
Use 2.7.x | Docs | Modules | Bugs




TopTop
(1) 2 3 4 ... 29457 »