Example #1
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            if (this.Context.Request.IsAuthenticated)
            {
                System.Web.Security.FormsAuthentication.SignOut();
                System.Web.HttpCookie authCookie = System.Web.Security.FormsAuthentication.GetAuthCookie(Hidistro.Membership.Context.HiContext.Current.User.Username, true);
                Hidistro.Membership.Core.IUserCookie userCookie = Hidistro.Membership.Context.HiContext.Current.User.GetUserCookie();
                if (userCookie != null)
                {
                    userCookie.DeleteCookie(authCookie);
                }
                Hidistro.Membership.Core.RoleHelper.SignOut(Hidistro.Membership.Context.HiContext.Current.User.Username);
            }
            string text = base.Request.QueryString["ot"];

            if (OpenIdPlugins.Instance().GetPluginItem(text) == null)
            {
                this.lblMsg.Text = "没有找到对应的插件,<a href=\"" + Globals.GetSiteUrls().Home + "\">返回首页</a>。";
                return;
            }
            OpenIdSettingsInfo openIdSettings = MemberProcessor.GetOpenIdSettings(text);

            if (openIdSettings == null)
            {
                this.lblMsg.Text = "请先配置此插件所需的信息,<a href=\"" + Globals.GetSiteUrls().Home + "\">返回首页</a>。";
                return;
            }
            string returnUrl = Globals.FullPath(Globals.GetSiteUrls().UrlData.FormatUrl("OpenIdEntry_url", new object[]
            {
                text
            }));
            OpenIdService openIdService = OpenIdService.CreateInstance(text, HiCryptographer.Decrypt(openIdSettings.Settings), returnUrl);

            openIdService.Post();
        }
Example #2
0
        private void btnAdminLogin_Click(object sender, System.EventArgs e)
        {
            if (!Hidistro.Membership.Context.HiContext.Current.CheckVerifyCode(this.txtCode.Text.Trim()))
            {
                this.ShowMessage("验证码不正确");
                return;
            }
            Hidistro.Membership.Core.IUser user = Hidistro.Membership.Context.Users.GetUser(0, this.txtAdminName.Text, false, true);
            if (user == null || user.IsAnonymous || user.UserRole != Hidistro.Membership.Core.Enums.UserRole.SiteManager || !user.IsInRole("区域发货点"))
            {
                this.ShowMessage("无效的用户信息");
                return;
            }
            string text = null;

            Hidistro.Membership.Context.SiteManager siteManager = user as Hidistro.Membership.Context.SiteManager;
            siteManager.Password = this.txtAdminPassWord.Text;
            Hidistro.Membership.Core.Enums.LoginUserStatus loginUserStatus = ManagerHelper.ValidLogin(siteManager);
            if (loginUserStatus == Hidistro.Membership.Core.Enums.LoginUserStatus.Success)
            {
                System.Web.HttpCookie authCookie = System.Web.Security.FormsAuthentication.GetAuthCookie(siteManager.Username, false);
                Hidistro.Membership.Core.IUserCookie userCookie = siteManager.GetUserCookie();
                userCookie.WriteCookie(authCookie, 30, false);
                Hidistro.Membership.Context.HiContext.Current.User = siteManager;
                if (!string.IsNullOrEmpty(this.Page.Request.QueryString["returnUrl"]))
                {
                    text = this.Page.Request.QueryString["returnUrl"];
                }
                if (text == null && this.ReferralLink != null && !string.IsNullOrEmpty(this.ReferralLink.Trim()))
                {
                    text = this.ReferralLink;
                }
                if (!string.IsNullOrEmpty(text) && (text.ToLower().IndexOf(Globals.GetSiteUrls().Logout.ToLower()) >= 0 || text.ToLower().IndexOf(Globals.GetSiteUrls().UrlData.FormatUrl("register").ToLower()) >= 0 || text.ToLower().IndexOf(Globals.GetSiteUrls().UrlData.FormatUrl("vote").ToLower()) >= 0 || text.ToLower().IndexOf("loginexit") >= 0))
                {
                }
                this.Page.Response.Redirect("default.html", true);
                return;
            }
            if (loginUserStatus == Hidistro.Membership.Core.Enums.LoginUserStatus.AccountPending)
            {
                this.ShowMessage("用户账号还没有通过审核");
                return;
            }
            if (loginUserStatus == Hidistro.Membership.Core.Enums.LoginUserStatus.AccountLockedOut)
            {
                this.ShowMessage("用户账号已被锁定,暂时不能登录系统");
                return;
            }
            if (loginUserStatus == Hidistro.Membership.Core.Enums.LoginUserStatus.InvalidCredentials)
            {
                this.ShowMessage("用户名或密码错误");
                return;
            }
            this.ShowMessage("登录失败,未知错误");
        }
