{"action":"created","issue":{"url":"https://api.github.com/repos/snipe/snipe-it/issues/6158","repository_url":"https://api.github.com/repos/snipe/snipe-it","labels_url":"https://api.github.com/repos/snipe/snipe-it/issues/6158/labels{/name}","comments_url":"https://api.github.com/repos/snipe/snipe-it/issues/6158/comments","events_url":"https://api.github.com/repos/snipe/snipe-it/issues/6158/events","html_url":"https://github.com/snipe/snipe-it/issues/6158","id":357298591,"node_id":"MDU6SXNzdWUzNTcyOTg1OTE=","number":6158,"title":"Weird check for Ldap Account active","user":{"login":"Thoro","id":554474,"node_id":"MDQ6VXNlcjU1NDQ3NA==","avatar_url":"https://avatars1.githubusercontent.com/u/554474?v=4","gravatar_id":"","url":"https://api.github.com/users/Thoro","html_url":"https://github.com/Thoro","followers_url":"https://api.github.com/users/Thoro/followers","following_url":"https://api.github.com/users/Thoro/following{/other_user}","gists_url":"https://api.github.com/users/Thoro/gists{/gist_id}","starred_url":"https://api.github.com/users/Thoro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Thoro/subscriptions","organizations_url":"https://api.github.com/users/Thoro/orgs","repos_url":"https://api.github.com/users/Thoro/repos","events_url":"https://api.github.com/users/Thoro/events{/privacy}","received_events_url":"https://api.github.com/users/Thoro/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2018-09-05T16:02:31Z","updated_at":"2018-12-02T10:00:21Z","closed_at":null,"author_association":"NONE","body":"The code in LdapSync.php from #3640 uses this check:\r\n\r\n``` \r\n                if( array_key_exists('useraccountcontrol', $results[$i]) ) {\r\n                    $enabled_accounts = [\r\n                        '512', '544', '66048', '66080', '262656', '262688', '328192', '328224'\r\n                    ];\r\n                    $item['activated'] = ( in_array($results[$i]['useraccountcontrol'][0], $enabled_accounts) ) ? 1 : 0;\r\n                } else {\r\n                    $item['activated'] = 0;\r\n                }\r\n```\r\n\r\nBut AD actually defines pretty well that ACCOUNTDISABLE is 0x2, is there any specific reason to have the non-exhaustive list?\r\n\r\nWouldn't a check like this be better:\r\n\r\n``` \r\n                if( array_key_exists('useraccountcontrol', $results[$i]) ) {\r\n                    $item['activated'] = ($results[$i]['useraccountcontrol'][0] & 0x2) === 0x2 ? 0 : 1;\r\n                } else {\r\n                    $item['activated'] = 0;\r\n                }\r\n```\r\n\r\nAdditionally in the documentation https://snipe-it.readme.io/v4.6.3/docs/ldap-sync-login there is this ldap filter:\r\n\r\n&(sAMAccountType=805306368)(!(userAccountControl:1.2.840.113556.1.4.803:=2))\r\n\r\nwhich will exclude any deactivated users and break the disabling user account feature\r\n"},"comment":{"url":"https://api.github.com/repos/snipe/snipe-it/issues/comments/443495428","html_url":"https://github.com/snipe/snipe-it/issues/6158#issuecomment-443495428","issue_url":"https://api.github.com/repos/snipe/snipe-it/issues/6158","id":443495428,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0MzQ5NTQyOA==","user":{"login":"stale[bot]","id":26384082,"node_id":"MDM6Qm90MjYzODQwODI=","avatar_url":"https://avatars3.githubusercontent.com/in/1724?v=4","gravatar_id":"","url":"https://api.github.com/users/stale%5Bbot%5D","html_url":"https://github.com/apps/stale","followers_url":"https://api.github.com/users/stale%5Bbot%5D/followers","following_url":"https://api.github.com/users/stale%5Bbot%5D/following{/other_user}","gists_url":"https://api.github.com/users/stale%5Bbot%5D/gists{/gist_id}","starred_url":"https://api.github.com/users/stale%5Bbot%5D/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stale%5Bbot%5D/subscriptions","organizations_url":"https://api.github.com/users/stale%5Bbot%5D/orgs","repos_url":"https://api.github.com/users/stale%5Bbot%5D/repos","events_url":"https://api.github.com/users/stale%5Bbot%5D/events{/privacy}","received_events_url":"https://api.github.com/users/stale%5Bbot%5D/received_events","type":"Bot","site_admin":false},"created_at":"2018-12-02T10:00:21Z","updated_at":"2018-12-02T10:00:21Z","author_association":"NONE","body":"Is this still relevant? We haven't heard from anyone in a bit. If so, please comment with any updates or additional detail.\nThis issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Don't take it personally, we just need to keep a handle on things. Thank you for your contributions!\n"}}
{"actor":{"display_login":"stale"}}