Ejemplo n.º 1
0
        internal static PolicyConfiguration GetPolicyConfigurationFromAD(IConfigurationSession session, ADObjectId owaMailboxPolicyId)
        {
            OwaMailboxPolicy[] array            = session.Find <OwaMailboxPolicy>(owaMailboxPolicyId, QueryScope.Base, null, null, 1);
            OwaMailboxPolicy   owaMailboxPolicy = null;

            if (array != null && array.Length == 1)
            {
                owaMailboxPolicy = array[0];
            }
            if (owaMailboxPolicy == null)
            {
                ExTraceGlobals.PolicyConfigurationTracer.TraceError <ADObjectId>(0L, LocalizedStrings.GetNonEncoded(246332502), owaMailboxPolicyId);
                return(null);
            }
            PolicyConfiguration policyConfiguration = new PolicyConfiguration();

            policyConfiguration.PhoneticSupportEnabled = owaMailboxPolicy.PhoneticSupportEnabled;
            AttachmentPolicy.Level treatUnknownTypeAs = ConfigurationBase.AttachmentActionToLevel(new AttachmentBlockingActions?(owaMailboxPolicy.ActionForUnknownFileAndMIMETypes));
            AttachmentPolicy       attachmentPolicy   = new AttachmentPolicy(owaMailboxPolicy.BlockedFileTypes.ToArray(), owaMailboxPolicy.BlockedMimeTypes.ToArray(), owaMailboxPolicy.ForceSaveFileTypes.ToArray(), owaMailboxPolicy.ForceSaveMimeTypes.ToArray(), owaMailboxPolicy.AllowedFileTypes.ToArray(), owaMailboxPolicy.AllowedMimeTypes.ToArray(), treatUnknownTypeAs, owaMailboxPolicy.DirectFileAccessOnPublicComputersEnabled, owaMailboxPolicy.DirectFileAccessOnPrivateComputersEnabled, owaMailboxPolicy.ForceWebReadyDocumentViewingFirstOnPublicComputers, owaMailboxPolicy.ForceWebReadyDocumentViewingFirstOnPrivateComputers, owaMailboxPolicy.WebReadyDocumentViewingOnPublicComputersEnabled, owaMailboxPolicy.WebReadyDocumentViewingOnPrivateComputersEnabled, owaMailboxPolicy.WebReadyFileTypes.ToArray(), owaMailboxPolicy.WebReadyMimeTypes.ToArray(), owaMailboxPolicy.WebReadyDocumentViewingSupportedFileTypes.ToArray(), owaMailboxPolicy.WebReadyDocumentViewingSupportedMimeTypes.ToArray(), owaMailboxPolicy.WebReadyDocumentViewingForAllSupportedTypes);

            policyConfiguration.AttachmentPolicy      = attachmentPolicy;
            policyConfiguration.DefaultClientLanguage = owaMailboxPolicy.DefaultClientLanguage;
            policyConfiguration.LogonAndErrorLanguage = owaMailboxPolicy.LogonAndErrorLanguage;
            policyConfiguration.DefaultTheme          = owaMailboxPolicy.DefaultTheme;
            policyConfiguration.SetPhotoURL           = owaMailboxPolicy.SetPhotoURL;
            int segmentationBits  = (int)owaMailboxPolicy[OwaMailboxPolicySchema.ADMailboxFolderSet];
            int segmentationBits2 = (int)owaMailboxPolicy[OwaMailboxPolicySchema.ADMailboxFolderSet2];

            policyConfiguration.SegmentationFlags    = Utilities.SetSegmentationFlags(segmentationBits, segmentationBits2);
            policyConfiguration.OutboundCharset      = owaMailboxPolicy.OutboundCharset;
            policyConfiguration.UseGB18030           = owaMailboxPolicy.UseGB18030;
            policyConfiguration.UseISO885915         = owaMailboxPolicy.UseISO885915;
            policyConfiguration.InstantMessagingType = ((owaMailboxPolicy.InstantMessagingType != null) ? owaMailboxPolicy.InstantMessagingType.Value : InstantMessagingTypeOptions.None);
            return(policyConfiguration);
        }
        // Token: 0x060009F6 RID: 2550 RVA: 0x00045548 File Offset: 0x00043748
        private void CreateAttachmentInfobarHelper(ArrayList attachmentList)
        {
            if (attachmentList == null || attachmentList.Count <= 0)
            {
                return;
            }
            StringBuilder    stringBuilder    = new StringBuilder();
            int              num              = 0;
            UserContext      userContext      = UserContextManager.GetUserContext();
            AttachmentPolicy attachmentPolicy = userContext.AttachmentPolicy;

            foreach (object obj in attachmentList)
            {
                AttachmentWellInfo attachmentWellInfo = (AttachmentWellInfo)obj;
                bool flag = AttachmentUtility.IsWebReadyDocument(attachmentWellInfo.FileExtension, attachmentWellInfo.MimeType);
                if (flag && (attachmentWellInfo.AttachmentLevel == AttachmentPolicy.Level.Block || attachmentPolicy.ForceWebReadyDocumentViewingFirst))
                {
                    this.hasWebReadyFirst = true;
                }
                if (attachmentWellInfo.AttachmentLevel == AttachmentPolicy.Level.Block)
                {
                    this.hasLevelOne = true;
                    if (!flag)
                    {
                        this.hasLevelOneAndBlock = true;
                        num++;
                        if (num == 16)
                        {
                            stringBuilder.Append(",...");
                        }
                        else if (num <= 15)
                        {
                            if (num != 1)
                            {
                                stringBuilder.Append(", ");
                            }
                            stringBuilder.Append(attachmentWellInfo.AttachmentName);
                        }
                    }
                }
                else if (attachmentWellInfo.AttachmentLevel == AttachmentPolicy.Level.ForceSave)
                {
                    this.hasLevelTwo = true;
                }
                else if (attachmentWellInfo.AttachmentLevel == AttachmentPolicy.Level.Allow)
                {
                    this.hasLevelThree = true;
                }
            }
            if (stringBuilder.Length > 0)
            {
                this.fileNameStringForLevelOneAndBlock = stringBuilder.ToString();
            }
        }