Example #3
0
 protected override void AttachChildControls()
 {
     if (this.Context.Request.IsAuthenticated)
     {
         System.Web.Security.FormsAuthentication.SignOut();
         System.Web.HttpCookie authCookie = System.Web.Security.FormsAuthentication.GetAuthCookie(Hidistro.Membership.Context.HiContext.Current.User.Username, true);
         Hidistro.Membership.Core.IUserCookie userCookie = Hidistro.Membership.Context.HiContext.Current.User.GetUserCookie();
         if (userCookie != null)
         {
             userCookie.DeleteCookie(authCookie);
         }
         Hidistro.Membership.Core.RoleHelper.SignOut(Hidistro.Membership.Context.HiContext.Current.User.Username);
     }
     if (!string.IsNullOrEmpty(this.Page.Request["action"]) && this.Page.Request["action"] == "Common_UserLogin")
     {
         string text  = this.UserLogin(this.Page.Request["username"], this.Page.Request["password"]);
         string text2 = string.IsNullOrEmpty(text) ? "Succes" : "Fail";
         this.Page.Response.Clear();
         this.Page.Response.ContentType = "application/json";
         this.Page.Response.Write(string.Concat(new string[]
         {
             "{\"Status\":\"",
             text2,
             "\",\"Msg\":\"",
             text,
             "\"}"
         }));
         this.Page.Response.End();
     }
     this.txtUserName = (System.Web.UI.WebControls.TextBox) this.FindControl("txtUserName");
     this.txtPassword = (System.Web.UI.WebControls.TextBox) this.FindControl("txtPassword");
     this.btnLogin    = ButtonManager.Create(this.FindControl("btnLogin"));
     this.ddlPlugins  = (System.Web.UI.WebControls.DropDownList) this.FindControl("ddlPlugins");
     if (this.ddlPlugins != null)
     {
         this.ddlPlugins.Items.Add(new System.Web.UI.WebControls.ListItem("请选择登录方式", ""));
         System.Collections.Generic.IList <OpenIdSettingsInfo> configedItems = MemberProcessor.GetConfigedItems();
         if (configedItems != null && configedItems.Count > 0)
         {
             foreach (OpenIdSettingsInfo current in configedItems)
             {
                 this.ddlPlugins.Items.Add(new System.Web.UI.WebControls.ListItem(current.Name, current.OpenIdType));
             }
         }
         this.ddlPlugins.SelectedIndexChanged += new System.EventHandler(this.ddlPlugins_SelectedIndexChanged);
     }
     if (this.Page.Request.UrlReferrer != null && !string.IsNullOrEmpty(this.Page.Request.UrlReferrer.OriginalString))
     {
         Login.ReturnURL = this.Page.Request.UrlReferrer.OriginalString;
     }
     this.txtUserName.Focus();
     PageTitle.AddSiteNameTitle("用户登录", Hidistro.Membership.Context.HiContext.Current.Context);
     this.btnLogin.Click += new System.EventHandler(this.btnLogin_Click);
 }
