Beispiel #1
0
        public double verifyUser(string email, string password, string audioSample)
        {
            if (!checkCookie(Request, email))
            {
                throw new HttpResponseException(
                          new HttpResponseMessage(HttpStatusCode.Unauthorized)
                {
                    ReasonPhrase = "User not authorized!"
                }
                          );
            }

            return(BiometricsLogic.startVerification(email, password, audioSample));
        }
Beispiel #2
0
        public object addVoiceModel(userRequest req)
        {
            /*if (!checkCookie(Request, req.email))
             * {
             *  throw new HttpResponseException(
             *      new HttpResponseMessage(HttpStatusCode.Unauthorized) { ReasonPhrase = "User not authorized!" }
             *      );
             * }*/

            req.authToken            = "no yandex";
            req.voiceSample.password = "******";

            var usr = dbLogic.getUser(req.email);

            if (usr == null)
            {
                var modelsToRecord = BiometricsLogic.createPerson(
                    req.email,
                    req.voiceSample.password,
                    req.voiceSample.data
                    );

                return(new { count = modelsToRecord, password = "******" });
            }
            else
            {
                var res = BiometricsLogic.addVoiceModel(
                    req.email,
                    req.voiceSample.password,
                    req.voiceSample.data,
                    usr.VoiceModels
                    );

                usr.VoiceModels++;

                dbLogic.updateUser(usr.Id, usr);

                return(new { count = res, password = "******" });
            }
        }