PHPackages                             strykeslammerii/selftermination-sprinkle - 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. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. strykeslammerii/selftermination-sprinkle

ActiveUserfrosting-sprinkle[Authentication &amp; Authorization](/categories/authentication)

strykeslammerii/selftermination-sprinkle
========================================

A UserFrosting sprinkle providing 1) redaction of basic user personal data during account deletion 2) a button to delete user's own account

v0.3.0-p4(2y ago)122[1 issues](https://github.com/StrykeSlammerII/UF-sprinkle-selftermination/issues)unlicensePHPPHP ^8.1

Since Feb 9Pushed 2y ago1 watchersCompare

[ Source](https://github.com/StrykeSlammerII/UF-sprinkle-selftermination)[ Packagist](https://packagist.org/packages/strykeslammerii/selftermination-sprinkle)[ Docs](https://github.com/StrykeSlammerII/UF-sprinkle-selftermination)[ RSS](/packages/strykeslammerii-selftermination-sprinkle/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (8)Dependencies (15)Versions (7)Used By (0)

UF-sprinkle-selftermination
===========================

[](#uf-sprinkle-selftermination)

This UserFrosting sprinkle does two things:

1. Redacts basic user [personal data](https://en.wikipedia.org/wiki/Personal_data) when deleting an account
2. Provides a button for each user to delete their own account.

Install directions
==================

[](#install-directions)

Include `SelfTermination::class` in your Sprinkle Recipe:
---------------------------------------------------------

[](#include-selfterminationclass-in-your-sprinkle-recipe)

```
  use SelfTermination\Sprinkle\SelfTermination;
  ...
  public function getSprinkles(): array
  {
      return [
//        Core::class,
//        Account::class,
//        Admin::class,
//        AdminLTE::class,
		        SelfTermination::class,
        ];
    }
```

Include `strykeslammerii/selftermination-sprinkle` in `composer.json`
---------------------------------------------------------------------

[](#include-strykeslammeriiselftermination-sprinkle-in-composerjson)

```
    "require": {
        ...
	  "strykeslammerii/selftermination-sprinkle": "^0.3"
    },
```

Include `strykeslammerii/selftermination-sprinkle` in `package.json`
--------------------------------------------------------------------

[](#include-strykeslammeriiselftermination-sprinkle-in-packagejson)

```
    "dependencies": {
        "@userfrosting/sprinkle-admin": "~5.1.0",
        "@userfrosting/theme-adminlte": "~5.1.0",
	 "selftermination-sprinkle": "StrykeSlammerII/UF-sprinkle-selftermination"
    },
```

Include `'selftermination-sprinkle/webpack.entries'` in `webpack.config.js`
---------------------------------------------------------------------------

[](#include-selftermination-sprinklewebpackentries-in-webpackconfigjs)

```
const sprinkles = {
    AdminLTE: require('@userfrosting/theme-adminlte/webpack.entries'),
    Admin: require('@userfrosting/sprinkle-admin/webpack.entries'),
    SelfTermination: require('selftermination-sprinkle/webpack.entries'),
    App: require('./webpack.entries')
}
```

Install `SelfTermination\Sprinkle\Database\Seeds\SelfTerminationPermission` seed
--------------------------------------------------------------------------------

[](#install-selfterminationsprinkledatabaseseedsselfterminationpermission-seed)

### First, in Bakery

[](#first-in-bakery)

```
$ php bakery seed
Seeder
======
 Select seed(s) to run. Multiple seeds can be selected using comma separated values:
  [0] UserFrosting\Sprinkle\Account\Database\Seeds\DefaultGroups
  [1] UserFrosting\Sprinkle\Account\Database\Seeds\DefaultPermissions
  [2] UserFrosting\Sprinkle\Account\Database\Seeds\DefaultRoles
  [3] SelfTermination\Sprinkle\Database\Seeds\SelfTerminationPermission
 > 3
```

### Then, add to appropriate roles through UF's user management UI

[](#then-add-to-appropriate-roles-through-ufs-user-management-ui)

In more detail
==============

[](#in-more-detail)

Redacts Personal Data
---------------------

[](#redacts-personal-data)

Base UF only soft-deletes users. This allows for users to be un-deleted, and leaves their personal data in the user database.

- This sprinkle overrides the `delete('/u/{user_name}')` route to [redact](https://en.wikipedia.org/wiki/Sanitization_(classified_information)) a user's email (to `"redacted".$user->id."@test.com"`), username (to `"redacted".$user->id`), and first and last name (both to `"redacted"`) in the user database.

    - The redacted email and username retain the user id number, in case of questions about the deletion. Discussion about this lack of redaction would be appreciated.
- The hashed user password is also changed to a two-character entry using `bin2hex(random_bytes(1)`, which should be too short to match any password the application checks for login.
- The activity log is noted with the redacted username; either "redacted15 self-deleted" or "User Admin\_Alice deleted the account for redacted15."

    - Existing activity logs are NOT redacted. They are currently stored completely as strings with the user data *embedded*, rather than *referencing* the users they refer to.
    - A search-and-replace or complete refactoring of the activity log system were both beyond the scope of this sprinkle. Pull requests which address this point are welcome.
    - **Users of this sprinkle should be aware of how user personal data is stored elsewhere in their systems.** This sprinkle can be extended to fit other use cases, but does not on its own search out and redact personal data that may be generated or stored by other sprinkles.
        - Specifically, we mention above two ways that personal data can be stored: "references" and "embedded". A sprinkle generating its own embedded personal data will need to do extra work to redact that.
        - If user content is allowed, it is very common for users to mention each other by name. `@`mentions may already be pulled out and used as a reference to a user, but nicknames or shortened forms would be treated as any other text. Using myself as an example: `@StrykeSlammerII` is obviously me. Even a search-and-redact would find those easily. `Strike`, however, would not be a valid `@`mention and is a "normal" word that should **not** be redacted throughout all user comments!
- A soft delete is then performed as usual. However, un-deletion cannot revert the redactions, and a new password would need to be set before the "restored" account could be used again.
- It is theoretically possible than a deleted account could still be stolen by a third party: they would need access to either an admin user or the User database. If this sprinkle is used in an environment where users can interact, it is important to be *certain* to redact connections and interactions between users... and to consider using hard deletes instead of soft ones.

Self-deletion
-------------

[](#self-deletion)

This button requires the `Self-termination` permission (included) to be added to the user's role (which this sprinkle does NOT attempt to do!) The button is located at the bottom of the "My account" page. It looks less like a button and more like a link--but it just brings up an "Are you sure?" modal with proper yes/no buttons, similar to the way the Admin "delete user" modal works.

Moving forward
==============

[](#moving-forward)

This being my second sprinkle ever, I'm sure there are plenty of bad practices and inefficiencies. It doesn't even have any unit or integration tests! Manual testing made me think basic functionality works. I'm using it in my main project, so if I find issues I will patch them, but I don't have plans to work on this sprinkle just to work on it.

Pull requests are appreciated, though other projects may prefer to fork and extend this if additional redactions need to be made.

Localization
------------

[](#localization)

This is mostly a personal project and I'm monolingual... so any messaging I've added will not be localized. Again, pull requests are appreciated!

###  Health Score

17

—

LowBetter than 6% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

 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

Every ~17 days

Total

6

Last Release

738d ago

PHP version history (2 changes)v0.2.0-p1PHP ^8.0

v0.3.0-p2PHP ^8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/1dba34c37ec520c892d1773f9a5f15f3eec9dd0ceaeda608df26c33c108b1962?d=identicon)[StrykeSlammerII](/maintainers/StrykeSlammerII)

---

Top Contributors

[![StrykeSlammerII](https://avatars.githubusercontent.com/u/16699223?v=4)](https://github.com/StrykeSlammerII "StrykeSlammerII (65 commits)")

---

Tags

userfrosting-sprinkleUser managementredactionAccount management

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/strykeslammerii-selftermination-sprinkle/health.svg)

```
[![Health](https://phpackages.com/badges/strykeslammerii-selftermination-sprinkle/health.svg)](https://phpackages.com/packages/strykeslammerii-selftermination-sprinkle)
```

###  Alternatives

[friendsofsymfony/user-bundle

Symfony FOSUserBundle

3.2k35.4M311](/packages/friendsofsymfony-user-bundle)[userfrosting/userfrosting

A secure, modern user management system for PHP.

1.7k11.4k](/packages/userfrosting-userfrosting)[2amigos/yii2-usuario

Highly customizable and extensible user management, authentication, and authorization Yii2 extension

298275.5k14](/packages/2amigos-yii2-usuario)[nucleos/user-bundle

Lightweight user management for symfony

61380.7k5](/packages/nucleos-user-bundle)[tomatophp/filament-users

Manage your users with a highly customizable user resource for FilamentPHP with integration of filament-shield and filament-impersonate

90102.0k7](/packages/tomatophp-filament-users)[nucleos/profile-bundle

Registration and profile management for symfony

12218.5k1](/packages/nucleos-profile-bundle)

PHPackages © 2026

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