Verify Link return username

This commit is contained in:
CHIEFSOFT\ameye
2023-07-07 20:09:52 -04:00
parent cec28b6cae
commit e7e5da5479
+5 -2
View File
@@ -466,14 +466,17 @@ long VerifyWrenchAccountLink(CVars in, CVars &out) {
out["status_text"] = "Start";
out["status"] = "-1";
try {
res = pgsql_query("SELECT uid AS pending_uid,id AS pending_id FROM members_pending WHERE verify_link ='%s' AND expire > now() AND status = 1 LIMIT 1",in["verify_link"].c_str());
res = pgsql_query("SELECT uid AS pending_uid,id AS pending_id,username "
" FROM members_pending WHERE verify_link ='%s' AND expire > now() "
" AND status = 1 LIMIT 1",in["verify_link"].c_str());
if (res != NULL && pgsql_num_rows(res) > 0) {
map<const char*, const char*>f = pgsql_fetch_assoc(res, 0);
CVars rec;
map_to_cvars(f, rec);
out["pending_uid"] = rec["pending_uid"]; out["pending_uid"].set_valid( true );
out["pending_id"] = rec["pending_id"]; out["pending_id"].set_valid( true );
out["status_text"] = "Link Verfied";
out["username"] = rec["username"];
out["status_text"] = "Link Verified";
out["status"] = "0";
ret = PHP_API_OK;
}