Logo Search packages:      
Sourcecode: lat version File versions  Download package

LdapEntry [] lat::LdapServer::Search ( string  searchBase,
int  searchScope,
string  searchFilter,
string[]  searchAttrs 
) [inline]

Searches the directory.

Parameters:
searchBase Where to start the search
searchScope Scope of search
searchFilter Filter to search for
searchAttrs Attributes to search for
Returns:
List of entries matching filter

Definition at line 255 of file LdapServer.cs.

Referenced by Copy().

            {     
                  if (!conn.Connected)
                        return null;

                  try {

                        List<LdapEntry> retVal = new List<LdapEntry> ();
                        RfcFilter rfcFilter = new RfcFilter (searchFilter);
                        
                        LdapSearchConstraints cons = new LdapSearchConstraints ();
                        cons.MaxResults = 0;

                        LdapSearchQueue queue = conn.Search (searchBase,
                                    searchScope,
                                    rfcFilter.filterToString(),
                                    searchAttrs,
                                    false,
                                    (LdapSearchQueue) null,
                                    cons);

                        LdapMessage msg;

                        while ((msg = queue.getResponse ()) != null) {

                              if (msg is LdapSearchResult) {
                                    LdapEntry entry = ((LdapSearchResult) msg).Entry;
                                    retVal.Add (entry);
                              }
                        }

                        return retVal.ToArray ();

                  } catch (Exception e) {

                        Log.Debug (e);
                        return null;
                  }
            }


Generated by  Doxygen 1.6.0   Back to index