ModeratorGui
ModeratorGui
A simple plug-in to allow your server operators/moderators to report whatever they do. Supports reporting issues with players, bans, unbans, promotions and demotions.
Every type is color-coded. Issues are yellow, bans dark red, unbans dark green, promotions green and demotions red.
This plug-in runs a very basic HTTP server, only files in the plugins/ModeratorGui/web folder are accessible. To access the web GUI, you connect to port 8273, you have to enter the password specified in config.yml.
A list of ranks can be specified to limit what can be entered when reporting promotions or demotions.
The plugin will try to match usernames to players that have once joined the server with the in-game commands. Ranks will also be matched.
The Web GUI can be modified to your desire, but is limited to how the web server works.
If you find any bugs or issues, or if you have suggestions, please comment explaining the issue or suggestion.
A preview of the WebGui:
Permissions
permissions: moderatorgui: default: op description: Command for full rights children: moderatorgui.command: true moderatorgui.command.admin: true moderatorgui.issue: true moderatorgui.ban: true moderatorgui.unban: true moderatorgui.promote: true moderatorgui.demote: true moderatorgui.review: true moderatorgui.viewreported: true moderatorgui.viewopenissues: true moderatorgui.export: true moderatorgui.import: true moderatorgui.uninstall: true moderatorgui.setpass: true moderatorgui.command: description: Allows using the plugin commands moderatorgui.command.admin: description: Allows using the admin commands moderatorgui.issue: description: Allows reporting issues with players moderatorgui.ban: description: Allows reporting banning a player moderatorgui.unban: description: Allows reporting unbanning a player moderatorgui.promote: description: Allows reporting promotions moderatorgui.demote: description: Allows reporting demotions moderatorgui.review: description: Allows reviewing reports moderatorgui.viewreported: description: "Allows seeing an issue when it's reported" moderatorgui.viewopenissues: description: Allows seeing wether a person has open issues moderatorgui.export: description: Allows exporting all reports to a binary file moderatorgui.import: description: Allows importing all reports from a binary file moderatorgui.uninstall: description: Allows deleting the database moderatorgui.setpass: description: Allows setting a password to be used on the webgui
Commands
/report help
- Displays /report sub-commands
/report issue <playername> <issue>
- Reports an issue
/report ban <playername> <reason>
- Reports banning a player
/report unban <playername> <reason>
- Reports unbanning a player
/report promote <playername> <oldrank> <newrank> <reason>
- Reports promoting a player
/report promote <playername> <oldrank> <newrank> <reason>
- Reports demoting a player
/review help
- Displays /review sub-commands
/review [page]
- Displays a page of reports
/review by <playername> [page]
- Displays a page of reports reported by a playername
/review target <playername> [page]
- Displays a page of reports that were reported about a player
/review close I:<id> [I:<id> [...]]
- Closes a report of a certain type, currently only supported type is I
for issue, can support multiple reports at once.
/moderatorgui
- Displays /moderatorgui sub-commands (Aliases: /modgui, /mg)
/moderatorgui help
- Displays /moderatorgui sub-commands
/moderatorgui setpass <password>
- Sets a password linked to your name for the WebGui, the password is hashed. HOWEVER, the password will be visible in the console when you run the command.
/moderatorgui export
- Exports the database into a binary file called data.bin in the plugin folder
/moderatorgui import
- Imports a data.bin binary file that was created with ModeratorGui into the database, clearing the database beforehand. WARNING: this cannot be undone
/moderatorgui uninstall
- Deletes the database and disables the plugin. Will not delete the plugin jar. WARNING: this cannot be undone
Config variables
The configuration has 2 sections where variables are used, the messages section and the perform section. Here is a list of the variables:
%id%
- The id of the report
%target%
- The name of the reported player
%reporter%
- The name of the reporting player
%reason%
- The reason of the report/action
%date%
- The date of the report, using the standard ModGui date format
%oldrank%
- Only used for promotions and demotions, the old rank of the player
%newrank%
- Only used for promotions and demotions, the new rank of the player
Web requests for custom web-pages
All requests start with /GENERATED/
(case-sensitive)
/GENERATED/LOGIN/username/password
- Returns a session that will be used for other requests followed by a list of available ranks sepperated by "/", or
"invalid"
if the supplied password was incorrect. The password has to be an SHA-256 encrypted string. /GENERATED/LIST/session/request_flags
- Returns a global list of reports, limited to a maximum of 500 results
/GENERATED/REPORTER/session/request_flags/username/
- Returns a list of reports where the reporter is username, limited to a maximum of 500 results
/GENERATED/REPORTED/session/request_flags/username/
- Returns a list of reports where the person being reported is username, limited to a maximum of 500 results
/GENERATED/REPORT/session/request_flags/reported/reason/previousRank/newRank//
- Creates a new report, created by the user bound to the session.
previousRank
andnewRank
can be empty if it is not required.
Every mention of request_flags
has to be replaced with a type filter. i
for issues, b
for bans, u
for unbans, p
for promotions and d
for demotions. If you want to get all types you can leave it blank or send ibupd
, this means that if any of the above flags are found it will find from all the supplied types. Do note that there are times that only one flag can be set.
Returned lists are in JSON format, a typical list would look like this (only displaying one of each type of report), newest reports are displayed first, the current reports are in no particular order.
[ { type: "issue", close: false, reporter: "adminname", reported: "somebaduser", time: "05-21-2012", reason: "He was being stupid" }, { type: "ban", reporter: "adminname", reported: "somebaduser", time: "05-21-2012", reason: "He wanted to get banned" }, { type: "unban", reporter: "adminname", reported: "somebaduser", time: "05-21-2012", reason: "He wanted to get unbanned" }, { type: "promote", reporter: "adminname", reported: "somebaduser", time: "05-21-2012", reason: "He wanted to get promoted", prev: "default", new: "admin" }, { type: "demote", reporter: "adminname", reported: "somebaduser", time: "05-21-2012", reason: "He was falsely promoted", prev: "admin", new: "default" } ]
When a request is made with an invalid session, a 403 - Forbidden error will be supplied. When the server encounters an error, a stack trace is printed to the console and a 500 - Internal Server Error will be supplied.
Planned features
- None currently
Can you give me a full php script, pls?
Updated to a new version:
Web GUI new uses a table to sort
Web GUI colors are more neutral
Passwords sent from the web GUI are now SHA-256 encrypted
You can now filter results to be displayed in the web GUI
This means that the web files all have to be updated.
Furthermore, the protocol has changed as a result of these changes.
A new version has been uploaded.
Enabled custom port and server ip setting
Updated the plugin!
Removed standalone launcher that shouldn't really be in it as it is for testing onlyFixed bug where doing /report promote/demote would display the old rank if the new rank was incorrect
@watdidyusaey
Thanks! How would you like it to be tied in? This plugin was made to report moderation on the server, I could add an API for plugins to report things, if people would like that though.
@zedadiaswick
Are you sure you typed it correctly? It could be that you mistyped 'admin' and it displayed 'default' to be wrong, I've just found this bug and fixed it so that might have been the problem.
I'm confused as to how to use /report promote, it says it says 'no match found for 'default', when default is specified in the config.yml. Am I doing something wrong?
I enter: /report promote zedwick default admin some such reason
Otherwise, looking great! Thanks!
This is really great and useful for larger scale servers. However, it would be great to tie this plugin into popular user management system like ultrabans.
@gv1222
Oh yes, sorry. First time I posted a plugin on here. At the time of writing the description I couldn't think of what was missing. I have now updated the description, this is what was added:
To access the web GUI, you connect to port 8273, you have to enter the password specified in config.yml.
A list of ranks can be specified to limit what can be entered when reporting promotions or demotions.
The plugin will try to match usernames to players that have once joined the server with the in-game commands. Ranks will also be matched.
The Web GUI can be modified to your desire, but is limited to how the web server works.
A table of how to use special requests for the webserver has also been added.
As for the website part, it could be possible to do, but I'm not going to do so myself, if anybody would want to try doing so he/she is welcome to.
Could you add some more documentation on how this plugin works Ect.? Also instead of running it off of your server could you create a version that uses a website instead?