Ejemplo n.º 1
0
        private void ShowBindingLinks()
        {
            OpenIDBindingCollection bindings =
                PassportSignInSettings.GetConfig().PersistOpenIDBinding.GetBindingsByUserID(DeluxeIdentity.CurrentUser.ID);

            foreach (OpenIDBinding binding in bindings)
            {
                string openIDUrl = string.Format("../AnonymousTestPage/OpenIDIdentityTest.aspx?openID={0}", binding.OpenID);

                string anchor = string.Format("<a href=\"{0}\">{0}</a>", openIDUrl);

                string name = string.Format("OpenID({0})", binding.OpenIDType);

                ShowSinglePrincipalHtmlInfo(principalInfo, name, anchor);
            }
        }
Ejemplo n.º 2
0
        private void RenderBindings(Control parent)
        {
            OpenIDBindingCollection bindings =
                PassportSignInSettings.GetConfig().PersistOpenIDBinding.GetBindingsByUserID(DeluxeIdentity.CurrentUser.ID);

            SocialPassportSettings settings = SocialPassportSettings.GetConfig();

            foreach (OpenIDBinding binding in bindings)
            {
                SocialConnectionConfigurationElement element = settings.Connections[binding.OpenIDType];

                if (element != null)
                {
                    RenderBindingInfo(parent, binding, element);
                }
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="userID"></param>
        /// <returns></returns>
        public OpenIDBindingCollection GetBindingsByUserID(string userID)
        {
            ExceptionHelper.CheckStringIsNullOrEmpty(userID, "userID");

            ORMappingItemCollection mappings = ORMapping.GetMappingInfo(typeof(OpenIDBinding));

            string sql = string.Format("SELECT * FROM {0} WHERE USER_ID = {1}",
                                       mappings.TableName,
                                       TSqlBuilder.Instance.CheckUnicodeQuotationMark(userID));

            OpenIDBindingCollection result = new OpenIDBindingCollection();

            using (DbContext context = DbContext.GetContext(DataAdapter.DBConnectionName))
            {
                Database db = DatabaseFactory.Create(DataAdapter.DBConnectionName);

                DataView view = db.ExecuteDataSet(CommandType.Text, sql).Tables[0].DefaultView;

                ORMapping.DataViewToCollection(result, view);
            }

            return(result);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="userID"></param>
        /// <returns></returns>
        public OpenIDBindingCollection GetBindingsByUserID(string userID)
        {
            ExceptionHelper.CheckStringIsNullOrEmpty(userID, "userID");

            ORMappingItemCollection mappings = ORMapping.GetMappingInfo(typeof(OpenIDBinding));

            string sql = string.Format("SELECT * FROM {0} WHERE USER_ID = {1}",
                mappings.TableName,
                TSqlBuilder.Instance.CheckUnicodeQuotationMark(userID));

            OpenIDBindingCollection result = new OpenIDBindingCollection();

            using (DbContext context = DbContext.GetContext(DataAdapter.DBConnectionName))
            {
                Database db = DatabaseFactory.Create(DataAdapter.DBConnectionName);

                DataView view = db.ExecuteDataSet(CommandType.Text, sql).Tables[0].DefaultView;

                ORMapping.DataViewToCollection(result, view);
            }

            return result;
        }