MCPcopy Create free account
hub / github.com/dedsec1121fk/DedSec / profiler_store_attachment

Function profiler_store_attachment

Scripts/ButSystem.py:15441–15479  ·  view source on GitHub ↗

Store a profiler attachment (plaintext on disk). Profiler *text fields* remain encrypted in the database; only binary attachments are stored without encryption (per your request).

(eid: int, file_storage)

Source from the content-addressed store, hash-verified

15439
15440Returns:
15441 Varies.
15442"""
15443 me = current_user()
15444 if group_role(gid, me) != "owner":
15445 abort(403)
15446 username = (request.form.get("username") or "").strip()
15447 if not username:
15448 return redirect(url_for("group_chat", gid=gid))
15449 if group_role(gid, username) != "member":
15450 return redirect(url_for("group_chat", gid=gid))
15451 conn = db_connect()
15452 conn.execute("UPDATE group_members SET role='admin' WHERE group_id=? AND username=?", (gid, username))
15453 conn.commit()
15454 conn.close()
15455 flash("Promoted to admin.")
15456 return redirect(url_for("group_chat", gid=gid))
15457
15458@app.route("/groups/<int:gid>/admins/demote", methods=["POST"])
15459@login_required
15460def group_demote_admin(gid: int):
15461 """group_demote_admin.
15462
15463Admin-only route handler.
15464
15465This docstring was expanded to make future maintenance easier.
15466
15467Args:
15468 gid: Parameter.
15469
15470Returns:
15471 Varies.
15472"""
15473 me = current_user()
15474 if group_role(gid, me) != "owner":
15475 abort(403)
15476 username = (request.form.get("username") or "").strip()
15477 if not username:
15478 return redirect(url_for("group_chat", gid=gid))
15479 if group_role(gid, username) != "admin":
15480 return redirect(url_for("group_chat", gid=gid))
15481 conn = db_connect()
15482 conn.execute("UPDATE group_members SET role='member' WHERE group_id=? AND username=?", (gid, username))

Callers 2

profiler_createFunction · 0.70
profiler_updateFunction · 0.70

Calls 5

_validate_report_uploadFunction · 0.70
db_connectFunction · 0.70
aesgcm_encrypt_textFunction · 0.70
now_zFunction · 0.70
_save_plain_uploadFunction · 0.70

Tested by

no test coverage detected