Ejemplo n.º 3
0
        public AttachmentPolicy.Level GetLevel(string attachmentType, AttachmentPolicy.TypeSignifier typeSignifier)
        {
            AttachmentPolicy.Level result = AttachmentPolicy.Level.Unknown;
            switch (typeSignifier)
            {
            case AttachmentPolicy.TypeSignifier.File:
                result = AttachmentPolicy.FindLevel(this.fileTypeLevels, attachmentType);
                break;

            case AttachmentPolicy.TypeSignifier.Mime:
                result = AttachmentPolicy.FindLevel(this.mimeTypeLevels, attachmentType);
                break;
            }
            return(result);
        }
        internal CalendarVDirConfiguration()
        {
            base.PhoneticSupportEnabled     = true;
            this.formsAuthenticationEnabled = 0;
            AttachmentPolicy.Level treatUnknownTypeAs = AttachmentPolicy.Level.Block;
            AttachmentPolicy       attachmentPolicy   = new AttachmentPolicy(new string[0], new string[0], new string[0], new string[0], new string[0], new string[0], treatUnknownTypeAs, false, false, false, false, false, false, new string[0], new string[0], new string[0], new string[0], false);

            base.AttachmentPolicy             = attachmentPolicy;
            base.DefaultClientLanguage        = Globals.ServerCulture.LCID;
            this.filterWebBeaconsAndHtmlForms = WebBeaconFilterLevels.ForceFilter;
            base.LogonAndErrorLanguage        = Globals.ServerCulture.LCID;
            this.logonFormat                            = LogonFormats.FullDomain;
            this.defaultDomain                          = string.Empty;
            this.notificationInterval                   = -1;
            this.sessionTimeout                         = -1;
            this.redirectToOptimalOWAServer             = true;
            base.DefaultTheme                           = string.Empty;
            this.clientAuthCleanupLevel                 = ClientAuthCleanupLevels.High;
            this.isSMimeEnabledOnCurrentServerr         = false;
            this.documentAccessAllowedServers           = new string[0];
            this.documentAccessBlockedServers           = new string[0];
            this.documentAccessInternalDomainSuffixList = new string[0];
            RemoteDocumentsActions?remoteDocumentsActions = new RemoteDocumentsActions?(RemoteDocumentsActions.Block);

            if (remoteDocumentsActions != null)
            {
                if (remoteDocumentsActions == RemoteDocumentsActions.Allow)
                {
                    this.remoteDocumentsActionForUnknownServers = RemoteDocumentsActions.Allow;
                }
                else
                {
                    this.remoteDocumentsActionForUnknownServers = RemoteDocumentsActions.Block;
                }
            }
            base.InternalAuthenticationMethod = AuthenticationMethod.None;
            base.ExternalAuthenticationMethod = AuthenticationMethod.None;
            base.Exchange2003Url                = null;
            base.LegacyRedirectType             = LegacyRedirectTypeOptions.Manual;
            base.SegmentationFlags              = 536871426UL;
            base.InstantMessagingType           = InstantMessagingTypeOptions.None;
            this.defaultAcceptedDomain          = null;
            this.publicFoldersEnabledOnThisVdir = false;
        }
