Example #1
0
        private void LogOffAllAPP(string sessionID, string appID, string callbackUrl)
        {
            ExceptionHelper.CheckStringIsNullOrEmpty(sessionID, "sessionID");
            ExceptionHelper.CheckStringIsNullOrEmpty(appID, "appID");
            ExceptionHelper.CheckStringIsNullOrEmpty(callbackUrl, "callbackUrl");

            List <AppLogOffCallBackUrl> list =
                PassportSignInSettings.GetConfig().PersistSignInInfo.GetAllRelativeAppsLogOffCallBackUrl(sessionID);

            if (AppLogOffCallBackUrlExist(list, appID, callbackUrl) == false)
            {
                AppLogOffCallBackUrl au = new AppLogOffCallBackUrl();

                au.AppID             = appID;
                au.LogOffCallBackUrl = callbackUrl;

                list.Add(au);
            }

            HtmlTable table = new HtmlTable();

            tableContainer.InnerHtml = string.Empty;
            tableContainer.Controls.Add(table);

            foreach (AppLogOffCallBackUrl au in list)
            {
                HtmlTableRow tRow = new HtmlTableRow();
                table.Controls.Add(tRow);

                HtmlTableCell cell = new HtmlTableCell();
                cell.InnerText = " ";
                tRow.Controls.Add(cell);

                cell = new HtmlTableCell();
                tRow.Controls.Add(cell);

                HtmlImage img = new HtmlImage();
                img.Align = "absmiddle";
                img.Src   = au.LogOffCallBackUrl;
                img.Alt   = img.Src;
                cell.Controls.Add(img);

                cell           = new HtmlTableCell();
                cell.InnerText = string.Format(Translate("退出应用程序{0}"), au.AppID);
                tRow.Controls.Add(cell);
            }

            PassportSignInSettings.GetConfig().PersistSignInInfo.DeleteRelativeSignInInfo(sessionID);
            PassportManager.ClearSignInCookie();
        }
Example #2
0
        private bool AppLogOffCallBackUrlExist(List <AppLogOffCallBackUrl> list, string appID, string callbackUrl)
        {
            bool result = false;

            for (int i = 0; i < list.Count; i++)
            {
                AppLogOffCallBackUrl au = list[i];

                if (string.Compare(au.AppID, appID, true) == 0 &&
                    string.Compare(au.LogOffCallBackUrl, callbackUrl, true) == 0)
                {
                    result = true;
                    break;
                }
            }

            return(result);
        }
Example #3
0
        private void LogOffAllAPP(string sessionID, string appID, string callbackUrl)
        {
            ExceptionHelper.CheckStringIsNullOrEmpty(sessionID, "sessionID");
            ExceptionHelper.CheckStringIsNullOrEmpty(appID, "appID");
            ExceptionHelper.CheckStringIsNullOrEmpty(callbackUrl, "callbackUrl");

            List <AppLogOffCallBackUrl> urls =
                PassportSignInSettings.GetConfig().PersistSignInInfo.GetAllRelativeAppsLogOffCallBackUrl(sessionID);

            if (AppLogOffCallBackUrlExist(urls, appID, callbackUrl) == false)
            {
                AppLogOffCallBackUrl au = new AppLogOffCallBackUrl();

                au.AppID             = appID;
                au.LogOffCallBackUrl = callbackUrl;

                urls.Add(au);
            }

            this.RenderCallBackUrls(urls);

            PassportSignInSettings.GetConfig().PersistSignInInfo.DeleteRelativeSignInInfo(sessionID);
            PassportManager.ClearSignInCookie();
        }