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

Function profiler_sync_from_user_profile

Scripts/ButSystem.py:15240–15321  ·  view source on GitHub ↗

Ensure a user's My Profile is mirrored into their Profiler list. This creates (or updates) one special encrypted Profiler entry owned by the same user. No username is excluded from the profile -> profiler sync.

(username: str)

Source from the content-addressed store, hash-verified

15238 SELECT g.id, g.name, g.owner, g.created_at, m.role AS my_role
15239 FROM groups g
15240 JOIN group_members m ON m.group_id=g.id
15241 WHERE m.username=?
15242 ORDER BY g.id DESC
15243 """,
15244 (me,),
15245 ).fetchall()
15246 return rows
15247 finally:
15248 conn.close()
15249
15250 try:
15251 rows = _fetch_rows()
15252 except Exception:
15253 # One more attempt after ensuring schema (covers 'no such table' cases)
15254 try:
15255 db_init()
15256 except Exception:
15257 pass
15258 rows = _fetch_rows()
15259
15260 class Obj:
15261 def __init__(self, r):
15262 self.__dict__.update(dict(r))
15263
15264 return render_template("groups.html", title="Groups", gs=[Obj(r) for r in rows])
15265
15266@app.route("/groups/create", methods=["POST"])
15267@login_required
15268def group_create():
15269 """group_create.
15270
15271Chat/group feature helper or route handler.
15272
15273This docstring was expanded to make future maintenance easier.
15274
15275Returns:
15276 Varies.
15277"""
15278 me = current_user()
15279 name = (request.form.get("name") or "").strip()[:64]
15280 members_raw = (request.form.get("members") or "").strip()
15281 if not name:
15282 flash("Group name required.")
15283 return redirect(url_for("groups"))
15284
15285 members = set()
15286 if members_raw:
15287 for part in members_raw.split(","):
15288 part = part.strip()
15289 if part:
15290 members.add(part)
15291 members.add(me)
15292
15293 valid = set(all_usernames())
15294 members = [m for m in members if m in valid]
15295
15296 conn = db_connect()
15297 cur = conn.cursor()

Callers 1

set_profileFunction · 0.70

Calls 9

get_profileFunction · 0.70
_split_name_from_nickFunction · 0.70
addFunction · 0.70
_clean_numFunction · 0.70
db_connectFunction · 0.70
aesgcm_encrypt_textFunction · 0.70
now_zFunction · 0.70

Tested by

no test coverage detected