Password pin
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user