Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- Fixed the minimum consumable quantity at 1
- Fixed `credit.css` returning 404 by moving it to the `public/` directory
- Fix duplicate "low credits" alert generation in the cron job.
- Fix plugin uninstall to correctly remove plugin permissions

## [1.15.3] - 2026-04-29

Expand Down
25 changes: 19 additions & 6 deletions inc/profile.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,8 @@ public function showForm($ID, $options = [])
$profile->getFromDB($ID);
echo "<form method='post' action='" . $profile->getFormURL() . "'>";

$rights = [
['itemtype' => PluginCreditTicketConfig::getType(),
'label' => PluginCreditTicketConfig::getTypeName(Session::getPluralNumber()),
'field' => PluginCreditTicketConfig::$rightname,
],
];
$rights = self::getAllRights();

$matrix_options['title'] = PluginCreditTicketConfig::getTypeName(Session::getPluralNumber());
$profile->displayRightsChoiceMatrix($rights, $matrix_options);

Expand All @@ -78,4 +74,21 @@ public function showForm($ID, $options = [])

return true;
}

private static function getAllRights()
{
return [
['itemtype' => PluginCreditTicketConfig::getType(),
'label' => PluginCreditTicketConfig::getTypeName(Session::getPluralNumber()),
'field' => PluginCreditTicketConfig::$rightname,
],
];
}

public static function uninstall(Migration $migration): void
{
foreach (self::getAllRights() as $right) {
ProfileRight::deleteProfileRights([$right['field']]);
}
}
}