예제 #1
0
        public ConfResetAck OnResetFinish(ConfResetReq msg)
        {
            if (msg.type != 0 && msg.type != 1)
            {
                return(new ConfResetAck(ConfResetAck.Result.FAIL_UNKNOWN_TYPE));
            }
            if (msg.new_pass.Length < 8)
            {
                return(new ConfResetAck(ConfResetAck.Result.FAIL_INCORRECT_PASS));
            }
            DropExpiredCodes();
            ResetRequest request = null;

            foreach (ResetRequest req in requests)
            {
                if (msg.code.Equals(req.code) && msg.type == req.msg.type)
                {
                    request = req;
                    break;
                }
            }
            if (request == null)
            {
                return(new ConfResetAck(ConfResetAck.Result.FAIL_INCORRECT_CODE));
            }
            QueryBase query = null;

            if (msg.type == 0)
            {
                query = new QueryUpdateClientPass(request.msg.email, msg.new_pass, DBUtils.GetDBConnection(), null);
            }
            else
            {
                query = new QueryUpdateSalerPass(request.msg.email, msg.new_pass, DBUtils.GetDBConnection(), null);
            }
            query.Execute();
            requests.Remove(request);
            return(new ConfResetAck(ConfResetAck.Result.SUCCESS));
        }
예제 #2
0
 public ConfResetAck Post([FromBody] ConfResetReq request)
 {
     return(eEngine.GetResetPasswordControl().OnResetFinish(request));
 }