mirror of
				https://github.com/nitnelave/lldap.git
				synced 2023-04-12 14:25:13 +00:00 
			
		
		
		
	handle dn attribute being queried as distinguishedname
This commit is contained in:
		
							parent
							
								
									b54fe9128d
								
							
						
					
					
						commit
						b2071d29e2
					
				@ -108,7 +108,7 @@ fn get_user_attribute(user: &User, attribute: &str, dn: &str) -> Result<Option<V
 | 
				
			|||||||
            "mailAccount".to_string(),
 | 
					            "mailAccount".to_string(),
 | 
				
			||||||
            "person".to_string(),
 | 
					            "person".to_string(),
 | 
				
			||||||
        ],
 | 
					        ],
 | 
				
			||||||
        "dn" => vec![dn.to_string()],
 | 
					        "dn" | "distinguishedname" => vec![dn.to_string()],
 | 
				
			||||||
        "uid" => vec![user.user_id.to_string()],
 | 
					        "uid" => vec![user.user_id.to_string()],
 | 
				
			||||||
        "mail" => vec![user.email.clone()],
 | 
					        "mail" => vec![user.email.clone()],
 | 
				
			||||||
        "givenname" => vec![user.first_name.clone()],
 | 
					        "givenname" => vec![user.first_name.clone()],
 | 
				
			||||||
@ -152,7 +152,7 @@ fn get_group_attribute(
 | 
				
			|||||||
) -> Result<Option<Vec<String>>> {
 | 
					) -> Result<Option<Vec<String>>> {
 | 
				
			||||||
    Ok(Some(match attribute.to_lowercase().as_str() {
 | 
					    Ok(Some(match attribute.to_lowercase().as_str() {
 | 
				
			||||||
        "objectclass" => vec!["groupOfUniqueNames".to_string()],
 | 
					        "objectclass" => vec!["groupOfUniqueNames".to_string()],
 | 
				
			||||||
        "dn" => vec![format!(
 | 
					        "dn" | "distinguishedname" => vec![format!(
 | 
				
			||||||
            "cn={},ou=groups,{}",
 | 
					            "cn={},ou=groups,{}",
 | 
				
			||||||
            group.display_name, base_dn_str
 | 
					            group.display_name, base_dn_str
 | 
				
			||||||
        )],
 | 
					        )],
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user