woutersf/uli-bundle
Composer 安装命令:
composer require woutersf/uli-bundle
包简介
Generate secure one-time login links for Mautic users via command line
README 文档
README
This plugin provides the ability to generate secure one-time login links for Mautic users via console command.
Features
- 🔐 Secure One-Time Links: Generate cryptographically secure login URLs
- ⏰ Auto-Expiration: Links expire after 24 hours (configurable)
- 🗑️ Auto-Cleanup: Used links are automatically deleted
- 📋 Comprehensive Logging: All login attempts logged for security auditing
- 🛡️ Security Built-in: Protection against replay attacks and expired tokens
- 💻 CLI-Based: Easy integration with automation and scripts
Usage
Generate a unique login link
php bin/console mautic:uli {user_id}
Example:
php bin/console mautic:uli 1
This will generate a URL like:
https://yourmautic.com/s/unique_login?hash=abc123...
Access the login link
Users can access the generated URL in their browser to be automatically logged in. The link:
- Expires after 24 hours
- Is automatically deleted after use
- Logs all access attempts (successful and failed)
Database Schema
The plugin creates a table plugin_uli_unique_logins with the following structure:
id- Primary keyhash- Unique 64-character hashuser_id- Foreign key to users tablettl- Time-to-live (expiration datetime)date_created- Creation timestamp
Security Features
- Cryptographically secure random hash generation
- Automatic cleanup of expired tokens
- Comprehensive logging of all login attempts
- User account status validation
- Protection against replay attacks (one-time use)
Installation
Option 1: Composer (Recommended)
-
Add the plugin to your Mautic installation:
composer require mautic/uli-bundle
-
Run database migrations:
php bin/console doctrine:migrations:migrate
-
Clear the Mautic cache:
php bin/console cache:clear
-
Navigate to Mautic Settings → Plugins and verify installation
Option 2: Manual Installation
-
Clone or download this repository into your Mautic plugins directory:
cd /path/to/mautic/plugins git clone <repository-url> MauticUliBundle
-
Run database migrations:
php bin/console doctrine:migrations:migrate
-
Clear the Mautic cache:
php bin/console cache:clear
-
Navigate to Mautic Settings → Plugins and verify installation
Option 3: Private Repository
If you're hosting this plugin in a private repository, add it to your composer.json:
{
"repositories": [
{
"type": "vcs",
"url": "https://github.com/your-username/mautic-uli-bundle.git"
}
],
"require": {
"mautic/uli-bundle": "^1.0"
}
}
Then run:
composer update mautic/uli-bundle php bin/console doctrine:migrations:migrate php bin/console cache:clear
Configuration
The plugin supports the following configuration parameters:
uli_token_lifetime- Token lifetime in hours (default: 24)
You can configure this in your app/config/local.php:
return [ 'parameters' => [ 'uli_token_lifetime' => 48, // 48 hours ], ];
Use Cases
- Password Recovery: Generate secure login links for users who forgot their password
- Customer Support: Provide temporary access to user accounts for support purposes
- Automation: Integrate with scripts to provide secure access after account creation
- Emergency Access: Quick access for administrators without knowing passwords
- Testing: Generate login links for testing purposes without managing passwords
Requirements
- Mautic 4.x or higher
- PHP 7.4 or higher
- Database with migration support
Publishing to Packagist
To make this plugin available via Composer for everyone:
-
Push to GitHub (or GitLab/Bitbucket):
git init git add . git commit -m "Initial release v1.0.0" git tag v1.0.0 git remote add origin https://github.com/your-username/mautic-uli-bundle.git git push -u origin main git push --tags
-
Submit to Packagist:
- Go to https://packagist.org
- Sign in with your GitHub account
- Click "Submit"
- Enter your repository URL:
https://github.com/your-username/mautic-uli-bundle - Packagist will automatically track new releases via your Git tags
-
Auto-Update Hook (Optional):
- In your GitHub repository settings, add Packagist webhook for automatic updates
- Settings → Webhooks → Add webhook
- Payload URL:
https://packagist.org/api/github?username=YOUR_USERNAME
Version Tagging
When releasing new versions:
# Update composer.json version if needed git add . git commit -m "Release v1.1.0" git tag v1.1.0 git push && git push --tags
Packagist will automatically detect the new tag and update the package.
Author
Mautic Community / Frederik Wouters
License
GPL-3.0-or-later
Support
For issues, questions, or contributions, please open an issue in the repository.
Changelog
Version 1.0.0
- Initial release
- Secure one-time login link generation via CLI
- 24-hour token expiration (configurable)
- Automatic cleanup of used/expired tokens
- Comprehensive security logging
- Database migrations
- Composer support
woutersf/uli-bundle 适用场景与选型建议
woutersf/uli-bundle 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 0 次下载、GitHub Stars 达 1, 最近一次更新时间为 2025 年 11 月 27 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「cli」 「plugin」 「Mautic」 「secure-login」 「one-time-login」 「uli」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 woutersf/uli-bundle 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 woutersf/uli-bundle 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 woutersf/uli-bundle 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
CakePHP 4.x AdminLTE Theme.
Historical accounting for contacts
Extends Mautic Lead Bundle's Lead List (Segment) functionality.
This plugin brings Google's reCAPTCHA, hCaptcha, and Cloudflare Turnstile integration to mautic.
Pulls cost data from media advertising services.
Plugin allows sending emails with Mailjet in batches via API and callback handling used for bounce management.
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 32
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-3.0-or-later
- 更新时间: 2025-11-27