Ejemplo n.º 5
0
 internal AttachmentPolicy(string[] blockFileTypes, string[] blockMimeTypes, string[] forceSaveFileTypes, string[] forceSaveMimeTypes, string[] allowFileTypes, string[] allowMimeTypes, AttachmentPolicy.Level treatUnknownTypeAs, bool directFileAccessOnPublicComputersEnabled, bool directFileAccessOnPrivateComputersEnabled, bool forceWebReadyDocumentViewingFirstOnPublicComputers, bool forceWebReadyDocumentViewingFirstOnPrivateComputers, bool webReadyDocumentViewingOnPublicComputersEnabled, bool webReadyDocumentViewingOnPrivateComputersEnabled, string[] webReadyFileTypes, string[] webReadyMimeTypes, string[] webReadyDocumentViewingSupportedFileTypes, string[] webReadyDocumentViewingSupportedMimeTypes, bool webReadyDocumentViewingForAllSupportedTypes)
 {
     this.treatUnknownTypeAs = treatUnknownTypeAs;
     this.directFileAccessOnPublicComputersEnabled            = directFileAccessOnPublicComputersEnabled;
     this.directFileAccessOnPrivateComputersEnabled           = directFileAccessOnPrivateComputersEnabled;
     this.forceWebReadyDocumentViewingFirstOnPublicComputers  = forceWebReadyDocumentViewingFirstOnPublicComputers;
     this.forceWebReadyDocumentViewingFirstOnPrivateComputers = forceWebReadyDocumentViewingFirstOnPrivateComputers;
     this.webReadyDocumentViewingOnPublicComputersEnabled     = webReadyDocumentViewingOnPublicComputersEnabled;
     this.webReadyDocumentViewingOnPrivateComputersEnabled    = webReadyDocumentViewingOnPrivateComputersEnabled;
     this.webReadyFileTypes = webReadyFileTypes;
     Array.Sort <string>(this.webReadyFileTypes);
     this.webReadyMimeTypes = webReadyMimeTypes;
     Array.Sort <string>(this.webReadyMimeTypes);
     this.webReadyDocumentViewingSupportedFileTypes = webReadyDocumentViewingSupportedFileTypes;
     Array.Sort <string>(this.webReadyDocumentViewingSupportedFileTypes);
     this.webReadyDocumentViewingSupportedMimeTypes = webReadyDocumentViewingSupportedMimeTypes;
     Array.Sort <string>(this.webReadyDocumentViewingSupportedMimeTypes);
     this.webReadyDocumentViewingForAllSupportedTypes = webReadyDocumentViewingForAllSupportedTypes;
     this.fileTypeLevels = AttachmentPolicy.LoadDictionary(blockFileTypes, forceSaveFileTypes, allowFileTypes);
     this.mimeTypeLevels = AttachmentPolicy.LoadDictionary(blockMimeTypes, forceSaveMimeTypes, allowMimeTypes);
 }
