PHPackages                             aditya-wiguna/flarum-lock-profile - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Security](/categories/security)
4. /
5. aditya-wiguna/flarum-lock-profile

ActiveFlarum-extension[Security](/categories/security)

aditya-wiguna/flarum-lock-profile
=================================

Prevents users from editing their profile information including name, username, email, and profile picture

1(6mo ago)023↓100%MITJavaScript

Since Nov 11Pushed 6mo agoCompare

[ Source](https://github.com/aditya-wiguna/flarum-lock-profile)[ Packagist](https://packagist.org/packages/aditya-wiguna/flarum-lock-profile)[ RSS](/packages/aditya-wiguna-flarum-lock-profile/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

Flarum Lock Profile Extension
=============================

[](#flarum-lock-profile-extension)

A Flarum extension that prevents users from editing their profile information, including username, email, bio, and profile picture.

Features
--------

[](#features)

- 🔒 **Blocks Profile Editing**: Prevents regular users from modifying their profile information
- 👤 **Locks Username**: Users cannot change their username
- 📧 **Locks Email**: Users cannot change their email address
- 📝 **Locks Bio**: Users cannot edit their bio/about section
- 🖼️ **Locks Avatar**: Users cannot upload or change their profile picture
- 👑 **Admin Exception**: Administrators can still edit any user profile
- 🎨 **UI Modifications**: Hides/disables edit buttons and form fields for regular users
- 🛡️ **Backend Protection**: Server-side validation prevents API bypasses

Installation
------------

[](#installation)

### Manual Installation

[](#manual-installation)

1. Download this extension
2. Extract it to your Flarum `extensions` directory: `extensions/aditya-wiguna-flarum-lock-profile`
3. Install dependencies:

```
cd extensions/aditya-wiguna-flarum-lock-profile
composer install --no-dev
npm install
npm run build
```

4. Enable the extension in your Flarum admin panel

### Via Composer (if published)

[](#via-composer-if-published)

```
composer require aditya-wiguna/flarum-lock-profile
```

Usage
-----

[](#usage)

Once installed and enabled:

1. Go to your Flarum admin panel
2. Navigate to Extensions
3. Enable "Lock Profile"
4. Regular users will no longer be able to edit their profile information
5. Administrators retain full editing capabilities

How It Works
------------

[](#how-it-works)

This extension works on two levels:

### Frontend (JavaScript)

[](#frontend-javascript)

- Disables input fields in the settings page
- Hides edit buttons and avatar upload controls
- Provides visual feedback that fields are locked

### Backend (PHP)

[](#backend-php)

- Listens to user save events
- Blocks any attempts to modify locked fields via API
- Returns permission denied errors for unauthorized edits
- Allows admin users to bypass restrictions

Customization
-------------

[](#customization)

### Modify Locked Fields

[](#modify-locked-fields)

Edit `src/Listener/PreventProfileEdit.php` and modify the `$lockedFields` array:

```
$lockedFields = ['username', 'email', 'bio', 'avatarUrl'];
```

### Change Vendor Name

[](#change-vendor-name)

Replace all instances of:

- `aditya-wiguna` with your vendor name
- `AdityaWiguna` with your capitalized vendor name
- Update `composer.json` and `package.json` accordingly

### Styling

[](#styling)

Modify `less/forum.less` to customize the appearance of locked elements.

Development
-----------

[](#development)

### Building Assets

[](#building-assets)

```
# Development mode with watch
npm run dev

# Production build
npm run build
```

### File Structure

[](#file-structure)

```
flarum-lock-profile/
├── composer.json          # PHP dependencies and autoloading
├── extend.php            # Extension configuration
├── js/
│   └── src/
│       ├── admin/        # Admin panel JavaScript
│       └── forum/        # Forum frontend JavaScript
├── less/
│   └── forum.less        # Forum styles
├── locale/
│   └── en.yml           # English translations
├── src/
│   └── Listener/
│       └── PreventProfileEdit.php  # Backend event listener
├── LICENSE
├── README.md
├── package.json          # npm dependencies
└── webpack.config.js     # Build configuration

```

Compatibility
-------------

[](#compatibility)

- **Flarum Version**: ^1.2.0 or higher
- **PHP Version**: ^7.3 or ^8.0

Security
--------

[](#security)

This extension provides both frontend UI restrictions and backend API validation to ensure users cannot bypass the restrictions using browser developer tools or direct API calls.

Support
-------

[](#support)

For issues, questions, or contributions, please visit:

- GitHub Issues (add your repository URL)
- Flarum Community Forum

License
-------

[](#license)

MIT License - see LICENSE file for details

Credits
-------

[](#credits)

- Extension created for Flarum community
- Built with Flarum Extension API

Changelog
---------

[](#changelog)

### Version 1.0.0

[](#version-100)

- Initial release
- Lock username, email, bio, and avatar editing
- Admin bypass functionality
- Frontend and backend protection

TODO / Future Enhancements
--------------------------

[](#todo--future-enhancements)

- Add admin panel settings to selectively enable/disable specific fields
- Add permission-based locking (lock for specific groups)
- Add option to lock fields only after certain conditions (e.g., after X days)
- Add logging for edit attempts
- Support for custom profile fields from other extensions

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance69

Regular maintenance activity

Popularity8

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity35

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

182d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/26fa895f56fc756676410baca80e97189e4b9f82c6f58c9f3f28d10188b1c1a1?d=identicon)[adityawiguna12](/maintainers/adityawiguna12)

---

Top Contributors

[![aditya-wiguna](https://avatars.githubusercontent.com/u/21081180?v=4)](https://github.com/aditya-wiguna "aditya-wiguna (3 commits)")

---

Tags

securityprofilelockflarum

### Embed Badge

![Health badge](/badges/aditya-wiguna-flarum-lock-profile/health.svg)

```
[![Health](https://phpackages.com/badges/aditya-wiguna-flarum-lock-profile/health.svg)](https://phpackages.com/packages/aditya-wiguna-flarum-lock-profile)
```

###  Alternatives

[phpseclib/phpseclib

PHP Secure Communications Library - Pure-PHP implementations of RSA, AES, SSH2, SFTP, X.509 etc.

5.6k434.8M1.3k](/packages/phpseclib-phpseclib)[defuse/php-encryption

Secure PHP Encryption Library

3.9k162.4M214](/packages/defuse-php-encryption)[fof/recaptcha

Increase your forum's security with Google reCAPTCHA

1235.4k](/packages/fof-recaptcha)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
