diff --git a/src/lib.rs b/src/lib.rs index 2bd7bea..fe7831e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -181,7 +181,7 @@ async fn update_accounts(pool: &Pool, config: &Config) { ldap.simple_bind(&config.ldap_admin, &config.ldap_admin_pw).unwrap().success().unwrap(); // use this to pre load a large chunk of data - if let Ok(x) = ldap.search("ou=users,dc=skynet,dc=ie", Scope::OneLevel, "(objectClass=*)", vec!["uid", "uidNumber", "skDiscord", "skMemberOf", "mail", "skID", "skSecure"]) { + if let Ok(x) = ldap.search("ou=users,dc=skynet,dc=ie", Scope::OneLevel, "(objectClass=*)", vec!["uid", "uidNumber", "skDiscord", "skMemberOf", "mail", "skID", "userPassword"]) { if let Ok((rs, _res)) = x.success() { for entry in rs { let tmp = SearchEntry::construct(entry); @@ -215,8 +215,8 @@ async fn update_accounts(pool: &Pool, config: &Config) { if tmp.attrs.contains_key("skMemberOf") && !tmp.attrs["skMemberOf"].is_empty() && tmp.attrs["skMemberOf"].contains(&String::from("cn=skynet-users-linux,ou=groups,dc=skynet,dc=ie")) { tmp_account.enabled = true; } - if tmp.attrs.contains_key("skSecure") && !tmp.attrs["skSecure"].is_empty() { - tmp_account.secure = true; + if tmp.attrs.contains_key("userPassword") && !tmp.attrs["userPassword"].is_empty() { + tmp_account.secure = tmp.attrs["userPassword"][0].starts_with("{SSHA512}") } if !tmp_account.user.is_empty() {