Exemplo n.º 1
0
 protected bool CheckGroupAttribute(LDAPObject group, string groupAttr)
 {
     try
     {
         group.InvokeGet(groupAttr);
     }
     catch (Exception e)
     {
         log.ErrorFormat("Wrong Group Attribute parameter: {0}. {1}", groupAttr, e);
         return(false);
     }
     return(true);
 }
Exemplo n.º 2
0
 public string GetUserAttribute(LDAPObject user, string userAttribute)
 {
     try
     {
         var member = user.InvokeGet(userAttribute);
         if (member != null)
         {
             return(member.ToString());
         }
     }
     catch (Exception e)
     {
         Log.ErrorFormat("Wrong  User Attribute parameters: {0}. {1}", userAttribute, e);
     }
     return(null);
 }
Exemplo n.º 3
0
 protected bool CheckUserAttribute(LDAPObject user, string userAttr)
 {
     try
     {
         var userAttribute = user.InvokeGet(userAttr);
         if (userAttribute == null || string.IsNullOrWhiteSpace(userAttribute.ToString()))
         {
             log.ErrorFormat("Wrong Group Attribute parameter: {0}", userAttr);
             return(false);
         }
     }
     catch (Exception e)
     {
         log.ErrorFormat("Wrong Group Attribute parameter: {0}. {1}", userAttr, e);
         return(false);
     }
     return(true);
 }
Exemplo n.º 4
0
        protected bool CheckLoginAttribute(LDAPObject user, string loginAttribute)
        {
            string memberUser = null;

            try
            {
                var member = user.InvokeGet(loginAttribute);
                memberUser = member != null?member.ToString() : null;

                if (string.IsNullOrWhiteSpace(memberUser))
                {
                    log.ErrorFormat("Wrong Login Attribute parameter: {0}", memberUser);
                    return(false);
                }
            }
            catch (Exception e)
            {
                log.ErrorFormat("Wrong Login Attribute parameter: memberUser = {0}. {1}", memberUser, e);
                return(false);
            }
            return(true);
        }