9
0
mirror of https://github.com/Winds-Studio/Leaf.git synced 2025-12-25 09:59:15 +00:00

Remove OP lock (#486)

Current implementation of OP lock is not an appropriate solution to prevent plugins that contain backdoor or malicious code. There are many ways to bypass this check to manipulate the OP list or permissions. The best way to prevent this kind of grief is to get plugins from valid and trustworthy places.
This commit is contained in:
Dreeam
2025-08-31 23:53:19 -04:00
committed by GitHub
parent b75efe6b13
commit d36ed6c316
37 changed files with 1 additions and 116 deletions

View File

@@ -1,27 +0,0 @@
package org.dreeam.leaf.config.modules.misc;
import org.dreeam.leaf.config.ConfigModules;
import org.dreeam.leaf.config.EnumConfigCategory;
public class OpLock extends ConfigModules {
public String getBasePath() {
return EnumConfigCategory.MISC.getBaseKeyName() + ".op-system-protection";
}
public static boolean preventOpChanges = false;
@Override
public void onLoaded() {
config.addCommentRegionBased(getBasePath(), """
When enabled, prevents plugins from programmatically changing player operator status.
This helps maintain server security by blocking unauthorized op modifications.
Server administrators can still manually manage ops through console/commands.""",
"""
启用后,防止插件以编程方式更改玩家操作员状态。
这有助于通过阻止未经授权的op修改来维护服务器安全性。
服务器管理员仍可通过控制台/命令手动管理ops。""");
preventOpChanges = config.getBoolean(getBasePath() + ".prevent-op-changes", preventOpChanges);
}
}