Example #4
0
 protected void Page_Load(object sender, System.EventArgs e)
 {
     System.Web.Security.FormsAuthentication.SignOut();
     System.Web.HttpCookie authCookie = System.Web.Security.FormsAuthentication.GetAuthCookie(Hidistro.Membership.Context.HiContext.Current.User.Username, true);
     Hidistro.Membership.Core.IUserCookie userCookie = Hidistro.Membership.Context.HiContext.Current.User.GetUserCookie();
     if (userCookie != null)
     {
         userCookie.DeleteCookie(authCookie);
     }
     Hidistro.Membership.Core.RoleHelper.SignOut(Hidistro.Membership.Context.HiContext.Current.User.Username);
     base.Response.Redirect("Login.aspx", true);
 }
Example #5
0
 protected override void OnInit(System.EventArgs e)
 {
     if (this.Page.Request.IsAuthenticated)
     {
         System.Web.Security.FormsAuthentication.SignOut();
         System.Web.HttpCookie authCookie = System.Web.Security.FormsAuthentication.GetAuthCookie(Hidistro.Membership.Context.HiContext.Current.User.Username, true);
         Hidistro.Membership.Core.IUserCookie userCookie = Hidistro.Membership.Context.HiContext.Current.User.GetUserCookie();
         if (userCookie != null)
         {
             userCookie.DeleteCookie(authCookie);
         }
         Hidistro.Membership.Core.RoleHelper.SignOut(Hidistro.Membership.Context.HiContext.Current.User.Username);
     }
     base.OnInit(e);
 }
Example #6
0
 protected override void AttachChildControls()
 {
     Hidistro.Membership.Context.HiContext arg_05_0 = Hidistro.Membership.Context.HiContext.Current;
     if (this.Context.Request.IsAuthenticated)
     {
         System.Web.Security.FormsAuthentication.SignOut();
         System.Web.HttpCookie authCookie = System.Web.Security.FormsAuthentication.GetAuthCookie(Hidistro.Membership.Context.HiContext.Current.User.Username, true);
         Hidistro.Membership.Core.IUserCookie userCookie = Hidistro.Membership.Context.HiContext.Current.User.GetUserCookie();
         if (userCookie != null)
         {
             userCookie.DeleteCookie(authCookie);
         }
         Hidistro.Membership.Core.RoleHelper.SignOut(Hidistro.Membership.Context.HiContext.Current.User.Username);
         this.Page.Response.Cookies["hishopLoginStatus"].Value = "";
     }
     this.txtUserName     = (System.Web.UI.WebControls.TextBox) this.FindControl("txtUserName");
     this.txtPassword     = (System.Web.UI.WebControls.TextBox) this.FindControl("txtPassword");
     this.btnLogin        = (System.Web.UI.WebControls.Button) this.FindControl("btnLogin");
     this.txtCode         = (System.Web.UI.WebControls.TextBox) this.FindControl("txtCode");
     this.btnLogin.Click += new System.EventHandler(this.btnLogin_Click);
 }
Example #7
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            if (this.Context.Request.IsAuthenticated)
            {
                System.Web.Security.FormsAuthentication.SignOut();
                System.Web.HttpCookie authCookie = System.Web.Security.FormsAuthentication.GetAuthCookie(Hidistro.Membership.Context.HiContext.Current.User.Username, true);
                Hidistro.Membership.Core.IUserCookie userCookie = Hidistro.Membership.Context.HiContext.Current.User.GetUserCookie();
                if (userCookie != null)
                {
                    userCookie.DeleteCookie(authCookie);
                }
                Hidistro.Membership.Core.RoleHelper.SignOut(Hidistro.Membership.Context.HiContext.Current.User.Username);
            }
            this.openIdType = this.Page.Request.QueryString["HIGW"];
            OpenIdSettingsInfo openIdSettings = MemberProcessor.GetOpenIdSettings(this.openIdType);

            if (openIdSettings == null)
            {
                base.Response.Write("登录失败,没有找到对应的插件配置信息。");
                return;
            }
            this.parameters = new System.Collections.Specialized.NameValueCollection
            {
                this.Page.Request.Form,
                this.Page.Request.QueryString
            };
            OpenIdNotify openIdNotify = OpenIdNotify.CreateInstance(this.openIdType, this.parameters);

            openIdNotify.Authenticated += new System.EventHandler <AuthenticatedEventArgs>(this.Notify_Authenticated);
            openIdNotify.Failed        += new System.EventHandler <FailedEventArgs>(this.Notify_Failed);
            try
            {
                openIdNotify.Verify(30000, HiCryptographer.Decrypt(openIdSettings.Settings));
            }
            catch
            {
                this.Page.Response.Redirect(Globals.GetSiteUrls().Home);
            }
        }
