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

Function main

Scripts/ButSystem.py:17159–17216  ·  view source on GitHub ↗

main. Route handler or application helper. This docstring was expanded to make future maintenance easier. Returns: Varies.

()

Source from the content-addressed store, hash-verified

17157"""
17158 self.__dict__.update(d)
17159 return render_template(
17160 "profiler_view_only.html",
17161 title="Profiler view",
17162 e=Obj(entry),
17163 attachments=[Obj(a) for a in atts],
17164 )
17165
17166@app.route("/profiler/<int:eid>/update", methods=["POST"])
17167@login_required
17168def profiler_update(eid: int):
17169 """profiler_update.
17170
17171Route handler or application helper.
17172
17173This docstring was expanded to make future maintenance easier.
17174
17175Args:
17176 eid: Parameter.
17177
17178Returns:
17179 Varies.
17180"""
17181 owner = current_user()
17182 first = (request.form.get("first") or "").strip()
17183 last = (request.form.get("last") or "").strip()
17184 info = (request.form.get("info") or "").strip()
17185 opt = profiler_collect_optional(request.form)
17186 att = request.files.get("att")
17187
17188 conn = db_connect()
17189 row = conn.execute("SELECT 1 FROM profiler_entries WHERE id=? AND owner=?", (eid, owner)).fetchone()
17190 if not row:
17191 conn.close()
17192 abort(404)
17193
17194 conn.execute("""
17195 UPDATE profiler_entries SET first_enc=?, last_enc=?, info_enc=?, optional_enc=?, updated_at=?
17196 WHERE id=? AND owner=?
17197 """, (aesgcm_encrypt_text(first), aesgcm_encrypt_text(last), aesgcm_encrypt_text(info), profiler_encrypt_optional(opt), now_z(), eid, owner))
17198 conn.commit()
17199 conn.close()
17200
17201 if att and att.filename:
17202 try:
17203 profiler_store_attachment(eid, att)
17204 except Exception as e:
17205 log.exception("Profiler attachment failed: %s", e)
17206
17207 flash("Updated.")
17208 return redirect(url_for("profiler"))
17209
17210@app.route("/profiler/<int:eid>/delete", methods=["POST"])
17211@login_required
17212def profiler_delete(eid: int):
17213 """Delete a Profiler entry (requires typing first+last name).
17214
17215 Requested safety: user must type the profile&#x27;s first and last name before deletion.
17216 """

Callers 1

ButSystem.pyFile · 0.70

Calls 11

printFunction · 0.85
any_admin_existsFunction · 0.70
prompt_creator_accountFunction · 0.70
find_free_portFunction · 0.70
local_ipFunction · 0.70
start_serverFunction · 0.70
clear_screenFunction · 0.70
approval_promptFunction · 0.70
startMethod · 0.45
shutdownMethod · 0.45

Tested by

no test coverage detected