/redaxo-ycom:ycom-extension-pointsfrom redaxo-ycom
Covers YCom extension points and injection system for intercepting and customizing the authentication flow (OTP, password change, terms-of-use), session management, and user activity logging in REDAXO.
Ships in redaxo-ycom. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Register in your addon's boot.php (no special guard needed — YCom EPs only fire when the auth plugin is active).
| EP | Fired in | Purpose |
|---|---|---|
YCOM_CONFIG | rex_ycom_config::init() | Override config values at runtime |
YCOM_AUTH_INIT | rex_ycom_auth::init() | After login check, before injections run |
YCOM_AUTH_LOGIN | rex_ycom_auth::login() | After successful login |
YCOM_AUTH_LOGIN_SUCCESS | rex_ycom_auth::login() | On credential login success |
YCOM_AUTH_USER_CHECK | articleIsPermitted() | Add custom article permission rules |
YCOM_AUTH_MATCHING | auth/boot.php | Map external auth data to user (generic) |
YCOM_AUTH_SAML_MATCHING | auth/boot.php | SAML-specific field mapping |
YCOM_AUTH_OAUTH2_MATCHING | auth/boot.php | OAuth2-specific field mapping |
YCOM_AUTH_CAS_MATCHING | auth/boot.php | CAS-specific field mapping |
YCOM_ARTICLE_PERM_SELECT | group/boot.php | Extend the article permission sidebar |
YCOM_USER_CREATE | createUserByEmail() | Before creating a user |
YCOM_USER_UPDATE | updateUser() | Before updating a user |
YCOM_USER_STATUS_OPTIONS | getStatusOptions() | Customize status dropdown options |
rex_extension::register('YCOM_AUTH_LOGIN_SUCCESS', function (rex_extension_point $ep) {
$user = $ep->getSubject(); // the logged-in user
if ($user instanceof rex_ycom_user) {
if (empty($user->getValue('firstname')) || empty($user->getValue('name'))) {
rex_ycom_auth::setSessionVar('profile_incomplete', true);
}
}
});
Then add an injection that redirects users with profile_incomplete=true to a profile-completion form.
Injections intercept the auth flow to enforce additional requirements (OTP not yet completed, password change required, terms not accepted yet). They run after init() but before the article renders.
| Injection | Priority | Trigger |
|---|---|---|
rex_ycom_injection_otp | 1 | OTP not verified in session |
rex_ycom_injection_passwordchange | 4 | new_password_required=1 on user |
rex_ycom_injection_termsofuse | 8 | termsofuse_accepted!=1 on user |
Lower priority numbers run first. OTP runs before password change so a stale password can't be set without 2FA.
The abstract base class is — verbatim, including the missing s — rex_ycom_injection_abtract. The typo is in the YCom source (plugins/auth/lib/injections/abstract.php), not in this skill. Use it as-is; rex_ycom_injection_abstract does not exist and would throw a fatal error.
class my_injection extends rex_ycom_injection_abtract {
public function getRewrite(): bool|string {
$user = rex_ycom_auth::getUser();
if (!$user) return false;
if ($user->getValue('profile_complete') != 1) {
return rex_getUrl($completeProfileArticleId);
}
return false;
// Return convention:
// false = skip this injection (no redirect)
// true = stay on current page (rare; the auth flow continues)
// string = redirect to this URL
}
public function getSettingsContent(): string { return ''; }
public function triggerSaveSettings(): void {}
}
// Register in boot.php
rex_ycom_auth::addInjection(new my_injection(), 5);
The priority 5 slots this injection between passwordchange (4) and termsofuse (8).
YCom stores sessions in the rex_ycom_user_session table:
| Column | Use |
|---|---|
session_id | PHP session ID |
cookie_key | Stay-logged-in cookie value |
user_id | The owner |
ip / useragent | Capture for audit |
starttime / last_activity | TTL enforcement |
otp_verified | OTP state for this session |
// Singleton instance
$session = rex_ycom_user_session::getInstance();
// Clear all expired sessions (good for cronjob)
rex_ycom_user_session::clearExpiredSessions();
// Force single-session: kick all other sessions for a user
$session->removeSessionsExceptCurrent($userId);
// Nuclear option: delete every session in the system (logs everyone out)
rex_ycom_user_session::deleteAllSessions();
Single-session enforcement at login:
rex_extension::register('YCOM_AUTH_LOGIN_SUCCESS', function (rex_extension_point $ep) {
$user = $ep->getSubject();
if ($user instanceof rex_ycom_user) {
rex_ycom_user_session::getInstance()
->removeSessionsExceptCurrent($user->getId());
}
});
YCom can log auth events to a dedicated log file:
rex_ycom_log::activate();
rex_ycom_log::log($user, rex_ycom_log::TYPE_LOGIN_SUCCESS, ['extra' => 'info']);
access, logout, click, login_failed, login_not_found, login_success, login_updated, login_deleted, registerd, session_failed, cookie_failed, session_impersonate
Log file path: rex_path::log('ycom_user.log').
Activate logging once in boot.php (not on every request):
if (!rex_ycom_log::isActive()) {
rex_ycom_log::activate();
}
For high-volume sites, consider feeding the log into a centralized log aggregator instead of relying on file rotation.
false instead of returning the modified subject – downstream listeners then see the broken value.YCOM_AUTH_LOGIN_SUCCESS without saving it – changes don't persist. Call $user->save() (and watch for validation failures).rex_ycom_user_session::clearExpiredSessions() only removes session DB rows; the underlying PHP session files aren't touched. Configure PHP's session.gc_maxlifetime separately.rex_ycom_log::TYPE_REGISTERD is misspelled in the constant (missing e) — that's the actual identifier; don't "fix" it.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub friendsofredaxo/claude-marketplace --plugin redaxo-ycom8 skills in this plugin
/ycom-external-authExternal authentication for YCom – SAML, OAuth2, and CAS. Covers config files (data/addons/ycom/saml.php, oauth2.php, cas.php), the ycom_auth_saml/oauth2/cas value fields, default user data, allowed-domain restrictions, and field-mapping via YCOM_AUTH_*_MATCHING extension points. Use when the user integrates SSO, configures OAuth2 providers, maps SAML attributes to YCom user fields, or enables direct-link login./ycom-formsReady-to-use YCom form recipes – login, logout, registration with email confirmation, profile edit, password change (with and without old-password check), password reset, terms-of-use re-acceptance. Pipe and PHP syntax. Includes the YCom-specific value/validate/action fields (ycom_auth_password, ycom_auth_load_user, ycom_auth_logout, ycom_auth_returnto, ycom_auth_db, ycom_user_token, etc.). Use when the user builds any frontend form that interacts with YCom./ycom-otpYCom OTP / two-factor authentication setup – TOTP and email-based OTP, the otp_article_id setup article, ycom_auth_otp setup field, OTP email template, enforcement modes, and the injection that gates unverified sessions. Use when the user enables 2FA, configures OTP enforcement levels, builds the OTP setup form, or troubleshoots the OTP flow./ycom-overviewYCom architecture for REDAXO – core classes, user model (rex_ycom_user), authentication API (rex_ycom_auth), status constants, config keys (article_id_login, session_duration, otp_*), brute-force rules, and the standard navigation/login-state integration. Use when the user works with YCom for the first time, looks up an auth API method, configures session timeouts or login redirects, builds a meta navigation that switches based on login state, or programmatically creates/logs in users./ycom-permissionsArticle and media permissions in YCom – the group plugin (group-based article/media access, group permission types) and the media_auth plugin (media-pool file protection, .htaccess rewrite rule, redirect rules). Use when the user gates articles by login state or group, sets up media file protection, configures redirects for unauthorized access, or queries group membership programmatically./ycom-quickstartOne-shot recipe to bootstrap a complete YCom community frontend on a REDAXO instance that has the FriendsOfREDAXO `api` addon installed. Builds a clean tree under a Community category — six entry-point sections (login, password-forgot, profile, password-change, registration, logout) as sub-categories so they appear in the meta navigation automatically, and three token-target sub-articles (registration-confirm, password-reset, terms-of-use) tucked under their related section. Wires the YForm pipe code into slices on the standard "YForm Formbuilder" module, sets per-article ycom_auth_type, inserts the email templates, and writes the ycom/auth config keys. Use when the user asks to "set up YCom community pages", "scaffold the YCom frontend", "create the login/registration flow", or runs a fresh REDAXO instance that needs YCom wired up programmatically. Skip when the instance has no `api` addon (offer the manual setup from `ycom-forms` instead).Other plugins' skills for the same job