Ejemplo n.º 6
0
        // Token: 0x0600082C RID: 2092 RVA: 0x0003C050 File Offset: 0x0003A250
        private void LoadPreCheckInVdirConfiguration()
        {
            AttachmentPolicy attachmentPolicy = new AttachmentPolicy(new StringArrayAppSettingsEntry("BlockFileTypes", new string[]
            {
                ".vsmacros",
                ".msh2xml",
                ".msh1xml",
                ".ps2xml",
                ".ps1xml",
                ".mshxml",
                ".mhtml",
                ".psc2",
                ".psc1",
                ".msh2",
                ".msh1",
                ".aspx",
                ".xml",
                ".wsh",
                ".wsf",
                ".wsc",
                ".vsw",
                ".vst",
                ".vss",
                ".vbs",
                ".vbe",
                ".url",
                ".tmp",
                ".shs",
                ".shb",
                ".sct",
                ".scr",
                ".scf",
                ".reg",
                ".pst",
                ".ps2",
                ".ps1",
                ".prg",
                ".prf",
                ".plg",
                ".pif",
                ".pcd",
                ".ops",
                ".mst",
                ".msp",
                ".msi",
                ".msh",
                ".msc",
                ".mht",
                ".mdz",
                ".mdw",
                ".mdt",
                ".mde",
                ".mdb",
                ".mda",
                ".maw",
                ".mav",
                ".mau",
                ".mat",
                ".mas",
                ".mar",
                ".maq",
                ".mam",
                ".mag",
                ".maf",
                ".mad",
                ".lnk",
                ".ksh",
                ".jse",
                ".its",
                ".isp",
                ".ins",
                ".inf",
                ".htc",
                ".hta",
                ".hlp",
                ".fxp",
                ".exe",
                ".der",
                ".csh",
                ".crt",
                ".cpl",
                ".com",
                ".cmd",
                ".chm",
                ".cer",
                ".bat",
                ".bas",
                ".asx",
                ".asp",
                ".app",
                ".adp",
                ".ade",
                ".ws",
                ".vb",
                ".js"
            }, null).Value, new StringArrayAppSettingsEntry("BlockMimeTypes", new string[]
            {
                "application/x-javascript",
                "application/javascript",
                "application/msaccess",
                "x-internet-signup",
                "text/javascript",
                "application/xml",
                "application/prg",
                "application/hta",
                "text/scriplet",
                "text/xml"
            }, null).Value, new StringArrayAppSettingsEntry("ForceSaveFileTypes", new string[]
            {
                ".vsmacros",
                ".msh2xml",
                ".msh1xml",
                ".ps2xml",
                ".ps1xml",
                ".mshxml",
                ".mhtml",
                ".psc2",
                ".psc1",
                ".msh2",
                ".msh1",
                ".aspx",
                ".xml",
                ".wsh",
                ".wsf",
                ".wsc",
                ".vsw",
                ".vst",
                ".vss",
                ".vbs",
                ".vbe",
                ".url",
                ".tmp",
                ".shs",
                ".shb",
                ".sct",
                ".scr",
                ".scf",
                ".reg",
                ".pst",
                ".ps2",
                ".ps1",
                ".prg",
                ".prf",
                ".plg",
                ".pif",
                ".pcd",
                ".ops",
                ".mst",
                ".msp",
                ".msi",
                ".msh",
                ".msc",
                ".mht",
                ".mdz",
                ".mdw",
                ".mdt",
                ".mde",
                ".mdb",
                ".mda",
                ".maw",
                ".mav",
                ".mau",
                ".mat",
                ".mas",
                ".mar",
                ".maq",
                ".mam",
                ".mag",
                ".maf",
                ".mad",
                ".lnk",
                ".ksh",
                ".jse",
                ".its",
                ".isp",
                ".ins",
                ".inf",
                ".htc",
                ".hta",
                ".hlp",
                ".fxp",
                ".exe",
                ".der",
                ".csh",
                ".crt",
                ".cpl",
                ".com",
                ".cmd",
                ".chm",
                ".cer",
                ".bat",
                ".bas",
                ".asx",
                ".asp",
                ".app",
                ".adp",
                ".ade",
                ".ws",
                ".vb",
                ".js"
            }, null).Value, new StringArrayAppSettingsEntry("ForceSaveMimeTypes", new string[]
            {
                "Application/x-shockwave-flash",
                "Application/octet-stream",
                "Application/futuresplash",
                "Application/x-director"
            }, null).Value, new StringArrayAppSettingsEntry("AllowFileTypes", new string[]
            {
                ".rpmsg",
                ".xlsx",
                ".xlsm",
                ".xlsb",
                ".pptx",
                ".pptm",
                ".ppsx",
                ".ppsm",
                ".docx",
                ".docm",
                ".zip",
                ".xls",
                ".wmv",
                ".wma",
                ".wav",
                ".vsd",
                ".txt",
                ".tif",
                ".rtf",
                ".pub",
                ".ppt",
                ".png",
                ".pdf",
                ".one",
                ".mp3",
                ".jpg",
                ".gif",
                ".doc",
                ".bmp",
                ".avi"
            }, null).Value, new StringArrayAppSettingsEntry("AllowMimeTypes", new string[0], null).Value, (AttachmentPolicy.Level)Enum.Parse(typeof(AttachmentPolicy.Level), new StringAppSettingsEntry("ActionForUnknownFileAndMIMETypes", "ForceSave", null).Value), new BoolAppSettingsEntry("DirectFileAccessOnPublicComputersEnabled", true, null).Value, new BoolAppSettingsEntry("DirectFileAccessOnPrivateComputersEnabled", true, null).Value, new BoolAppSettingsEntry("ForceWebReadyDocumentViewingFirstOnPublicComputers", false, null).Value, new BoolAppSettingsEntry("ForceWebReadyDocumentViewingFirstOnPrivateComputers", false, null).Value, new BoolAppSettingsEntry("WebReadyDocumentViewingOnPublicComputersEnabled", true, null).Value, new BoolAppSettingsEntry("WebReadyDocumentViewingOnPrivateComputersEnabled", true, null).Value, new StringArrayAppSettingsEntry("WebReadyFileTypes", new string[]
            {
                ".xlsx",
                ".xlsm",
                ".xlsb",
                ".pptx",
                ".pptm",
                ".ppsx",
                ".ppsm",
                ".docx",
                ".docm",
                ".xls",
                ".rtf",
                ".pdf"
            }, null).Value, new StringArrayAppSettingsEntry("WebReadyMimeTypes", new string[0], null).Value, new StringArrayAppSettingsEntry("WebReadyDocumentViewingSupportedFileTypes", new string[]
            {
                ".xlsx",
                ".xlsm",
                ".xlsb",
                ".pptx",
                ".pptm",
                ".ppsx",
                ".ppsm",
                ".docx",
                ".docm",
                ".xls",
                ".rtf",
                ".pdf"
            }, null).Value, new StringArrayAppSettingsEntry("WebReadyDocumentViewingSupportedMimeTypes", new string[0], null).Value, new BoolAppSettingsEntry("WebReadyDocumentViewingForAllSupportedTypes", false, null).Value);

            base.AttachmentPolicy = attachmentPolicy;
            string value = new StringAppSettingsEntry("FilterWebBeaconsAndHtmlForms", "UserFilterChoice", null).Value;

            this.filterWebBeaconsAndHtmlForms = (WebBeaconFilterLevels)Enum.Parse(typeof(WebBeaconFilterLevels), value);
            base.DefaultTheme                   = new StringAppSettingsEntry("DefaultTheme", string.Empty, null).Value;
            base.SegmentationFlags              = (ulong)Enum.Parse(typeof(Feature), new StringAppSettingsEntry("SegmentationFlags", "All", null).Value);
            base.OutboundCharset                = (OutboundCharsetOptions)Enum.Parse(typeof(OutboundCharsetOptions), new StringAppSettingsEntry("OutboundCharset", "AutoDetect", null).Value);
            base.UseGB18030                     = new BoolAppSettingsEntry("UseGB18030", false, null).Value;
            base.UseISO885915                   = new BoolAppSettingsEntry("UseISO885915", false, null).Value;
            base.InstantMessagingType           = (InstantMessagingTypeOptions)Enum.Parse(typeof(InstantMessagingTypeOptions), new StringAppSettingsEntry("InstantMessagingType", "Ocs", null).Value);
            this.imServerName                   = new StringAppSettingsEntry("InstantMessagingServerName", string.Empty, null).Value;
            this.formsAuthenticationEnabled     = (new BoolAppSettingsEntry("FormsAuthenticationEnabled", true, null).Value ? 1 : 0);
            this.publicFoldersEnabledOnThisVdir = new BoolAppSettingsEntry("PublicFoldersEnabled", false, null).Value;
            this.notificationInterval           = new IntAppSettingsEntry("NotificationInterval", 120, null).Value;
            this.sessionTimeout                 = new IntAppSettingsEntry("UserContextTimeout", 60, null).Value;
        }
