new file: consent-plugin/pom.xml
new file: consent-plugin/src/main/java/de/simolzimol/mclogger/consent/ConsentConfig.java new file: consent-plugin/src/main/java/de/simolzimol/mclogger/consent/ConsentPlugin.java new file: consent-plugin/src/main/java/de/simolzimol/mclogger/consent/commands/ConsentCommand.java new file: consent-plugin/src/main/java/de/simolzimol/mclogger/consent/database/ConsentDatabase.java new file: consent-plugin/src/main/java/de/simolzimol/mclogger/consent/listeners/ConsentListener.java new file: consent-plugin/src/main/java/de/simolzimol/mclogger/consent/util/MessageUtil.java new file: consent-plugin/src/main/resources/config.yml new file: consent-plugin/src/main/resources/plugin.yml modified: web/app.py modified: web/blueprints/group_admin.py modified: web/panel_db.py modified: web/templates/group_admin/base.html new file: web/templates/group_admin/privacy_policy.html new file: web/templates/group_policy.html
This commit is contained in:
@@ -542,3 +542,37 @@ def player_delete(uuid):
|
||||
|
||||
return render_template("group_admin/player_delete_confirm.html",
|
||||
player=player, group=group)
|
||||
|
||||
|
||||
# ─── Group Privacy Policy ─────────────────────────────────────────────────────
|
||||
|
||||
@group_admin.route("/privacy-policy", methods=["GET", "POST"])
|
||||
@group_admin_required
|
||||
def privacy_policy():
|
||||
"""Group admins can write and publish their own server privacy policy."""
|
||||
from roles import OWNER_ONLY_ROLES as _OWNER_ONLY
|
||||
if session.get("role") not in _OWNER_ONLY:
|
||||
flash("Only the Group Owner can edit the privacy policy.", "danger")
|
||||
return redirect(url_for("group_admin.dashboard"))
|
||||
|
||||
group_id = session["group_id"]
|
||||
policy = db.get_group_policy(group_id)
|
||||
|
||||
if request.method == "POST":
|
||||
policy_text = request.form.get("policy_text", "").strip() or None
|
||||
policy_url = request.form.get("policy_url", "").strip() or None
|
||||
db.set_group_policy(group_id, policy_text, policy_url)
|
||||
db.log_audit_event(
|
||||
session["user_id"], session["username"], "group.policy_updated",
|
||||
entity_type="group", entity_id=str(group_id),
|
||||
details={"policy_url": policy_url},
|
||||
group_id=group_id, ip_address=request.remote_addr,
|
||||
)
|
||||
flash("Privacy policy saved.", "success")
|
||||
return redirect(url_for("group_admin.privacy_policy"))
|
||||
|
||||
group = db.get_group_by_id(group_id)
|
||||
public_url = url_for("public_group_policy", group_id=group_id, _external=True)
|
||||
return render_template("group_admin/privacy_policy.html",
|
||||
policy=policy, group=group, public_url=public_url)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user