From 001b71ab2fcd5d62bb3a8df295d0c79994b35eb8 Mon Sep 17 00:00:00 2001 From: "CHIEFSOFT\\ameye" Date: Fri, 4 Aug 2023 12:14:03 -0400 Subject: [PATCH] Password pin --- wrenchboard/src/shared_tool/account.cc | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/wrenchboard/src/shared_tool/account.cc b/wrenchboard/src/shared_tool/account.cc index 098a8402..3cb8755b 100644 --- a/wrenchboard/src/shared_tool/account.cc +++ b/wrenchboard/src/shared_tool/account.cc @@ -1099,6 +1099,14 @@ long WrenchResetMemberPass(CVars in, CVars &out) { member_id = out["member_id"].Long(); } + int r1, r2, r3; + char reset_pin[10]; + srand(time(NULL)); + r1 = abs(rand()*100000); + sprintf(reset_pin, "%lu", r1); + + + CVars xx; if (member_id > 0) { @@ -1114,6 +1122,9 @@ long WrenchResetMemberPass(CVars in, CVars &out) { xx["loc"] = loc; xx["loc"].set_valid(true); + xx["reset_pin"] = reset_pin; + xx["reset_pin"].set_valid(true); + out["password_reset_id"] = insert_db_record(DBS_VALID, "password_reset", "password_reset_id_seq", xx); if (out["password_reset_id"].Long() > 0) {