From 536c5cf2de1eddf78033f53c502e64baccac150d Mon Sep 17 00:00:00 2001 From: DimDone Date: Tue, 16 Jul 2024 23:20:32 +0400 Subject: [PATCH] Fixed the displaying of optional attributes Fixed the displaying of optional attributes msDS-User-Account-Control-Computed and msDS-User-Password-Expyre-Time-Computed --- src/adldap/ad_config.cpp | 2 +- src/adldap/ad_defines.h | 2 ++ src/adldap/ad_display.cpp | 4 ++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/adldap/ad_config.cpp b/src/adldap/ad_config.cpp index 2bfe0e16..df1ce557 100644 --- a/src/adldap/ad_config.cpp +++ b/src/adldap/ad_config.cpp @@ -341,7 +341,6 @@ AttributeType AdConfig::get_attribute_type(const QString &attribute) const { const QString attribute_syntax = schema.get_string(ATTRIBUTE_ATTRIBUTE_SYNTAX); const QString om_syntax = schema.get_string(ATTRIBUTE_OM_SYNTAX); - if (type_map.contains(attribute_syntax) && type_map[attribute_syntax].contains(om_syntax)) { return type_map[attribute_syntax][om_syntax]; } else { @@ -359,6 +358,7 @@ LargeIntegerSubtype AdConfig::get_attribute_large_integer_subtype(const QString ATTRIBUTE_LOCKOUT_TIME, ATTRIBUTE_BAD_PWD_TIME, ATTRIBUTE_CREATION_TIME, + ATTRIBUTE_MSDS_USER_PASSWORD_EXPIRY_TIME_COMPUTED, }; static const QList timespans = { ATTRIBUTE_MAX_PWD_AGE, diff --git a/src/adldap/ad_defines.h b/src/adldap/ad_defines.h index 216d38c7..b7f4a59d 100644 --- a/src/adldap/ad_defines.h +++ b/src/adldap/ad_defines.h @@ -217,6 +217,8 @@ enum SystemFlagsBit { #define ATTRIBUTE_MS_DS_PASSWORD_SETTINGS_PRECEDENCE "msDS-PasswordSettingsPrecedence" #define ATTRIBUTE_PSO_APPLIES_TO "msDS-PSOAppliesTo" #define ATTRIBUTE_DEFAULT_NAMING_CONTEXT "defaultNamingContext" +#define ATTRIBUTE_MSDS_USER_PASSWORD_EXPIRY_TIME_COMPUTED "msDS-UserPasswordExpiryTimeComputed" +#define ATTRIBUTE_MSDS_USER_ACCOUNT_CONTROL_COMPUTED "msDS-User-Account-Control-Computed" #define CLASS_GROUP "group" diff --git a/src/adldap/ad_display.cpp b/src/adldap/ad_display.cpp index 138ee3c8..ce22cec1 100644 --- a/src/adldap/ad_display.cpp +++ b/src/adldap/ad_display.cpp @@ -31,6 +31,7 @@ #include #include #include +#include const qint64 SECONDS_TO_MILLIS = 1000LL; const qint64 MINUTES_TO_SECONDS = 60LL; @@ -63,7 +64,7 @@ QString attribute_display_value(const QString &attribute, const QByteArray &valu return samaccounttype_to_display_value(value); } else if (attribute == ATTRIBUTE_PRIMARY_GROUP_ID) { return primarygrouptype_to_display_value(value); - } else if (attribute == ATTRIBUTE_GROUP_TYPE || attribute == ATTRIBUTE_SYSTEM_FLAGS) { + } else if (attribute == ATTRIBUTE_GROUP_TYPE || attribute == ATTRIBUTE_SYSTEM_FLAGS || attribute == ATTRIBUTE_MSDS_USER_ACCOUNT_CONTROL_COMPUTED) { return attribute_hex_displayed_value(attribute, value); } else if (attribute == ATTRIBUTE_MS_DS_SUPPORTED_ETYPES) { return msds_supported_etypes_to_display_value(value); @@ -73,7 +74,6 @@ QString attribute_display_value(const QString &attribute, const QByteArray &valu } case AttributeType_LargeInteger: { const LargeIntegerSubtype subtype = adconfig->get_attribute_large_integer_subtype(attribute); - switch (subtype) { case LargeIntegerSubtype_Datetime: return large_integer_datetime_display_value(attribute, value, adconfig); case LargeIntegerSubtype_Timespan: return timespan_display_value(value);