public void Init(IVerifyEmail view)
        {
            IWebContext webContext = ObjectFactory.GetInstance<IWebContext>();

            string username = webContext.UsernameToVerify;
            if (string.IsNullOrEmpty(username))
            {
                IRedirector rediretor = ObjectFactory.GetInstance<IRedirector>();
                rediretor.GoToHomePage();
                return;
            }

            username = Cryptography.Decrypt(username.Replace(" ", "+"), "verify");
            Account account = Account.GetAccountByUsername(username);
            if (account != null)
            {
                if (account.EmailVerified == false)
                {
                    account.EmailVerified = true;
                    account.Save();
                    view.ShowMessage("Email của bạn đã được xác nhận thành công!");
                    return;
                }
            }

            view.ShowMessage("Xin vui lòng thử lại");
        }
Esempio n. 2
0
        public void Init(IVerifyEmail view)
        {
            _webContext = ObjectFactory.GetInstance<IWebContext>();
            _accountRepository = ObjectFactory.GetInstance<IAccountRepository>();

            var username = Cryptography.Decrypt(_webContext.UsernameToVerify, "verify");

            var account = _accountRepository.GetAccountByUsername(username);

            if (account != null) {
                account.EmailVerified = true;
                _accountRepository.SaveAccount(account);
                view.ShowMessage("Your email address has been successfully verified!");
            } else {
                view.ShowMessage("There appears to be something wrong with your verification link!  Please try again. " +
                    "If you are having issues by clicking on the link, please try copying the URL from your email and pasting it into your browser window.");
            }
        }
Esempio n. 3
0
        public void Init(IVerifyEmail _view)
        {
            /* _webContext = ObjectFactory.GetInstance<IWebContext>();
             * _accountRepository = ObjectFactory.GetInstance<IAccountRepository>();*/
            _webContext        = new WebContext();
            _accountRepository = new SPKTCore.Core.DataAccess.Impl.AccountRepository();
            string username = Cryptography.Decrypt(_webContext.UsernameToVerify, ParameterSetting.EmailVerificationEncryptKey);

            Account account = _accountRepository.GetAccountByUsername(username);

            if (account != null)
            {
                account.EmailVerified = true;
                _accountRepository.SaveAccount(account);
                _view.ShowMessage("Bạn đã chứng thực Email thành công! Chào mừng bạn đến Mạng Xã Hội sinh Viên Sư Phạm Kỹ Thuật TP.HCM", true);
            }
            else
            {
                _view.ShowMessage("Chứng thực không đúng! Có thể có vấn đề trong đường link của bạn. Vui lòng thử lại", false);
            }
        }
Esempio n. 4
0
        public void Init(IVerifyEmail _view)
        {
            /* _webContext = ObjectFactory.GetInstance<IWebContext>();
            _accountRepository = ObjectFactory.GetInstance<IAccountRepository>();*/
            _webContext = new WebContext();
            _accountRepository = new SPKTCore.Core.DataAccess.Impl.AccountRepository();
            string username = Cryptography.Decrypt(_webContext.UsernameToVerify,ParameterSetting.EmailVerificationEncryptKey);

            Account account = _accountRepository.GetAccountByUsername(username);

            if (account != null)
            {
                account.EmailVerified = true;
                _accountRepository.SaveAccount(account);
                _view.ShowMessage("Bạn đã chứng thực Email thành công! Chào mừng bạn đến Mạng Xã Hội sinh Viên Sư Phạm Kỹ Thuật TP.HCM", true);

            }
            else
            {
                _view.ShowMessage("Chứng thực không đúng! Có thể có vấn đề trong đường link của bạn. Vui lòng thử lại", false);
            }
        }
Esempio n. 5
0
        public void Init(IVerifyEmail _view)
        {
            /* _webContext = ObjectFactory.GetInstance<IWebContext>();
            _accountRepository = ObjectFactory.GetInstance<IAccountRepository>();*/
            _webContext = new WebContext();
            _accountRepository = new SPKTCore.Core.DataAccess.Impl.AccountRepository();
            string username = Cryptography.Decrypt(_webContext.UsernameToVerify,ParameterSetting.EmailVerificationEncryptKey);

            Account account = _accountRepository.GetAccountByUsername(username);

            if (account != null)
            {
                account.EmailVerified = true;
                _accountRepository.SaveAccount(account);
                _view.ShowMessage("Your email address has been successfully verified!");

            }
            else
            {
                _view.ShowMessage("There appears to be something wrong with your verification link!  Please try again.  If you are having issues by clicking on the link, please try copying the URL from your email and pasting it into your browser window.");
            }
        }