From f21022d9e0390d046112d0a76909066207bccdea Mon Sep 17 00:00:00 2001 From: "CHIEFSOFT\\ameye" Date: Fri, 4 Aug 2023 21:39:31 -0400 Subject: [PATCH] reset pin bug --- wrenchboard/src/shared_tool/account.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wrenchboard/src/shared_tool/account.cc b/wrenchboard/src/shared_tool/account.cc index abeecf48..b27d2533 100644 --- a/wrenchboard/src/shared_tool/account.cc +++ b/wrenchboard/src/shared_tool/account.cc @@ -1101,7 +1101,7 @@ long WrenchResetMemberPass(CVars in, CVars &out) { int r1, i; char reset_pin[10]; srand(time(NULL)); - r1 = abs(rand()*1000); + r1 = abs(rand()*100); // sprintf(reset_pin, "%d", r1); snprintf(reset_pin, sizeof (reset_pin), "%d", r1); @@ -1127,7 +1127,7 @@ long WrenchResetMemberPass(CVars in, CVars &out) { xx["loc"].set_valid(true); xx["reset_pin"] = reset_pin; xx["reset_pin"].set_valid(true); - xx["reset_pin"] = xx["reset_pin"].substr(0, 5); + out["password_reset_id"] = insert_db_record(DBS_VALID, "password_reset", "password_reset_id_seq", xx);