Overview
ForkBB provides a robust user management system with authentication, user profiles, group-based permissions, and granular access control. The system is built around theUser model and supports various user states and roles.
User Model
The core user functionality is implemented inapp/Models/User/User.php:22. Each user has properties and computed attributes that define their permissions and capabilities.
User Status Types
Guest Users
Anonymous visitors with limited permissions. Determined by
FORK_GROUP_GUEST group ID or user ID < 1.Unverified Users
Registered users pending email verification. Restricted from most forum activities.
Admin Users
Full system access with
FORK_GROUP_ADMIN group. Can override all permissions.Moderators
Users with moderation rights for specific forums. Can manage content in assigned areas.
User Groups
Groups define sets of permissions that are inherited by all users in that group. The system uses predefined group constants:app/Models/User/User.php
Default Groups
System Groups:
FORK_GROUP_ADMIN, FORK_GROUP_MOD, FORK_GROUP_GUEST, and FORK_GROUP_MEMBER cannot be deleted and serve as the foundation of the permission system.User Authentication
Users are authenticated and their session is maintained throughout their visit:Current User
The active user is always available via the container:User Status Checks
app/Models/User/User.php
User Profiles
Each user has a customizable profile with various attributes:Profile Links
app/Models/User/User.php
User Avatars
Avatar Storage
Avatars are stored in the configured
o_avatars_dir directory and linked to user profiles.User Titles
app/Models/User/User.php
User Signatures
Users can have signatures that appear below their posts:app/Models/User/User.php
Signatures are parsed with BBCode support (if enabled) and run through the censorship filter.
User Preferences
Display Settings
Users can customize their viewing experience:app/Models/User/User.php
Language and Style
Users can select their preferred language and visual style:- Language selection from available translations
- Style/theme selection from installed themes
- Defaults to system-wide settings for guests
User Statistics
The system tracks various user statistics:Tracked Metrics
Tracked Metrics
- Post Count: Total number of posts created
- Topic Count: Total number of topics started
- Last Visit: Timestamp of last login
- Registration Date: Account creation date
- Online Status: Currently active users
Online Status
app/Models/User/User.php
User Promotion
Administrators and moderators can promote users based on post count:app/Models/User/User.php
Email Integration
Email Privacy Settings
Users control how their email is exposed:app/Models/User/User.php
Username Normalization
Usernames are normalized for consistent lookups:app/Models/User/User.php
Private Messaging Access
Users can be granted access to the private messaging system:app/Models/User/User.php
Related Features
Moderation
Learn about user bans, reports, and moderation tools
Private Messaging
Understand the PM system and user communication
Best Practices
Permission Checks
Permission Checks
Always check user permissions before allowing actions. Use
isAdmin, isAdmMod, and isModerator() methods consistently.Guest Handling
Guest Handling
Always handle guest users gracefully. Check
isGuest before accessing user-specific features.Ban Checks
Ban Checks
Verify
isBanByName before allowing user actions, as bans override most permissions.