コード例 #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string     text       = base.Request.QueryString["ot"];
            PluginItem pluginItem = OpenIdPlugins.Instance().GetPluginItem(text);
            string     text2      = "WapShop";

            if (string.IsNullOrEmpty(this.Page.Request.RawUrl))
            {
                goto IL_0049;
            }
            goto IL_0049;
IL_0049:
            if (pluginItem == null)
            {
                this.lblMsg.Text = "没有找到对应的插件,<a href=\"/\">返回首页</a>。";
            }
            else
            {
                OpenIdSettingInfo openIdSettings = MemberProcessor.GetOpenIdSettings(text);
                if (openIdSettings == null)
                {
                    this.lblMsg.Text = "请先配置此插件所需的信息,<a href=\"/\">返回首页</a>。";
                }
                else
                {
                    string returnUrl = Globals.FullPath(base.GetRouteUrl("OpenIdEntry_url", new
                    {
                        HIGW = text.Replace(".", "_")
                    }));
                    OpenIdService openIdService = OpenIdService.CreateInstance(text, HiCryptographer.Decrypt(openIdSettings.Settings), returnUrl);
                    openIdService.Post();
                }
            }
        }
コード例 #2
0
ファイル: RedirectLogin.cs プロジェクト: damoOnly/e-commerce
        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(HiContext.Current.User.Username, true);
                IUserCookie           userCookie = HiContext.Current.User.GetUserCookie();
                if (userCookie != null)
                {
                    userCookie.DeleteCookie(authCookie);
                }
                RoleHelper.SignOut(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();
        }
コード例 #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string     text       = base.Request.QueryString["ot"];
            PluginItem pluginItem = OpenIdPlugins.Instance().GetPluginItem(text);

            if (pluginItem == null)
            {
                this.msg = "没有找到对应的插件,<a href=\"/\">返回首页</a>。";
            }
            else
            {
                OpenIdSettingInfo openIdSettings = MemberProcessor.GetOpenIdSettings(text);
                if (openIdSettings == null)
                {
                    this.msg = "请先配置此插件所需的信息,<a href=\"/\">返回首页</a>。";
                }
                else
                {
                    string text2 = base.Request.QueryString["returnUrl"];
                    string text3 = base.Request.QueryString["client"].ToNullString();
                    if (string.IsNullOrEmpty(text3))
                    {
                        text3 = "wapshop";
                    }
                    string returnUrl = Globals.FullPath(base.GetRouteUrl("OpenIdEntry_url_Wap", new
                    {
                        HIGW = text.Replace(".", "_")
                    })).ToLower().Replace("/wapshop/", "/" + text3 + "/");
                    OpenIdService openIdService = OpenIdService.CreateInstance(text, HiCryptographer.Decrypt(openIdSettings.Settings), returnUrl);
                    openIdService.Post();
                }
            }
        }