Password pin

This commit is contained in:
CHIEFSOFT\ameye
2023-08-04 12:14:03 -04:00
parent 29bfcb8a13
commit 001b71ab2f
+11
View File
@@ -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) {