Example #8
0
 protected override void OnLoad(System.EventArgs eventArgs_0)
 {
     base.OnLoad(eventArgs_0);
     System.Web.HttpCookie httpCookie = Hidistro.Membership.Context.HiContext.Current.Context.Request.Cookies["Token_" + Hidistro.Membership.Context.HiContext.Current.User.UserId.ToString()];
     if (httpCookie != null && !string.IsNullOrEmpty(httpCookie.Value))
     {
         httpCookie.Expires = System.DateTime.Now;
         System.Web.HttpContext.Current.Response.Cookies.Add(httpCookie);
     }
     if (this.Context.Request.IsAuthenticated)
     {
         System.Web.Security.FormsAuthentication.SignOut();
         System.Web.HttpCookie authCookie = System.Web.Security.FormsAuthentication.GetAuthCookie(Hidistro.Membership.Context.HiContext.Current.User.Username, true);
         Hidistro.Membership.Core.IUserCookie userCookie = Hidistro.Membership.Context.HiContext.Current.User.GetUserCookie();
         if (userCookie != null)
         {
             userCookie.DeleteCookie(authCookie);
         }
         Hidistro.Membership.Core.RoleHelper.SignOut(Hidistro.Membership.Context.HiContext.Current.User.Username);
         this.Context.Response.Cookies["hishopLoginStatus"].Value = "";
     }
     this.Context.Response.Redirect(Globals.GetSiteUrls().Home, true);
 }
Example #9
0
        private string UserLogin(string userName, string password)
        {
            string text = string.Empty;

            Hidistro.Membership.Context.Member member = Hidistro.Membership.Context.Users.GetUser(0, userName, false, true) as Hidistro.Membership.Context.Member;
            string result;

            if (member == null || member.IsAnonymous)
            {
                result = "用户名或密码错误";
            }
            else
            {
                if (Hidistro.Membership.Context.HiContext.Current.SiteSettings.IsDistributorSettings)
                {
                    if (!member.ParentUserId.HasValue || member.ParentUserId.Value != Hidistro.Membership.Context.HiContext.Current.SiteSettings.UserId)
                    {
                        result = "您不是本站会员,请您进行注册";
                        return(result);
                    }
                }
                else
                {
                    if (member.ParentUserId.HasValue && member.ParentUserId.Value != 0)
                    {
                        result = "您不是本站会员,请您进行注册";
                        return(result);
                    }
                }
                member.Password = password;
                Hidistro.Membership.Core.Enums.LoginUserStatus loginUserStatus = MemberProcessor.ValidLogin(member);
                if (loginUserStatus == Hidistro.Membership.Core.Enums.LoginUserStatus.Success)
                {
                    System.Web.HttpCookie authCookie = System.Web.Security.FormsAuthentication.GetAuthCookie(member.Username, false);
                    Hidistro.Membership.Core.IUserCookie userCookie = member.GetUserCookie();
                    userCookie.WriteCookie(authCookie, 30, false);
                    ShoppingCartInfo       shoppingCart           = ShoppingCartProcessor.GetShoppingCart();
                    CookieShoppingProvider cookieShoppingProvider = CookieShoppingProvider.Instance();
                    bool flag = false;
                    if (cookieShoppingProvider.GetShoppingCart() != null && cookieShoppingProvider.GetShoppingCart().GetQuantity() > 0)
                    {
                        flag = true;
                    }
                    cookieShoppingProvider.ClearShoppingCart();
                    Hidistro.Membership.Context.HiContext.Current.User = member;
                    if (shoppingCart != null && flag)
                    {
                        ShoppingCartProcessor.ConvertShoppingCartToDataBase(shoppingCart);
                    }
                    member.OnLogin();
                }
                else
                {
                    if (loginUserStatus == Hidistro.Membership.Core.Enums.LoginUserStatus.AccountPending)
                    {
                        text = "用户账号还没有通过审核";
                    }
                    else
                    {
                        if (loginUserStatus == Hidistro.Membership.Core.Enums.LoginUserStatus.InvalidCredentials)
                        {
                            text = "用户名或密码错误";
                        }
                        else
                        {
                            text = "未知错误";
                        }
                    }
                }
                result = text;
            }
            return(result);
        }
