From e4c5ece5a98b716885265a76c4c939f9ae16c45d Mon Sep 17 00:00:00 2001 From: MayueCif Date: Wed, 31 Dec 2025 15:41:31 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=A2=9E=E5=BC=BALdapUser=E5=AF=B9?= =?UTF-8?q?=E8=B4=A6=E6=88=B7=E6=8E=A7=E5=88=B6=E6=A0=87=E5=BF=97=E4=BD=8D?= =?UTF-8?q?=E7=9A=84=E5=88=A4=E6=96=AD=E8=83=BD=E5=8A=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 新增IsAccountDisabled、IsNormalAccount属性,以及HasUserAccountControlFlag方法,便于判断用户账户控制(UserAccountControl)相关的标志位,提高代码可读性和易用性。 --- src/Utils/Ldap/Masa.Utils.Ldap.Novell/Entries/LdapUser.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Utils/Ldap/Masa.Utils.Ldap.Novell/Entries/LdapUser.cs b/src/Utils/Ldap/Masa.Utils.Ldap.Novell/Entries/LdapUser.cs index db5164320..2fde88045 100644 --- a/src/Utils/Ldap/Masa.Utils.Ldap.Novell/Entries/LdapUser.cs +++ b/src/Utils/Ldap/Masa.Utils.Ldap.Novell/Entries/LdapUser.cs @@ -58,4 +58,10 @@ public class LdapUser public LdapAddress Address { get; set; } = new(); public UserAccountControl UserAccountControl { get; set; } + + public bool IsAccountDisabled => (UserAccountControl & UserAccountControl.AccountDisabled) != 0; + + public bool IsNormalAccount => (UserAccountControl & UserAccountControl.NormalAccount) != 0; + + public bool HasUserAccountControlFlag(UserAccountControl flag) => (UserAccountControl & flag) != 0; } From 77853bdef57c5cc3fbea03dfb81bc2b0562b1cbd Mon Sep 17 00:00:00 2001 From: MayueCif Date: Mon, 5 Jan 2026 13:08:46 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=B8=BAUserAccountControl=E6=9E=9A?= =?UTF-8?q?=E4=B8=BE=E6=B7=BB=E5=8A=A0[Flags]=E7=89=B9=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 使UserAccountControl支持按位组合多个枚举值,便于表示和处理用户账户控制的多种状态。 --- .../Ldap/Masa.Utils.Ldap.Novell/Entries/UserAccountControl.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Utils/Ldap/Masa.Utils.Ldap.Novell/Entries/UserAccountControl.cs b/src/Utils/Ldap/Masa.Utils.Ldap.Novell/Entries/UserAccountControl.cs index 9ce203472..a23a0ec96 100644 --- a/src/Utils/Ldap/Masa.Utils.Ldap.Novell/Entries/UserAccountControl.cs +++ b/src/Utils/Ldap/Masa.Utils.Ldap.Novell/Entries/UserAccountControl.cs @@ -8,6 +8,7 @@ namespace Masa.Utils.Ldap.Novell.Entries; /// These values correspond to the userAccountControl attribute and are used as bitwise flags. /// Some flags are deprecated and should not be used in new code. /// +[Flags] public enum UserAccountControl { ///