예제 #1
0
 public static PropertyValueCollection GetGroupAttribute(LDAPGroup domainGroup, string groupAttribute)
 {
     try
     {
         return(domainGroup.GetValues(groupAttribute));
     }
     catch (Exception e)
     {
         _log.ErrorFormat("Wrong Group Attribute parameters: {0}. {1}", groupAttribute, e);
     }
     return(null);
 }
예제 #2
0
 private static bool CheckGroupAttribute(LDAPGroup group, string groupAttr)
 {
     try
     {
         var groupAttribute = group.GetValues(groupAttr);
         if (groupAttribute == null)
         {
             _log.ErrorFormat("Wrong Group Attribute parameter: {0}", groupAttr);
             return(false);
         }
     }
     catch (Exception e)
     {
         _log.ErrorFormat("Wrong Group Attribute parameter: {0}. {1}", groupAttr, e);
         return(false);
     }
     return(true);
 }
예제 #3
0
 public static bool UserExistsInGroup(LDAPGroup domainGroup, string memberString, string groupAttribute)
 {
     try
     {
         var members = domainGroup.GetValues(groupAttribute);
         if (memberString != null)
         {
             foreach (var member in members)
             {
                 if (memberString.ToString().Equals(member.ToString(), StringComparison.InvariantCultureIgnoreCase))
                 {
                     return(true);
                 }
             }
         }
     }
     catch (Exception e)
     {
         _log.ErrorFormat("Wrong Group Attribute parameters: {0}. {1}", groupAttribute, e);
     }
     return(false);
 }
예제 #4
0
 public static PropertyValueCollection GetGroupAttribute(LDAPGroup domainGroup, string groupAttribute)
 {
     try
     {
         return domainGroup.GetValues(groupAttribute);
     }
     catch (Exception e)
     {
         _log.ErrorFormat("Wrong Group Attribute parameters: {0}. {1}", groupAttribute, e);
     }
     return null;
 }
예제 #5
0
 public static bool UserExistsInGroup(LDAPGroup domainGroup, string memberString, string groupAttribute)
 {
     try
     {
         var members = domainGroup.GetValues(groupAttribute);
         if (memberString != null)
         {
             foreach (var member in members)
             {
                 if (memberString.ToString().Equals(member.ToString(), StringComparison.InvariantCultureIgnoreCase))
                 {
                     return true;
                 }
             }
         }
     }
     catch (Exception e)
     {
         _log.ErrorFormat("Wrong Group Attribute parameters: {0}. {1}", groupAttribute, e);
     }
     return false;
 }
예제 #6
0
 private static bool CheckGroupAttribute(LDAPGroup group, string groupAttr)
 {
     try
     {
         var groupAttribute = group.GetValues(groupAttr);
         if (groupAttribute == null)
         {
             _log.ErrorFormat("Wrong Group Attribute parameter: {0}", groupAttr);
             return false;
         }
     }
     catch (Exception e)
     {
         _log.ErrorFormat("Wrong Group Attribute parameter: {0}. {1}", groupAttr, e);
         return false;
     }
     return true;
 }