Пример #1
0
        /**
         * @author Anthony Scheeres
         */
        private string validateRegisterUser(string username, string password, string email)
        {
            string failResponse = ResponseR.fail.ToString(); string response = failResponse;
            bool   isValideInput = isValideUsernamePasswordEmail(username, password, email);

            //validate the input if so register user in the database
            if (isValideInput)
            {
                registerUser(username, password, email);

                TokenDao tokenDao = DaoProvider.getToken();

                string token = tokenDao.getTokenByUsernameExtremelyClassified(username);


                new Thread(() =>
                {
                    Thread.CurrentThread.IsBackground = true;

                    MailService mailService = new MailService(email);
                    mailService.validateAUsersEmailUsingAValidationEmaill(username, token);
                }).Start();

                response = ResponseR.success.ToString();
            }



            return(response);
        }