Example #10
0
 private void btnLogin_Click(object sender, System.EventArgs e)
 {
     if (!Hidistro.Membership.Context.HiContext.Current.CheckVerifyCode(this.txtCode.Text.Trim()))
     {
         this.ShowMessage("验证码不正确", false);
     }
     else
     {
         Hidistro.Membership.Core.IUser user = Hidistro.Membership.Context.Users.GetUser(0, this.txtUserName.Text, false, true);
         if (user == null || user.IsAnonymous || user.UserRole != Hidistro.Membership.Core.Enums.UserRole.Distributor)
         {
             this.ShowMessage("无效的用户信息", false);
         }
         else
         {
             Hidistro.Membership.Context.Distributor distributor = user as Hidistro.Membership.Context.Distributor;
             distributor.Password = this.txtPassword.Text;
             if (Hidistro.Membership.Context.HiContext.Current.SiteSettings.IsDistributorSettings && user.UserId != Hidistro.Membership.Context.HiContext.Current.SiteSettings.UserId.Value)
             {
                 this.ShowMessage("分销商只能在自己的站点或主站上登录", false);
             }
             else
             {
                 Hidistro.Membership.Core.Enums.LoginUserStatus loginUserStatus = SubsiteStoreHelper.ValidLogin(distributor);
                 if (loginUserStatus == Hidistro.Membership.Core.Enums.LoginUserStatus.Success)
                 {
                     System.Web.HttpCookie authCookie = System.Web.Security.FormsAuthentication.GetAuthCookie(distributor.Username, false);
                     Hidistro.Membership.Core.IUserCookie userCookie = distributor.GetUserCookie();
                     userCookie.WriteCookie(authCookie, 30, false);
                     this.Page.Response.Cookies["hishopLoginStatus"].Value = "true";
                     Hidistro.Membership.Context.HiContext.Current.User    = distributor;
                     distributor.OnLogin();
                     Hidistro.Membership.Context.SiteSettings siteSettings = Hidistro.Membership.Context.SettingsManager.GetSiteSettings(Hidistro.Membership.Context.HiContext.Current.User.UserId);
                     if (siteSettings == null)
                     {
                         this.Page.Response.Redirect("nositedefault.aspx", true);
                     }
                     else
                     {
                         this.Page.Response.Redirect("default.aspx", true);
                     }
                 }
                 else
                 {
                     if (loginUserStatus == Hidistro.Membership.Core.Enums.LoginUserStatus.AccountPending)
                     {
                         this.ShowMessage("用户账号还没有通过审核", false);
                     }
                     else
                     {
                         if (loginUserStatus == Hidistro.Membership.Core.Enums.LoginUserStatus.AccountLockedOut)
                         {
                             this.ShowMessage("用户账号已被锁定,暂时不能登录系统", false);
                         }
                         else
                         {
                             if (loginUserStatus == Hidistro.Membership.Core.Enums.LoginUserStatus.InvalidCredentials)
                             {
                                 this.ShowMessage("用户名或密码错误", false);
                             }
                             else
                             {
                                 this.ShowMessage("登录失败,未知错误", false);
                             }
                         }
                     }
                 }
             }
         }
     }
 }
