예제 #1
0
        // Token: 0x06003026 RID: 12326 RVA: 0x00119988 File Offset: 0x00117B88
        public static bool IsBlockedHostName(string hostName, UserContext userContext)
        {
            if (string.IsNullOrEmpty(hostName))
            {
                throw new ArgumentException("hostName cannot be null or empty");
            }
            RemoteDocumentsActions remoteDocumentsActionForUnknownServers = userContext.Configuration.RemoteDocumentsActionForUnknownServers;

            string[] blockedDocumentStoreList = userContext.Configuration.BlockedDocumentStoreList;
            for (int i = 0; i < blockedDocumentStoreList.Length; i++)
            {
                if (string.Equals(hostName, blockedDocumentStoreList[i], StringComparison.OrdinalIgnoreCase))
                {
                    return(true);
                }
            }
            string[] allowedDocumentStoreList = userContext.Configuration.AllowedDocumentStoreList;
            for (int j = 0; j < allowedDocumentStoreList.Length; j++)
            {
                if (string.Equals(hostName, allowedDocumentStoreList[j], StringComparison.OrdinalIgnoreCase))
                {
                    return(false);
                }
            }
            return(remoteDocumentsActionForUnknownServers == RemoteDocumentsActions.Block);
        }
예제 #2
0
        internal static void RemoteDocumentsActionForUnknownServersSetter(object value, IPropertyBag propertyBag)
        {
            RemoteDocumentsActions remoteDocumentsActions = (RemoteDocumentsActions)value;
            object obj = propertyBag[ADMobileVirtualDirectorySchema.MobileClientFlags];

            if (obj == null)
            {
                obj = ADMobileVirtualDirectorySchema.DefaultMobileClientFlags;
            }
            if (remoteDocumentsActions == RemoteDocumentsActions.Block)
            {
                propertyBag[ADMobileVirtualDirectorySchema.MobileClientFlags] = ((MobileClientFlagsType)obj | MobileClientFlagsType.RemoteDocumentsActionForUnknownServers);
                return;
            }
            if (remoteDocumentsActions == RemoteDocumentsActions.Allow)
            {
                propertyBag[ADMobileVirtualDirectorySchema.MobileClientFlags] = ((MobileClientFlagsType)obj & ~MobileClientFlagsType.RemoteDocumentsActionForUnknownServers);
                return;
            }
            throw new ArgumentException("value can only be Allow or Block");
        }