Verify Link return username
This commit is contained in:
@@ -466,14 +466,17 @@ long VerifyWrenchAccountLink(CVars in, CVars &out) {
|
|||||||
out["status_text"] = "Start";
|
out["status_text"] = "Start";
|
||||||
out["status"] = "-1";
|
out["status"] = "-1";
|
||||||
try {
|
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) {
|
if (res != NULL && pgsql_num_rows(res) > 0) {
|
||||||
map<const char*, const char*>f = pgsql_fetch_assoc(res, 0);
|
map<const char*, const char*>f = pgsql_fetch_assoc(res, 0);
|
||||||
CVars rec;
|
CVars rec;
|
||||||
map_to_cvars(f, rec);
|
map_to_cvars(f, rec);
|
||||||
out["pending_uid"] = rec["pending_uid"]; out["pending_uid"].set_valid( true );
|
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["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";
|
out["status"] = "0";
|
||||||
ret = PHP_API_OK;
|
ret = PHP_API_OK;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user