Esempio n. 1
0
        public async Task <ActionResult> PostAsync(Registration model)
        {
            if (model.Password != model.ConfirmPassword)
            {
                throw new PasswordConfirmException("Passwords do not match.");
            }

            if (model.Email != model.ConfirmEmail)
            {
                throw new PasswordConfirmException("Passwords do not match.");
            }

            model.Browser   = this.RemoteUser.Browser;
            model.IpAddress = this.RemoteUser.IpAddress;

            Mapper.CreateMap <Registration, DTO.Registration>();
            DTO.Registration registration   = Mapper.Map <DTO.Registration>(model);
            string           registrationId = DAL.Registration.Register(registration).ToString();

            if (string.IsNullOrWhiteSpace(registrationId))
            {
                return(Json(false));
            }

            SignUpEmail email = new SignUpEmail(registration, registrationId);
            await email.SendAsync();

            return(Json(true));
        }
Esempio n. 2
0
        public static async Task <bool> SignUpAsync(HttpContextBase context, string tenant, Registration model, RemoteUser user)
        {
            if (model.Password != model.ConfirmPassword)
            {
                throw new PasswordConfirmException(I18N.PasswordsDoNotMatch);
            }

            if (model.Email != model.ConfirmEmail)
            {
                throw new PasswordConfirmException(I18N.EmailsDoNotMatch);
            }

            model.Browser   = user.Browser;
            model.IpAddress = user.IpAddress;

            var registration = model.Adapt <DTO.Registration>();

            registration.Password = PasswordManager.GetHashedPassword(model.Email, model.Password);

            string registrationId =
                (await Registrations.RegisterAsync(tenant, registration).ConfigureAwait(false)).ToString();

            if (string.IsNullOrWhiteSpace(registrationId))
            {
                return(false);
            }

            var email = new SignUpEmail(context, registration, registrationId);
            await email.SendAsync(tenant).ConfigureAwait(false);

            return(true);
        }
Esempio n. 3
0
        public static async Task <bool> SignUp(Registration model, RemoteUser user)
        {
            if (model.Password != model.ConfirmPassword)
            {
                throw new PasswordConfirmException("Passwords do not match.");
            }

            if (model.Email != model.ConfirmEmail)
            {
                throw new PasswordConfirmException("Emails do not match.");
            }

            model.Browser   = user.Browser;
            model.IpAddress = user.IpAddress;

            var registration = model.Adapt <DTO.Registration>();

            registration.Password = PasswordManager.GetHashedPassword(model.Password);

            string registrationId = Registrations.Register(registration).ToString();

            if (string.IsNullOrWhiteSpace(registrationId))
            {
                return(false);
            }

            var email = new SignUpEmail(registration, registrationId);
            await email.SendAsync();

            return(true);
        }
Esempio n. 4
0
        private void initObjectModels()
        {
            // initializing footer objects
            terms         = new Terms(browser);
            privacy       = new Privacy(browser);
            security      = new Security(browser);
            status        = new Status(browser);
            help          = new Help(browser);
            footerLogo    = new pageObjectModels.footer.Logo(browser);
            contactGitHub = new ContactGitHub(browser);
            api           = new API(browser);
            training      = new Training(browser);
            shop          = new Shop(browser);
            footerBlog    = new pageObjectModels.footer.Blog(browser);
            about         = new About(browser);

            // initializing explore objects
            integrations = new Integrations(browser);
            showcases    = new Showcases(browser);
            trending     = new Trending(browser);

            // initializing header objects
            headerLogo = new pageObjectModels.header.Logo(browser);
            personal   = new Personal(browser);
            openSource = new OpenSource(browser);
            business   = new Business(browser);
            explore    = new Explore(browser);
            pricing    = new Pricing(browser);
            headerBlog = new pageObjectModels.header.Blog(browser);
            support    = new Support(browser);
            searchBar  = new pageObjectModels.header.SearchBar(browser);
            signIn     = new SignIn(browser);
            signUp     = new SignUp(browser);

            // initializing main objects
            signUpUsername  = new SignUpUsername(browser);
            signUpEmail     = new SignUpEmail(browser);
            signUpPassword  = new SignUpPassword(browser);
            signUpSubmit    = new SignUpSubmit(browser);
            signUpForGitHub = new SignUpForGitHubButton(browser);

            // initializing pricing objects
            joinGitHubForFree    = new JoinGitHubForFree(browser);
            upgradeAccount       = new UpgradeAccount(browser);
            createOrganization   = new CreateOrganization(browser);
            startEnterpriseTrial = new StartEnterpriseTrial(browser);

            // initializing blog objects
            featured      = new Featured(browser);
            allPosts      = new AllPosts(browser);
            newFeatures   = new NewFeatures(browser);
            engineering   = new Engineering(browser);
            enterprise    = new Enterprise(browser);
            conferences   = new Conferences(browser);
            meetups       = new Meetups(browser);
            newHires      = new NewHires(browser);
            watercooler   = new Watercooler(browser);
            blogSearchBar = new pageObjectModels.blog.SearchBar(browser);
        }
Esempio n. 5
0
        private async Task SignUp()
        {
            ErrorMessage = "";

            if (!ValidSignUp)
            {
                ErrorMessage = "Some of the fields are invalid.";
                return;
            }

            var newUser = await AuthService.SignUpAsync(SignUpName, SignUpEmail.ToLower(), SignUpPassword);

            if (newUser == null)
            {
                ErrorMessage = "Could not sign up user.";
                return;
            }

            CanClose = true;
        }
        void ReleaseDesignerOutlets()
        {
            if (btnIcon_ != null)
            {
                btnIcon_.Dispose();
                btnIcon_ = null;
            }

            if (SignupBtn_ != null)
            {
                SignupBtn_.Dispose();
                SignupBtn_ = null;
            }

            if (SignUpEmail != null)
            {
                SignUpEmail.Dispose();
                SignUpEmail = null;
            }

            if (SignUpFTextO != null)
            {
                SignUpFTextO.Dispose();
                SignUpFTextO = null;
            }

            if (SignUpFTextOTT != null)
            {
                SignUpFTextOTT.Dispose();
                SignUpFTextOTT = null;
            }

            if (SignUpFTextT != null)
            {
                SignUpFTextT.Dispose();
                SignUpFTextT = null;
            }

            if (SignUpNumber != null)
            {
                SignUpNumber.Dispose();
                SignUpNumber = null;
            }

            if (SignUpPassword != null)
            {
                SignUpPassword.Dispose();
                SignUpPassword = null;
            }

            if (SignUpPasswordA != null)
            {
                SignUpPasswordA.Dispose();
                SignUpPasswordA = null;
            }

            if (SignupTopBar != null)
            {
                SignupTopBar.Dispose();
                SignupTopBar = null;
            }

            if (SignupTopText != null)
            {
                SignupTopText.Dispose();
                SignupTopText = null;
            }

            if (SignupView != null)
            {
                SignupView.Dispose();
                SignupView = null;
            }

            if (topBarText_ != null)
            {
                topBarText_.Dispose();
                topBarText_ = null;
            }
        }