Added more useful entry printouts

This commit is contained in:
Gregory Ballantine 2018-07-12 22:41:28 -04:00
parent 64d0860eba
commit 1ae83b3a4c

View File

@ -29,9 +29,16 @@ pub fn do_search(ldap_conn: LdapConn, search_base: &str) -> Result<(), Box<Error
for entry in rs { for entry in rs {
let search_entry = SearchEntry::construct(entry); let search_entry = SearchEntry::construct(entry);
if search_entry.attrs.get("uid").is_some() { // print the entry's DN
println!("{:?}", search_entry.attrs.get("uid").unwrap()[0]); println!("dn: {}", search_entry.dn);
// loop through the entry's attributes and print them out
for (key, val) in search_entry.attrs {
println!("{}: {:?}", key, val);
} }
// print a blank line
println!("");
} }
Ok(()) Ok(())