Pass reset filter
This commit is contained in:
@@ -394,15 +394,17 @@ long wrenchboard_api_main(CVars in, CVars &out) {
|
||||
REQ_STRING(in, "reset_link", 1, 100, "(.*)");
|
||||
REQ_STRING(in, "newpass", 1, 20, "(.*)");
|
||||
if (load_db_record(out, "SELECT l.id AS lostpass_id,c.firstname,c.lastname,c.email,l.customer_id,c.username FROM lostpass l LEFT JOIN customer c ON c.id = l.customer_id WHERE l.reset_link = '%s' AND l.status IN (1,3)", in["reset_link"].c_str())) {
|
||||
pgsql_exec("UPDATE lostpass SET status = 5 WHERE status IN (1,3) AND customer_id=%lu AND id = %lu ", out["customer_id"].Long(), out["lostpass_id"].Long());
|
||||
if (out["lostpass_id"].Long() > 0){
|
||||
pgsql_exec("UPDATE lostpass SET status = 5 WHERE status IN (1,3) AND customer_id=%lu AND id = %lu ", out["customer_id"].Long(), out["lostpass_id"].Long());
|
||||
pgsql_exec("UPDATE customer SET pass =md5('%s') WHERE id = %lu ", in["newpass"].c_str(), out["customer_id"].Long());
|
||||
CompletePassResetEmail(out);
|
||||
}else{
|
||||
out["status_message"] = "Invalid Request";
|
||||
}
|
||||
|
||||
pgsql_exec("UPDATE customer SET pass =md5('%s') WHERE id = %lu ", in["newpass"].c_str(), out["customer_id"].Long());
|
||||
//complete_losspass.mailfile
|
||||
CompletePassResetEmail(out);
|
||||
} else {
|
||||
out["status_message"] = "Pass Reset Failed";
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case WRENCHBOARD_START_PASSWORDRESET:
|
||||
|
||||
Reference in New Issue
Block a user