fix: discord was not set to teh right field

This commit is contained in:
silver 2023-07-29 18:41:53 +01:00
parent 1ba6a55506
commit ba180179b0

View file

@ -161,7 +161,7 @@ async fn update_accounts(pool: &Pool<Sqlite>, config: &Config) {
tmp_account.uid_number = tmp.attrs["uidNumber"][0].clone().parse().unwrap_or(0); tmp_account.uid_number = tmp.attrs["uidNumber"][0].clone().parse().unwrap_or(0);
} }
if tmp.attrs.contains_key("skDiscord") && !tmp.attrs["skDiscord"].is_empty() { if tmp.attrs.contains_key("skDiscord") && !tmp.attrs["skDiscord"].is_empty() {
tmp_account.user = tmp.attrs["skDiscord"][0].clone(); tmp_account.discord = Option::from(tmp.attrs["skDiscord"][0].clone());
} }
if tmp.attrs.contains_key("skMemberOf") && !tmp.attrs["skMemberOf"].is_empty() && tmp.attrs["skMemberOf"].contains(&String::from("cn=skynet-users,ou=groups,dc=skynet,dc=ie")) { if tmp.attrs.contains_key("skMemberOf") && !tmp.attrs["skMemberOf"].is_empty() && tmp.attrs["skMemberOf"].contains(&String::from("cn=skynet-users,ou=groups,dc=skynet,dc=ie")) {
tmp_account.enabled = true; tmp_account.enabled = true;