fix verify link mobile
This commit is contained in:
@@ -582,6 +582,28 @@ long CreateMobileWrenchBoardAccount(CVars in, CVars &out) {
|
||||
long CompleteMobileAccountCreation(CVars in, CVars &out){
|
||||
long ret = PHP_API_BAD_PARAM;
|
||||
CVars x;
|
||||
|
||||
OPTIONAL(in, "mobile") REQ_STRING(in, "mobile", 3, 15, "(.*)");
|
||||
REQ_STRING (in, "password", 3, 15, "(.*)");
|
||||
|
||||
if ( in["mobile"]=="MOBILE" ){
|
||||
REQ_STRING(in, "random_text", 3, 10, "(.*)");
|
||||
REQ_STRING(in, "pending_uid", 2, 120, "(.*)");
|
||||
CVars ox;
|
||||
if ( load_db_record(ox, "SELECT id,verify_link FROM members_pending WHERE "
|
||||
" LOWER(username)=LOWER('%s') "
|
||||
" AND signup_random = '%s' AND uid ='%s' "
|
||||
" AND password =md5('%s') ",in["username"].c_str(),in["random_text"].c_str(),in["pending_uid"].c_str(), in["password"].c_str()) > 0 ){
|
||||
in["verify_link"] = ox["verify_link"]; in["verify_link"].set_valid( true );
|
||||
}
|
||||
else{
|
||||
out["status_message"] = "invalid_pin_or_password";
|
||||
out["status"] = "error";
|
||||
return ret;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
x["password"] = in["password"]; x["password"].set_valid( true );
|
||||
x["sessionid"] = "IINITIAL_SESSION_DUMMY"; x["sessionid"].set_valid( true );
|
||||
x["username"] = in["username"]; x["username"].set_valid( true );
|
||||
|
||||
Reference in New Issue
Block a user