Added more useful entry printouts
This commit is contained in:
parent
64d0860eba
commit
1ae83b3a4c
11
src/ldap.rs
11
src/ldap.rs
@ -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(())
|
||||||
|
Loading…
Reference in New Issue
Block a user