Esempio n. 1
0
        public ProcessOnPasswordChangeResponse ProcessOnPasswordChange(ProcessOnPasswordChangeRequest request)
        {
            EnsureValidRequest(request);

            var response = new ProcessOnPasswordChangeResponse();

            using (var db = new CSSDataContext())
            {
                var login = Login.FindLoginByUsernameOrCallsign(db, request.auth);
                if (login == null)
                {
                    login = db.Logins.FirstOrDefault(p => p.Email == request.auth);
                }

                if (login == null)
                {
                    response.completed = 1;
                    response.response  = "FAILED";
                }
                else
                {
                    login.Password     = request.hashed_password;
                    response.completed = 1;
                    response.response  = "SUCCESS";
                }
            }

            return(response);
        }
        public ProcessOnPasswordChangeResponse ProcessOnPasswordChange(ProcessOnPasswordChangeRequest request)
        {
            EnsureValidRequest(request);

            var response = new ProcessOnPasswordChangeResponse();

            using (var db = new CSSDataContext())
            {
                var login = Login.FindLoginByUsernameOrCallsign(db, request.auth);
                if (login == null)
                    login = db.Logins.FirstOrDefault(p => p.Email == request.auth);

                if (login == null)
                {
                    response.completed = 1;
                    response.response = "FAILED";
                }
                else
                {
                    login.Password = request.hashed_password;
                    response.completed = 1;
                    response.response = "SUCCESS";
                }
            }

            return response;
        }