A Flarum extension for external loader integration with time-limited roles and file management.
- 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
-
Install via composer:
composer require undertaker/fla-loader
-
Enable the extension in your Flarum admin panel
-
Run migrations:
php flarum migrate
- POST
/api/fla-loader/login- Body:
{"username": "...", "password": "...", "hwid": "..."} - Returns: Session token and user groups/roles
- Note: HWID is required and validated
- Body:
- GET
/api/fla-loader/download/{id}?token=...- Query params:
token(session token) - Returns: File download
- Query params:
- 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
- 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
- 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
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
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:
Or use development mode with auto-rebuild:
npm run build
npm run dev
MIT