undertaker / fla-loader
Flarum extension for external loader integration with time-limited roles and file management
Package info
github.com/Undertaker-afk/Fla-loader
Type:flarum-extension
pkg:composer/undertaker/fla-loader
dev-main
2026-01-16 13:11 UTC
Requires
- flarum/core: ^1.2.0
This package is auto-updated.
Last update: 2026-04-16 13:47:47 UTC
README
A Flarum extension for external loader integration with time-limited roles and file management.
Features
- External Login API: Authenticate users via external loaders using username/password and receive session tokens
- HWID Protection: Hardware ID validation to prevent account sharing (automatically registered on first login)
- Time-Limited Role Assignment: Admins can assign roles with expiration times (7 days, 30 days, 180 days, 1 year, or lifetime)
- File Management System:
- Upload files with role-based access control
- Download navbar entry for user-accessible files
- API endpoint for external loader downloads with session token authentication
- Admin interface for managing files and permissions
- HWID Management: Admins can reset user HWIDs to allow login from new devices
Installation
-
Install via composer:
composer require undertaker/fla-loader
-
Enable the extension in your Flarum admin panel
-
Run migrations:
php flarum migrate
API Endpoints
Login
- POST
/api/fla-loader/login- Body:
{"username": "...", "password": "...", "hwid": "..."} - Returns: Session token and user groups/roles
- Note: HWID is required and validated
- Body:
File Download
- GET
/api/fla-loader/download/{id}?token=...- Query params:
token(session token) - Returns: File download
- Query params:
File Management (Admin only)
- GET
/api/fla-loader/files- List all files - POST
/api/fla-loader/files- Upload file - PATCH
/api/fla-loader/files/{id}- Update file permissions - DELETE
/api/fla-loader/files/{id}- Delete file
Role Assignment (Admin only)
- POST
/api/fla-loader/roles- Assign time-limited role- Body:
{"userId": 1, "groupId": 2, "duration": "30d"}
- Body:
- GET
/api/fla-loader/roles/{userId}- Get user's role assignments
HWID Management (Admin only)
- POST
/api/fla-loader/hwid/reset- Reset a user's HWID- Body:
{"userId": 1}
- Body:
- GET
/api/fla-loader/hwid/{userId}- Check user's HWID status
Console Commands
php flarum fla-loader:expire-roles- Manually expire roles (should be run via cron)php flarum fla-loader:cleanup-sessions- Clean up expired session tokens
Development
If you want to modify the extension's JavaScript code:
- Clone the repository
- Install dependencies:
npm install
- Make your changes to files in
js/src/ - Build the assets:
npm run build
Or use development mode with auto-rebuild:npm run dev
License
MIT