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

Function bounty

Scripts/ButSystem.py:15784–15826  ·  view source on GitHub ↗

Admin page for adding/editing/removing profiler bounties.

()

Source from the content-addressed store, hash-verified

15782 _validate_chat_voice_upload(voice)
15783 except ValueError as ve:
15784 msg = "Unsupported voice file type."
15785 if str(ve) == "forbidden_type":
15786 msg = "Forbidden file type."
15787 if is_ajax:
15788 return jsonify(ok=False, error=msg), 400
15789 flash(msg)
15790 return redirect(url_for("group_chat", gid=gid))
15791 vsz = _filestorage_size(voice)
15792 if vsz is not None and vsz > CHAT_MAX_BYTES:
15793 if is_ajax:
15794 return jsonify(ok=False, error="Voice message too large (max 33MB)."), 413
15795 flash("Voice message too large (max 33MB).")
15796 return redirect(url_for("group_chat", gid=gid))
15797
15798 if not body and not has_voice:
15799 if is_ajax:
15800 return jsonify(ok=False, error="empty"), 400
15801 flash("Write a message or attach voice.")
15802 return redirect(url_for("group_chat", gid=gid))
15803
15804 conn = db_connect()
15805 saved_paths = []
15806 try:
15807 cur = conn.cursor()
15808 cur.execute(
15809 "INSERT INTO group_messages(group_id, sender, body_enc, created_at) VALUES(?,?,?,?)",
15810 (gid, me, aesgcm_encrypt_text(body or ""), now_z()),
15811 )
15812 gm_id = cur.lastrowid
15813
15814 if has_voice:
15815 _, _, sp = _group_store_voice_tx(conn, gm_id, voice)
15816 saved_paths.append(sp)
15817
15818 conn.commit()
15819
15820 if is_ajax:
15821 r = conn.execute("SELECT id, sender, body_enc, created_at FROM group_messages WHERE id=?", (gm_id,)).fetchone()
15822 v = conn.execute("SELECT id, mime FROM group_voice WHERE gm_id=? ORDER BY id DESC LIMIT 1", (gm_id,)).fetchone()
15823 if not r:
15824 return jsonify(ok=False, error="not_found"), 404
15825 has_voice2 = bool(v)
15826 try:
15827 body_txt = aesgcm_decrypt_text(r["body_enc"])
15828 except Exception:
15829 body_txt = "[decrypt failed]"

Callers

nothing calls this directly

Calls 5

require_adminFunction · 0.70
_fmt_bounty_amount_plainFunction · 0.70
_Function · 0.70
ObjClass · 0.70

Tested by

no test coverage detected