예제 #1
0
        internal static string GetUserContextId(HttpContext context)
        {
            UserContextCookie userContextCookie = UserContextCookie.GetUserContextCookie(context);

            if (userContextCookie == null || userContextCookie.CookieValue == null)
            {
                return(string.Empty);
            }
            return(userContextCookie.CookieValue);
        }
예제 #2
0
        public CanaryLogEvent(HttpContext httpContext, IMailboxContext userContext, CanaryLogEvent.CanaryStatus canaryStatus, DateTime creationTime, string logData)
        {
            if (httpContext == null)
            {
                throw new ArgumentNullException("httpContext");
            }
            UserContextCookie userContextCookie = UserContextCookie.GetUserContextCookie(httpContext);

            if (userContextCookie != null)
            {
                this.userContextCookie = userContextCookie.CookieValue;
            }
            else
            {
                this.userContextCookie = string.Empty;
            }
            if (userContext != null && userContext.ExchangePrincipal != null)
            {
                this.primarySmtpAddress = userContext.ExchangePrincipal.MailboxInfo.PrimarySmtpAddress.ToString();
                this.mailboxGuid        = userContext.ExchangePrincipal.MailboxInfo.MailboxGuid.ToString();
            }
            else
            {
                this.primarySmtpAddress = string.Empty;
                this.mailboxGuid        = string.Empty;
            }
            if (logData != null)
            {
                this.logData = logData;
            }
            else
            {
                this.logData = string.Empty;
            }
            this.action       = (httpContext.Request.Headers[OWADispatchOperationSelector.Action] ?? string.Empty);
            this.canaryStatus = canaryStatus;
            this.creationTime = creationTime;
        }