This commit is contained in:
CHIEFSOFT\ameye
2023-08-04 12:30:32 -04:00
parent 001b71ab2f
commit a039467425
+6 -6
View File
@@ -1102,8 +1102,8 @@ long WrenchResetMemberPass(CVars in, CVars &out) {
int r1, r2, r3;
char reset_pin[10];
srand(time(NULL));
r1 = abs(rand()*100000);
sprintf(reset_pin, "%lu", r1);
r1 = abs(rand()*10000);
sprintf(reset_pin, "%d", r1);
@@ -1132,19 +1132,19 @@ long WrenchResetMemberPass(CVars in, CVars &out) {
in["password_reset_id"].set_valid(true);
pgsql_exec("UPDATE password_reset SET expired = now() + '1 day',pass_link=md5(now()::text)||''||md5(%d::text) WHERE id = %lu", r1, out["password_reset_id"].Long());
account_email(ACCOUNT_PASSWORD_RESET, in, out);
if ( load_db_record(out, "SELECT uid AS reset_uid, id AS password_reset_id FROM password_reset WHERE id = %lu ",in["password_reset_id"].Long())> 0){
ret = PHP_API_OK;
}
}
}// if member_id
} catch (bad_parameter) {
out["log_status"] = "Invalid Log Action";
}
logfmt(logINFO, "/long WrenchResetMemberPass(CVars in, CVars out)");
return 0;
return ret;
}