示例#1
0
        public MemberAuthentication(Site site, HttpContextBase httpContextBase)
        {
            if (site == null)
            {
                throw new ArgumentNullException("site");
            }
            if (httpContextBase == null)
            {
                throw new ArgumentNullException("httpContextBase");
            }
            this._site = site;
            this._membership = site.GetMembership();
            if (_membership == null)
            {
                throw new NullMembershipException();
            }

            this._httpContext = httpContextBase;
        }
示例#2
0
 private static string GetPrincipalName(Site site)
 {
     var membership = site.GetMembership().AsActual();
     if (!string.IsNullOrEmpty(membership.AuthCookieName))
     {
         return membership.AuthCookieName;
     }
     return string.Format(MemberPrincipalName, site.FullName);
 }