Ejemplo n.º 7
0
        // Token: 0x06000818 RID: 2072 RVA: 0x0003BA7C File Offset: 0x00039C7C
        internal Configuration(IConfigurationSession session, string virtualDirectory, string webSiteName, ADObjectId vDirADObjectId, bool isPhoneticSupportEnabled)
        {
            base.PhoneticSupportEnabled = isPhoneticSupportEnabled;
            if (Globals.IsPreCheckinApp)
            {
                this.ExpirationTime = DateTime.UtcNow + Configuration.expirationPeriod;
                this.LoadPreCheckInVdirConfiguration();
                return;
            }
            ADOwaVirtualDirectory adowaVirtualDirectory = session.Read <ADOwaVirtualDirectory>(vDirADObjectId);

            if (adowaVirtualDirectory == null)
            {
                string message = string.Format(LocalizedStrings.GetNonEncoded(-1166886287), virtualDirectory, webSiteName);
                throw new OwaInvalidConfigurationException(message);
            }
            this.formsAuthenticationEnabled = (adowaVirtualDirectory.InternalAuthenticationMethods.Contains(AuthenticationMethod.Fba) ? 1 : 0);
            AttachmentPolicy.Level treatUnknownTypeAs = ConfigurationBase.AttachmentActionToLevel(adowaVirtualDirectory.ActionForUnknownFileAndMIMETypes);
            AttachmentPolicy       attachmentPolicy   = new AttachmentPolicy(adowaVirtualDirectory.BlockedFileTypes.ToArray(), adowaVirtualDirectory.BlockedMimeTypes.ToArray(), adowaVirtualDirectory.ForceSaveFileTypes.ToArray(), adowaVirtualDirectory.ForceSaveMimeTypes.ToArray(), adowaVirtualDirectory.AllowedFileTypes.ToArray(), adowaVirtualDirectory.AllowedMimeTypes.ToArray(), treatUnknownTypeAs, adowaVirtualDirectory.DirectFileAccessOnPublicComputersEnabled.Value, adowaVirtualDirectory.DirectFileAccessOnPrivateComputersEnabled.Value, adowaVirtualDirectory.ForceWebReadyDocumentViewingFirstOnPublicComputers.Value, adowaVirtualDirectory.ForceWebReadyDocumentViewingFirstOnPrivateComputers.Value, adowaVirtualDirectory.WebReadyDocumentViewingOnPublicComputersEnabled.Value, adowaVirtualDirectory.WebReadyDocumentViewingOnPrivateComputersEnabled.Value, adowaVirtualDirectory.WebReadyFileTypes.ToArray(), adowaVirtualDirectory.WebReadyMimeTypes.ToArray(), adowaVirtualDirectory.WebReadyDocumentViewingSupportedFileTypes.ToArray(), adowaVirtualDirectory.WebReadyDocumentViewingSupportedMimeTypes.ToArray(), adowaVirtualDirectory.WebReadyDocumentViewingForAllSupportedTypes.Value);

            base.AttachmentPolicy             = attachmentPolicy;
            base.DefaultClientLanguage        = adowaVirtualDirectory.DefaultClientLanguage.Value;
            this.filterWebBeaconsAndHtmlForms = adowaVirtualDirectory.FilterWebBeaconsAndHtmlForms.Value;
            base.LogonAndErrorLanguage        = adowaVirtualDirectory.LogonAndErrorLanguage;
            this.logonFormat                            = adowaVirtualDirectory.LogonFormat;
            this.defaultDomain                          = adowaVirtualDirectory.DefaultDomain;
            this.notificationInterval                   = (adowaVirtualDirectory.NotificationInterval ?? 120);
            this.sessionTimeout                         = (adowaVirtualDirectory.UserContextTimeout ?? 60);
            this.redirectToOptimalOWAServer             = (adowaVirtualDirectory.RedirectToOptimalOWAServer == true);
            base.DefaultTheme                           = adowaVirtualDirectory.DefaultTheme;
            base.SetPhotoURL                            = adowaVirtualDirectory.SetPhotoURL;
            this.clientAuthCleanupLevel                 = adowaVirtualDirectory.ClientAuthCleanupLevel;
            this.imCertificateThumbprint                = adowaVirtualDirectory.InstantMessagingCertificateThumbprint;
            this.imServerName                           = adowaVirtualDirectory.InstantMessagingServerName;
            this.isSMimeEnabledOnCurrentServerr         = (adowaVirtualDirectory.SMimeEnabled ?? false);
            this.documentAccessAllowedServers           = adowaVirtualDirectory.RemoteDocumentsAllowedServers.ToArray();
            this.documentAccessBlockedServers           = adowaVirtualDirectory.RemoteDocumentsBlockedServers.ToArray();
            this.documentAccessInternalDomainSuffixList = adowaVirtualDirectory.RemoteDocumentsInternalDomainSuffixList.ToArray();
            RemoteDocumentsActions?remoteDocumentsActions = adowaVirtualDirectory.RemoteDocumentsActionForUnknownServers;

            if (remoteDocumentsActions != null)
            {
                if (remoteDocumentsActions == RemoteDocumentsActions.Allow)
                {
                    this.remoteDocumentsActionForUnknownServers = RemoteDocumentsActions.Allow;
                }
                else
                {
                    this.remoteDocumentsActionForUnknownServers = RemoteDocumentsActions.Block;
                }
            }
            base.InternalAuthenticationMethod = ConfigurationBase.GetAuthenticationMethod(adowaVirtualDirectory[ADVirtualDirectorySchema.InternalAuthenticationMethodFlags]);
            base.ExternalAuthenticationMethod = ConfigurationBase.GetAuthenticationMethod(adowaVirtualDirectory[ADVirtualDirectorySchema.ExternalAuthenticationMethodFlags]);
            base.Exchange2003Url    = adowaVirtualDirectory.Exchange2003Url;
            base.LegacyRedirectType = LegacyRedirectTypeOptions.Silent;
            int segmentationBits  = (int)adowaVirtualDirectory[ADOwaVirtualDirectorySchema.ADMailboxFolderSet];
            int segmentationBits2 = (int)adowaVirtualDirectory[ADOwaVirtualDirectorySchema.ADMailboxFolderSet2];

            base.SegmentationFlags = Utilities.SetSegmentationFlags(segmentationBits, segmentationBits2);
            if (adowaVirtualDirectory.OutboundCharset != null)
            {
                base.OutboundCharset = adowaVirtualDirectory.OutboundCharset.Value;
            }
            if (adowaVirtualDirectory.UseGB18030 != null && adowaVirtualDirectory.UseGB18030.Value)
            {
                base.UseGB18030 = true;
            }
            else
            {
                base.UseGB18030 = false;
            }
            if (adowaVirtualDirectory.UseISO885915 != null && adowaVirtualDirectory.UseISO885915.Value)
            {
                base.UseISO885915 = true;
            }
            else
            {
                base.UseISO885915 = false;
            }
            base.InstantMessagingType           = ((adowaVirtualDirectory.InstantMessagingType != null) ? adowaVirtualDirectory.InstantMessagingType.Value : InstantMessagingTypeOptions.None);
            this.defaultAcceptedDomain          = session.GetDefaultAcceptedDomain();
            this.publicFoldersEnabledOnThisVdir = (adowaVirtualDirectory.PublicFoldersEnabled ?? false);
            this.ExpirationTime = DateTime.UtcNow + Configuration.expirationPeriod;
            OwaDiagnostics.LogEvent(ClientsEventLogConstants.Tuple_ConfigurationSettingsUpdated, string.Empty, new object[]
            {
                virtualDirectory,
                webSiteName
            });
        }
        public void InvokeTaskManager()
        {
            if (!AppSettings.GetConfiguredValue <bool>("TranscodingServiceEnabled", false))
            {
                this.HandleFault(LocalizedStrings.GetNonEncoded(500694802));
                return;
            }
            AttachmentPolicy attachmentPolicy = this.owaContext.UserContext.AttachmentPolicy;

            using (Stream stream = this.LoadDocument(true, out this.decryptionStatus))
            {
                if (this.decryptionStatus.Failed)
                {
                    SanitizedHtmlString irmErrorDetails = WebReadyViewUtilities.GetIrmErrorDetails(this.owaContext.UserContext, this.decryptionStatus);
                    this.HandleFault(irmErrorDetails.ToString());
                }
                else if (!attachmentPolicy.WebReadyDocumentViewingEnable)
                {
                    this.HandleFault(LocalizedStrings.GetNonEncoded(500694802));
                }
                else if (!AttachmentUtility.IsWebReadyDocument(this.fileExtension, this.mimeType))
                {
                    this.HandleFault(LocalizedStrings.GetNonEncoded(-1584334964));
                }
                else
                {
                    try
                    {
                        byte[] bytes = Encoding.Default.GetBytes(this.documentIdStringBuilder.ToString());
                        byte[] value = null;
                        using (MessageDigestForNonCryptographicPurposes messageDigestForNonCryptographicPurposes = new MessageDigestForNonCryptographicPurposes())
                        {
                            value = messageDigestForNonCryptographicPurposes.ComputeHash(bytes);
                        }
                        WebReadyViewUtilities.InitializeTranscodingService();
                        Utilities.MakePageNoCacheNoStore(this.owaContext.HttpContext.Response);
                        string sourceDocType = string.IsNullOrEmpty(this.fileExtension) ? this.mimeType : this.fileExtension.TrimStart(new char[]
                        {
                            '.'
                        });
                        try
                        {
                            TranscodingTaskManager.Transcode(BitConverter.ToString(value), this.owaContext.UserContext.Key.UserContextId, stream, sourceDocType, this.currentPageNumber, out this.totalPageNumber, this.owaContext.HttpContext.Response);
                        }
                        catch (TranscodingCrashException innerException)
                        {
                            OwaDiagnostics.LogEvent(ClientsEventLogConstants.Tuple_TranscodingWorkerProcessFails, string.Empty, new object[]
                            {
                                this.owaContext.LogonIdentity.GetLogonName(),
                                this.owaContext.LogonIdentity.UserSid.Value,
                                this.messageFrom,
                                this.messageSubject,
                                this.messageId,
                                this.documentPath,
                                this.documentIdStringBuilder.ToString()
                            });
                            throw new TranscodingUnconvertibleFileException("Transcoding service crash when converting the document.", innerException, this);
                        }
                        if (this.currentPageNumber == 0)
                        {
                            this.currentPageNumber = this.totalPageNumber;
                        }
                    }
                    catch (TranscodingException ex)
                    {
                        ExTraceGlobals.TranscodingTracer.TraceDebug <Type, string>(0L, "Exception: Type: {0} Error: {1}.", ex.GetType(), ex.Message);
                        ErrorInformation exceptionHandlingInformation = Utilities.GetExceptionHandlingInformation(ex, this.owaContext.MailboxIdentity);
                        this.HandleFault(exceptionHandlingInformation.Message);
                    }
                }
            }
        }