Example #11
0
        private void Notify_Authenticated(object sender, AuthenticatedEventArgs e)
        {
            this.parameters.Add("CurrentOpenId", e.OpenId);
            Hidistro.Membership.Context.HiContext current = Hidistro.Membership.Context.HiContext.Current;
            string usernameWithOpenId = Hidistro.Membership.Core.UserHelper.GetUsernameWithOpenId(e.OpenId, this.openIdType);

            if (!string.IsNullOrEmpty(usernameWithOpenId))
            {
                Hidistro.Membership.Context.Member member = Hidistro.Membership.Context.Users.GetUser(0, usernameWithOpenId, false, true) as Hidistro.Membership.Context.Member;
                if (member == null)
                {
                    base.Response.Write("登录失败,信任登录只能用于会员登录。");
                    return;
                }
                if (Hidistro.Membership.Context.HiContext.Current.SiteSettings.IsDistributorSettings)
                {
                    if (!member.ParentUserId.HasValue || member.ParentUserId.Value != Hidistro.Membership.Context.HiContext.Current.SiteSettings.UserId)
                    {
                        base.Response.Write("账号已经与本平台的其它子站绑定,不能在此域名上登录。");
                        return;
                    }
                }
                else
                {
                    if (member.ParentUserId.HasValue && member.ParentUserId.Value != 0)
                    {
                        base.Response.Write("账号已经与本平台的其它子站绑定,不能在此域名上登录。");
                        return;
                    }
                }
                System.Web.HttpCookie authCookie = System.Web.Security.FormsAuthentication.GetAuthCookie(member.Username, false);
                Hidistro.Membership.Core.IUserCookie userCookie = member.GetUserCookie();
                userCookie.WriteCookie(authCookie, 30, false);
                Hidistro.Membership.Context.HiContext.Current.User = member;
                ShoppingCartInfo       shoppingCart           = ShoppingCartProcessor.GetShoppingCart();
                CookieShoppingProvider cookieShoppingProvider = CookieShoppingProvider.Instance();
                cookieShoppingProvider.ClearShoppingCart();
                current.User = member;
                bool flag = false;
                if (cookieShoppingProvider.GetShoppingCart() != null && cookieShoppingProvider.GetShoppingCart().GetQuantity() > 0)
                {
                    flag = true;
                    cookieShoppingProvider.ClearShoppingCart();
                }
                if (shoppingCart != null && flag)
                {
                    ShoppingCartProcessor.ConvertShoppingCartToDataBase(shoppingCart);
                }
                if (!string.IsNullOrEmpty(this.parameters["token"]))
                {
                    System.Web.HttpCookie httpCookie = new System.Web.HttpCookie("Token_" + Hidistro.Membership.Context.HiContext.Current.User.UserId.ToString());
                    httpCookie.Expires = System.DateTime.Now.AddMinutes(30.0);
                    httpCookie.Value   = this.parameters["token"];
                    System.Web.HttpContext.Current.Response.Cookies.Add(httpCookie);
                }
            }
            else
            {
                string a;
                if ((a = this.openIdType.ToLower()) != null)
                {
                    if (a == "hishop.plugins.openid.alipay.alipayservice")
                    {
                        this.SkipAlipayOpenId();
                        goto IL_288;
                    }
                    if (a == "hishop.plugins.openid.qq.qqservice")
                    {
                        this.SkipQQOpenId();
                        goto IL_288;
                    }
                    if (a == "hishop.plugins.openid.taobao.taobaoservice")
                    {
                        this.SkipTaoBaoOpenId();
                        goto IL_288;
                    }
                    if (a == "hishop.plugins.openid.sina.sinaservice")
                    {
                        this.SkipSinaOpenId();
                        goto IL_288;
                    }
                }
                this.Page.Response.Redirect(Globals.GetSiteUrls().Home);
            }
IL_288:
            string a2 = this.parameters["HITO"];

            if (a2 == "1")
            {
                this.Page.Response.Redirect(Globals.GetSiteUrls().UrlData.FormatUrl("submitOrder"));
                return;
            }
            this.Page.Response.Redirect(Globals.GetSiteUrls().Home);
        }
