karadumann / flarum-advanced-registration-roles
Gelişmiş kayıt sırasında rol seçme sistemi - Advanced role selection during registration
Fund package maintenance!
Karadumann
Installs: 2
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Type:flarum-extension
Requires
- ext-json: *
- flarum/core: ^1.0.0
Requires (Dev)
- flarum/testing: ^1.0.0
This package is not auto-updated.
Last update: 2025-08-29 22:01:51 UTC
README
A comprehensive Flarum extension that provides an advanced role selection system during user registration.
Features
🎯 Advanced Role Selection
- Multiple Role Selection: Allow users to select multiple roles during registration
- Force Role Selection: Make role selection mandatory for registration
- Custom Role Descriptions: Add detailed descriptions for each role
- Role Icons & Colors: Customize visual appearance with FontAwesome icons and colors
- Role Ordering: Control the display order of roles in the registration form
🎨 Modern UI/UX
- Beautiful Role Cards: Modern card-based design for role selection
- Responsive Design: Works perfectly on desktop and mobile devices
- Dark Mode Support: Automatic dark mode compatibility
- Smooth Animations: Engaging user interactions with CSS animations
- Real-time Preview: Live preview of role customizations in admin panel
⚙️ Admin Features
- Comprehensive Settings Panel: Easy-to-use admin interface
- Role Management: Enable/disable roles for registration
- Bulk Operations: Sync roles for existing users via console command
- Permission System: Granular permissions for role management
- Settings Validation: Built-in validation for all configuration options
🔧 Developer Features
- Modern Architecture: Built with latest Flarum standards
- API Endpoints: RESTful API for role management
- Event System: Comprehensive event listeners for customization
- Middleware Support: Request validation and processing
- Console Commands: CLI tools for maintenance and synchronization
📦 Kurulum
Gereksinimler
- Flarum 1.0 veya üzeri
- PHP 7.4 veya üzeri
- MySQL 5.7 veya üzeri
Composer ile Kurulum (Önerilen)
composer require karadumann/flarum-advanced-registration-roles
Manuel Kurulum
- Extension dosyalarını
extensions/karadumann-advanced-registration-roles/
klasörüne kopyalayın - Composer bağımlılıklarını yükleyin:
composer install --no-dev
- Migration'ları çalıştırın:
php flarum migrate
- Extension'ı etkinleştirin:
php flarum cache:clear
Packagist
Bu extension Packagist üzerinden de yüklenebilir.
Development Setup
-
Clone the repository
git clone https://github.com/karadumann/flarum-advanced-registration-roles.git cd flarum-advanced-registration-roles
-
Install dependencies
composer install npm install
-
Build assets
npm run build
-
Development mode
npm run dev
Configuration
Admin Panel Settings
-
Navigate to Admin Panel → Extensions → Advanced Registration Roles
-
Configure general settings:
- Registration title and description
- Multiple role selection options
- Force role selection requirement
- Display options for descriptions and icons
-
Manage available roles:
- Enable/disable roles for registration
- Customize role descriptions, icons, and colors
- Set display order
Console Commands
Sync registration roles for existing users:
php flarum karadumann:sync-roles [options]
Options:
--user=ID
- Sync specific user--dry-run
- Preview changes without applying--force
- Force update existing roles
API Endpoints
Get Available Registration Roles
GET /api/registration-roles
Assign Roles During Registration
POST /api/users Content-Type: application/json { "data": { "attributes": { "username": "newuser", "email": "user@example.com", "password": "password", "registrationRoles": [1, 2, 3] } } }
Permissions
user.assignRegistrationRoles
- Can assign registration rolesgroup.manageRegistrationRoles
- Can manage registration role settingsadmin.viewRegistrationSettings
- Can view registration settings
Database Schema
The extension adds the following columns to the users
table:
registration_roles
(TEXT, nullable) - JSON array of selected role IDsregistration_date
(TIMESTAMP, nullable) - Registration timestamp
Localization
Supported languages:
- English (
en
) - Turkish (
tr
)
To add more languages, create a new file in locale/[language_code].yml
.
Technical Architecture
Backend Structure
src/
├── Api/
│ ├── Controllers/ # API controllers
│ └── Serializers/ # Data serializers
├── Console/ # CLI commands
├── Listeners/ # Event listeners
├── Middleware/ # Request middleware
├── Policies/ # Authorization policies
└── Providers/ # Service providers
Frontend Structure
js/src/
├── admin/ # Admin panel components
│ ├── components/ # React-like components
│ └── index.js # Admin entry point
└── forum/ # Forum components
├── components/ # Registration components
└── index.js # Forum entry point
Contributing
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature
- Make your changes and add tests
- Run code formatting:
npm run format
- Commit your changes:
git commit -m 'Add amazing feature'
- Push to the branch:
git push origin feature/amazing-feature
- Open a Pull Request
License
This project is licensed under the MIT License - see the LICENSE file for details.
Support
If you encounter any issues or have questions:
- Check the Issues page
- Create a new issue with detailed information
- Join the discussion in Flarum Community
Changelog
Version 1.0.0
- Initial release
- Advanced role selection system
- Modern UI/UX design
- Comprehensive admin panel
- Multi-language support
- Console commands
- API endpoints