fix: no need for skSecure
This commit is contained in:
parent
142dbf9914
commit
11b348326a
1 changed files with 3 additions and 3 deletions
|
@ -181,7 +181,7 @@ async fn update_accounts(pool: &Pool<Sqlite>, config: &Config) {
|
||||||
ldap.simple_bind(&config.ldap_admin, &config.ldap_admin_pw).unwrap().success().unwrap();
|
ldap.simple_bind(&config.ldap_admin, &config.ldap_admin_pw).unwrap().success().unwrap();
|
||||||
|
|
||||||
// use this to pre load a large chunk of data
|
// 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() {
|
if let Ok((rs, _res)) = x.success() {
|
||||||
for entry in rs {
|
for entry in rs {
|
||||||
let tmp = SearchEntry::construct(entry);
|
let tmp = SearchEntry::construct(entry);
|
||||||
|
@ -215,8 +215,8 @@ async fn update_accounts(pool: &Pool<Sqlite>, 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")) {
|
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;
|
tmp_account.enabled = true;
|
||||||
}
|
}
|
||||||
if tmp.attrs.contains_key("skSecure") && !tmp.attrs["skSecure"].is_empty() {
|
if tmp.attrs.contains_key("userPassword") && !tmp.attrs["userPassword"].is_empty() {
|
||||||
tmp_account.secure = true;
|
tmp_account.secure = tmp.attrs["userPassword"][0].starts_with("{SSHA512}")
|
||||||
}
|
}
|
||||||
|
|
||||||
if !tmp_account.user.is_empty() {
|
if !tmp_account.user.is_empty() {
|
||||||
|
|
Loading…
Reference in a new issue