Example #12
0
        protected void SkipSinaOpenId()
        {
            Hidistro.Membership.Context.Member member;
            if (Hidistro.Membership.Context.HiContext.Current.SiteSettings.IsDistributorSettings)
            {
                member = new Hidistro.Membership.Context.Member(Hidistro.Membership.Core.Enums.UserRole.Underling);
                member.ParentUserId = Hidistro.Membership.Context.HiContext.Current.SiteSettings.UserId;
            }
            else
            {
                member = new Hidistro.Membership.Context.Member(Hidistro.Membership.Core.Enums.UserRole.Member);
            }
            if (Hidistro.Membership.Context.HiContext.Current.ReferralUserId > 0)
            {
                member.ReferralUserId = new int?(Hidistro.Membership.Context.HiContext.Current.ReferralUserId);
            }
            member.GradeId  = MemberProcessor.GetDefaultMemberGrade();
            member.Username = this.parameters["CurrentOpenId"];
            if (string.IsNullOrEmpty(member.Username))
            {
                member.Username = "******" + this.GenerateUsername(8);
            }
            member.Email = this.GenerateUsername() + "@localhost.com";
            string text = this.GeneratePassword();

            member.Password            = text;
            member.PasswordFormat      = System.Web.Security.MembershipPasswordFormat.Hashed;
            member.TradePasswordFormat = System.Web.Security.MembershipPasswordFormat.Hashed;
            member.TradePassword       = text;
            member.IsApproved          = true;
            member.RealName            = string.Empty;
            member.Address             = string.Empty;
            if (MemberProcessor.CreateMember(member) != Hidistro.Membership.Core.Enums.CreateUserStatus.Created)
            {
                member.Username = "******" + this.GenerateUsername(9);
                member.Password = (member.TradePassword = text);
                if (MemberProcessor.CreateMember(member) != Hidistro.Membership.Core.Enums.CreateUserStatus.Created)
                {
                    member.Username = this.GenerateUsername();
                    member.Email    = this.GenerateUsername() + "@localhost.com";
                    member.Password = (member.TradePassword = text);
                    if (MemberProcessor.CreateMember(member) != Hidistro.Membership.Core.Enums.CreateUserStatus.Created)
                    {
                        base.Response.Write("为您创建随机账户时失败,请重试。");
                        return;
                    }
                }
            }
            Hidistro.Membership.Core.UserHelper.BindOpenId(member.Username, this.parameters["CurrentOpenId"], this.parameters["HIGW"]);
            System.Web.HttpCookie authCookie = System.Web.Security.FormsAuthentication.GetAuthCookie(member.Username, false);
            Hidistro.Membership.Core.IUserCookie userCookie = member.GetUserCookie();
            userCookie.WriteCookie(authCookie, 30, false);
            ShoppingCartInfo       shoppingCart           = ShoppingCartProcessor.GetShoppingCart();
            CookieShoppingProvider cookieShoppingProvider = CookieShoppingProvider.Instance();

            cookieShoppingProvider.ClearShoppingCart();
            Hidistro.Membership.Context.HiContext.Current.User = member;
            if (shoppingCart != null)
            {
                ShoppingCartProcessor.ConvertShoppingCartToDataBase(shoppingCart);
            }
            if (!string.IsNullOrEmpty(this.parameters["token"]))
            {
                System.Web.HttpCookie httpCookie = new System.Web.HttpCookie("Token_" + Hidistro.Membership.Context.HiContext.Current.User.UserId.ToString());
                httpCookie.Expires = System.DateTime.Now.AddMinutes(30.0);
                httpCookie.Value   = this.parameters["token"];
                System.Web.HttpContext.Current.Response.Cookies.Add(httpCookie);
            }
            this.Page.Response.Redirect(Globals.GetSiteUrls().Home);
        }