sources/ldap: fix logic error in Active Directory account disabled status

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2021-10-03 00:30:35 +02:00
parent f6e8dbfb5e
commit 8dd77793a0
5 changed files with 6 additions and 10 deletions

View File

@ -117,7 +117,7 @@ This section guides you through submitting a bug report for authentik. Following
Whenever authentik encounters an error, it will be logged as an Event with the type `system_exception`. This event type has a button to directly open a pre-filled GitHub issue form. Whenever authentik encounters an error, it will be logged as an Event with the type `system_exception`. This event type has a button to directly open a pre-filled GitHub issue form.
This form will have the full stack trace of the error that ocurred and shouldn't contain any sensitive data. This form will have the full stack trace of the error that occurred and shouldn't contain any sensitive data.
### Suggesting Enhancements ### Suggesting Enhancements

View File

@ -20,11 +20,7 @@ test:
lint-fix: lint-fix:
isort authentik tests lifecycle isort authentik tests lifecycle
black authentik tests lifecycle black authentik tests lifecycle
codespell -I .github/codespell-words.txt -w authentik codespell -I .github/codespell-words.txt -S 'web/src/locales/**' -w authentik internal cmd web/src website/src
codespell -I .github/codespell-words.txt -w internal
codespell -I .github/codespell-words.txt -w cmd
codespell -I .github/codespell-words.txt -w web/src
codespell -I .github/codespell-words.txt -w website/src
lint: lint:
pyright authentik tests lifecycle pyright authentik tests lifecycle

View File

@ -78,6 +78,6 @@ class UserLDAPSynchronizer(BaseLDAPSynchronizer):
ak_user.save() ak_user.save()
if "userAccountControl" in attributes: if "userAccountControl" in attributes:
uac = UserAccountControl(attributes.get("userAccountControl")) uac = UserAccountControl(attributes.get("userAccountControl"))
ak_user.is_active = not uac.ACCOUNTDISABLE ak_user.is_active = UserAccountControl.ACCOUNTDISABLE in uac
ak_user.save() ak_user.save()
return user_count return user_count

View File

@ -53,7 +53,7 @@ disable = [
"cyclic-import", "cyclic-import",
"protected-access", "protected-access",
"raise-missing-from", "raise-missing-from",
# To preverse django's translation function we need to use %-formatting # To preserve django's translation function we need to use %-formatting
"consider-using-f-string", "consider-using-f-string",
] ]

4
web/package-lock.json generated
View File

@ -7010,7 +7010,7 @@
"node_modules/require-from-string": { "node_modules/require-from-string": {
"version": "2.0.2", "version": "2.0.2",
"resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz",
"integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/view==",
"engines": { "engines": {
"node": ">=0.10.0" "node": ">=0.10.0"
} }
@ -13786,7 +13786,7 @@
"require-from-string": { "require-from-string": {
"version": "2.0.2", "version": "2.0.2",
"resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz",
"integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==" "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/view=="
}, },
"require-main-filename": { "require-main-filename": {
"version": "2.0.0", "version": "2.0.0",